changeset 107794:c4daeb1eaaf1

Fix default-directory for vc-root-diff. * vc.el (vc-root-diff): Bind default-directory to the root directory for the diff command.
author Dan Nicolaescu <dann@ics.uci.edu>
date Tue, 06 Apr 2010 21:14:56 -0700
parents d3738a1728c6
children d47e1fb98df3
files lisp/ChangeLog lisp/vc.el
diffstat 2 files changed, 14 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Apr 06 21:06:23 2010 -0700
+++ b/lisp/ChangeLog	Tue Apr 06 21:14:56 2010 -0700
@@ -1,3 +1,9 @@
+2010-04-07  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	Fix default-directory for vc-root-diff.
+	* vc.el (vc-root-diff): Bind default-directory to the root
+	directory for the diff command.
+
 2010-04-07  Michael McNamara  <mac@mail.brushroad.com>
 
         * verilog-mode.el (verilog-forward-sexp, verilog-calc-1): Support
--- a/lisp/vc.el	Tue Apr 06 21:06:23 2010 -0700
+++ b/lisp/vc.el	Tue Apr 06 21:14:56 2010 -0700
@@ -1642,9 +1642,14 @@
 	(error "Buffer is not version controlled"))
       (setq rootdir (vc-call-backend backend 'root default-directory))
       (setq working-revision (vc-working-revision rootdir))
-      (vc-diff-internal
-       t (list backend (list rootdir) working-revision) nil nil
-       (called-interactively-p 'interactive)))))
+      ;; VC diff for the root directory produces output that is
+      ;; relative to it.  Bind default-directory to the root directory
+      ;; here, this way the *vc-diff* buffer is setup correctly, so
+      ;; relative file names work.
+      (let ((default-directory rootdir))
+	(vc-diff-internal
+	 t (list backend (list rootdir) working-revision) nil nil
+	 (called-interactively-p 'interactive))))))
 
 ;;;###autoload
 (defun vc-revision-other-window (rev)