From: Dan Nicolaescu Date: Fri, 13 Jun 2008 14:51:06 +0000 (+0000) Subject: (vc-annotate-show-diff-revision-at-line): Move most of the code to ... X-Git-Tag: emacs-pretest-23.0.90~4814 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=38b627cea0c61aa6837feab5db93815ea4b03d65;p=emacs.git (vc-annotate-show-diff-revision-at-line): Move most of the code to ... (vc-annotate-show-diff-revision-at-line-internal): ... here. New function. (vc-annotate-show-changeset-diff-revision-at-line): New function. (vc-annotate-mode-menu): Bind it. --- diff --git a/etc/NEWS b/etc/NEWS index 8ffe8613ba4..f06adf69f5d 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -575,6 +575,10 @@ set of files. *** The VC mode-line entry now has a tooltip that explains the VC file status. +*** In VC Annotate mode, for VC systems that support changesets, you can +see the diff for the whole changeset (not only for the current file) +by using the vc-annotate-show-changeset-diff-revision-at-line function. + *** In VC Annotate mode, you can type V to toggle the annotation visibility. *** In VC Annotate mode, you can type f to show the file revision on diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d4faca6f665..66baf0d960c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,7 +1,12 @@ 2008-06-13 Dan Nicolaescu - * vc.el (vc-delete-file): Bound default-directory before calling + * vc.el (vc-delete-file): Bind default-directory before calling the backend. + (vc-annotate-show-diff-revision-at-line): Move most of the code to ... + (vc-annotate-show-diff-revision-at-line-internal): ... here. New + function. + (vc-annotate-show-changeset-diff-revision-at-line): New function. + (vc-annotate-mode-menu): Bind it. 2008-06-13 Jason Rumney diff --git a/lisp/vc.el b/lisp/vc.el index 2c4a88124a9..e9af02d7403 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -2966,8 +2966,12 @@ cover the range from the oldest annotation to the newest." ["Show log of revision at line" vc-annotate-show-log-revision-at-line :help "Visit the log of the revision at line"] ["Show diff of revision at line" vc-annotate-show-diff-revision-at-line - :help - "Visit the diff of the revision at line from its previous revision"] + :help "Visit the diff of the revision at line from its previous revision"] + ["Show changeset diff of revision at line" + vc-annotate-show-changeset-diff-revision-at-line + :enable + (eq 'repository (vc-call-backend ,vc-annotate-backend 'revision-granularity)) + :help "Visit the diff of the revision at line from its previous revision"] ["Visit revision at line" vc-annotate-find-revision-at-line :help "Visit the revision identified in the current line"])) @@ -3158,9 +3162,7 @@ revisions after." (message "Cannot extract revision number from the current line") (vc-print-log rev-at-line))))) -(defun vc-annotate-show-diff-revision-at-line () - "Visit the diff of the revision at line from its previous revision." - (interactive) +(defun vc-annotate-show-diff-revision-at-line-internal (fileset) (if (not (equal major-mode 'vc-annotate-mode)) (message "Cannot be invoked outside of a vc annotate buffer") (let ((rev-at-line (vc-annotate-extract-revision-at-line)) @@ -3177,11 +3179,22 @@ revisions after." nil ;; The value passed here should follow what ;; `vc-deduce-fileset' returns. - (cons vc-annotate-backend - (cons (list vc-annotate-parent-file) nil)) + (cons vc-annotate-backend (cons fileset nil)) prev-rev rev-at-line)) (switch-to-buffer "*vc-diff*")))))) +(defun vc-annotate-show-diff-revision-at-line () + "Visit the diff of the revision at line from its previous revision." + (interactive) + (vc-annotate-show-diff-revision-at-line-internal (list vc-annotate-parent-file))) + +(defun vc-annotate-show-changeset-diff-revision-at-line () + "Visit the diff of the revision at line from its previous revision for all files in the changeset." + (interactive) + (when (eq 'file (vc-call-backend vc-annotate-backend 'revision-granularity)) + (error "The %s backend does not support changeset diffs" vc-annotate-backend)) + (vc-annotate-show-diff-revision-at-line-internal nil)) + (defun vc-annotate-warp-revision (revspec) "Annotate the revision described by REVSPEC.