changeset 95896:7561b5637b81

(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.
author Dan Nicolaescu <dann@ics.uci.edu>
date Fri, 13 Jun 2008 14:51:06 +0000
parents 2ab93a71b21a
children d87b6172ad66
files etc/NEWS lisp/ChangeLog lisp/vc.el
diffstat 3 files changed, 30 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/etc/NEWS	Fri Jun 13 14:40:57 2008 +0000
+++ b/etc/NEWS	Fri Jun 13 14:51:06 2008 +0000
@@ -575,6 +575,10 @@
 
 *** 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
--- a/lisp/ChangeLog	Fri Jun 13 14:40:57 2008 +0000
+++ b/lisp/ChangeLog	Fri Jun 13 14:51:06 2008 +0000
@@ -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>
 
--- a/lisp/vc.el	Fri Jun 13 14:40:57 2008 +0000
+++ b/lisp/vc.el	Fri Jun 13 14:51:06 2008 +0000
@@ -2966,8 +2966,12 @@
     ["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 @@
 	  (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 @@
 	     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.