emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99841: Fix default-directory for vc-


From: Dan Nicolaescu
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99841: Fix default-directory for vc-root-diff.
Date: Tue, 06 Apr 2010 21:14:56 -0700
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99841
committer: Dan Nicolaescu <address@hidden>
branch nick: trunk
timestamp: Tue 2010-04-06 21:14:56 -0700
message:
  Fix default-directory for vc-root-diff.
  * vc.el (vc-root-diff): Bind default-directory to the root
  directory for the diff command.
modified:
  lisp/ChangeLog
  lisp/vc.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-04-07 04:06:23 +0000
+++ b/lisp/ChangeLog    2010-04-07 04:14:56 +0000
@@ -1,3 +1,9 @@
+2010-04-07  Dan Nicolaescu  <address@hidden>
+
+       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  <address@hidden>
 
         * verilog-mode.el (verilog-forward-sexp, verilog-calc-1): Support

=== modified file 'lisp/vc.el'
--- a/lisp/vc.el        2010-03-31 02:37:57 +0000
+++ b/lisp/vc.el        2010-04-07 04:14:56 +0000
@@ -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)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]