unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* vc-annotate: HG, change display, switch
@ 2015-10-31 12:48 Uwe Brauer
  2015-10-31 13:08 ` Dmitry Gutov
  0 siblings, 1 reply; 3+ messages in thread
From: Uwe Brauer @ 2015-10-31 12:48 UTC (permalink / raw)
  To: emacs-devel

Hello

It seems that I am not the only one who finds
vc-annotate for HG not very useful:
http://stackoverflow.com/questions/4670726/how-can-i-improve-emacs-vc-mode-annotation

The problems are the following:

    -  date is displayed in ISO format

    -  filename includes  all the directory structure so the prefix can
       be quite long

From that website
297 Wed Oct 06 15:21:30 2010 -0600 aws/lib/survey/creator/dbTemplates/web/views.sql: $$,$$

At the same page two different solutions are proposed. The second is
nice since its displays the annotate buffer with different colours.
However this solution is *slow* especially on large buffers.

The first solution is shorter but causes that the display of the buffer
lacks colours.

It seems to me that the switches for hg annotate should be

 hg annotate -dq -u -n

Rationale: -dq means short date, so all the ISO clutter goes away.

    -  -f or --fellow does not allow to get rid of the directory
        structure, for most version of hg. As I have been told that will
        change in the next release, but I think one should not rely on
        features which are only included in the most recent version of
        HG. That is why I think this option should be left out.

Any  comments?

That leaves me to propose:

(defun vc-hg-annotate-command (file buffer &optional revision)
  "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER.
Optional arg REVISION is a revision to annotate from."
  (apply #'vc-hg-command buffer 0 file "annotate" "-dq" "-u" "-n" 
	 (append (vc-switches 'hg 'annotate)
                 (if revision (list (concat "-r" revision))))))

However with this switch the colour display does not work neither.

Could somebody who knows the code could please comment on this issue?

Thanks

Uwe Brauer 




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vc-annotate: HG, change display, switch
  2015-10-31 12:48 vc-annotate: HG, change display, switch Uwe Brauer
@ 2015-10-31 13:08 ` Dmitry Gutov
  2015-10-31 18:11   ` Uwe Brauer
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Gutov @ 2015-10-31 13:08 UTC (permalink / raw)
  To: emacs-devel

On 10/31/2015 02:48 PM, Uwe Brauer wrote:

> Any  comments?
>
> That leaves me to propose:
>
> (defun vc-hg-annotate-command (file buffer &optional revision)
>    "Execute \"hg annotate\" on FILE, inserting the contents in BUFFER.
> Optional arg REVISION is a revision to annotate from."
>    (apply #'vc-hg-command buffer 0 file "annotate" "-dq" "-u" "-n"
> 	 (append (vc-switches 'hg 'annotate)
>                   (if revision (list (concat "-r" revision))))))

Thanks for looking into this.

> However with this switch the colour display does not work neither.
>
> Could somebody who knows the code could please comment on this issue?

You also need to update vc-hg-annotate-re, to recognize the new output.

The value returned by vc-hg-annotate-time, which uses that regexp, 
affects the highlighting.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: vc-annotate: HG, change display, switch
  2015-10-31 13:08 ` Dmitry Gutov
@ 2015-10-31 18:11   ` Uwe Brauer
  0 siblings, 0 replies; 3+ messages in thread
From: Uwe Brauer @ 2015-10-31 18:11 UTC (permalink / raw)
  To: emacs-devel


   > On 10/31/2015 02:48 PM, Uwe Brauer wrote:

   > Thanks for looking into this.


   > You also need to update vc-hg-annotate-re, to recognize the new output.

Oh regexp, great, I will try my best, might come back for advice.

   > The value returned by vc-hg-annotate-time, which uses that regexp,
   > affects the highlighting.






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-10-31 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-31 12:48 vc-annotate: HG, change display, switch Uwe Brauer
2015-10-31 13:08 ` Dmitry Gutov
2015-10-31 18:11   ` Uwe Brauer

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).