]> git.eshelyaron.com Git - emacs.git/commitdiff
(vc-annotate-show-diff-revision-at-line): Move most of the code to ...
authorDan Nicolaescu <dann@ics.uci.edu>
Fri, 13 Jun 2008 14:51:06 +0000 (14:51 +0000)
committerDan Nicolaescu <dann@ics.uci.edu>
Fri, 13 Jun 2008 14:51:06 +0000 (14:51 +0000)
(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.

etc/NEWS
lisp/ChangeLog
lisp/vc.el

index 8ffe8613ba48502775317addaa4b69ed5b177048..f06adf69f5d27078e3c3c3e407177324bf9e6aa6 100644 (file)
--- 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
index d4faca6f665c74532525b3059262e7489639a18a..66baf0d960ca2555b5b8be82b5faaf053220998b 100644 (file)
@@ -1,7 +1,12 @@
 2008-06-13  Dan Nicolaescu  <dann@ics.uci.edu>
 
-       * 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  <jasonr@gnu.org>
 
index 2c4a88124a9afd42fbfb5fa252e5ea6b0e84516f..e9af02d74035848ae731c8475323b1800f046dfc 100644 (file)
@@ -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.