emacs-diffs
[Top][All Lists]
Advanced

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

master 199acd6: In vc-print-branch-log use root instead of the default d


From: Juri Linkov
Subject: master 199acd6: In vc-print-branch-log use root instead of the default directory (bug#39704)
Date: Mon, 9 Mar 2020 19:34:31 -0400 (EDT)

branch: master
commit 199acd6270ea904e36846984887bad056d40f70b
Author: Juri Linkov <address@hidden>
Commit: Juri Linkov <address@hidden>

    In vc-print-branch-log use root instead of the default directory (bug#39704)
    
    * lisp/vc/vc.el (vc-print-branch-log): Use rootdir instead of
    default-directory for the second arg of vc-print-log-internal.
---
 etc/NEWS      |  3 +++
 lisp/vc/vc.el | 10 ++++++----
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 47b87af..52ba1f6 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -184,6 +184,9 @@ key             binding
 The original key binding was 'M-s', which interfered with I-search,
 since the latter uses 'M-s' as a prefix key of the search prefix map.
 
+** vc-print-branch-log shows the change log for BRANCH from its root
+directory instead of the default directory.
+
 
 * Incompatible Lisp Changes in Emacs 28.1
 
diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
index 96c400c..607fb37 100644
--- a/lisp/vc/vc.el
+++ b/lisp/vc/vc.el
@@ -2558,15 +2558,17 @@ with its diffs (if the underlying VCS supports that)."
 
 ;;;###autoload
 (defun vc-print-branch-log (branch)
-  "Show the change log for BRANCH in a window."
+  "Show the change log for BRANCH root in a window."
   (interactive
    (list
     (vc-read-revision "Branch to log: ")))
   (when (equal branch "")
     (error "No branch specified"))
-  (vc-print-log-internal (vc-responsible-backend default-directory)
-                         (list default-directory) branch t
-                         (when (> vc-log-show-limit 0) vc-log-show-limit)))
+  (let* ((backend (vc-responsible-backend default-directory))
+         (rootdir (vc-call-backend backend 'root default-directory)))
+    (vc-print-log-internal backend
+                           (list rootdir) branch t
+                           (when (> vc-log-show-limit 0) vc-log-show-limit))))
 
 ;;;###autoload
 (defun vc-log-incoming (&optional remote-location)



reply via email to

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