emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

vc-annotate: HG, change display, switch


From: Uwe Brauer
Subject: vc-annotate: HG, change display, switch
Date: Sat, 31 Oct 2015 12:48:02 +0000
User-agent: Gnus/5.13001 (Ma Gnus v0.10) Emacs/25.0.50 (gnu/linux)

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 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]