From: Dan Nicolaescu Date: Wed, 7 Apr 2010 04:14:56 +0000 (-0700) Subject: Fix default-directory for vc-root-diff. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~573 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7ec69e2b1ababe37e14a3fd941133c0f05818f38;p=emacs.git Fix default-directory for vc-root-diff. * vc.el (vc-root-diff): Bind default-directory to the root directory for the diff command. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 5f50546468b..1fda3acf555 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2010-04-07 Dan Nicolaescu + + 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 * verilog-mode.el (verilog-forward-sexp, verilog-calc-1): Support diff --git a/lisp/vc.el b/lisp/vc.el index 142a1508162..aef5fad12e1 100644 --- a/lisp/vc.el +++ b/lisp/vc.el @@ -1642,9 +1642,14 @@ saving the buffer." (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)