]> git.eshelyaron.com Git - emacs.git/commitdiff
In vc-print-branch-log use root instead of the default directory (bug#39704)
authorJuri Linkov <juri@linkov.net>
Mon, 9 Mar 2020 23:34:25 +0000 (01:34 +0200)
committerJuri Linkov <juri@linkov.net>
Mon, 9 Mar 2020 23:34:25 +0000 (01:34 +0200)
* 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
lisp/vc/vc.el

index 47b87afbc606ae6b1ff0b5f02ca71e5b36872d74..52ba1f6d354e39f93c2671c65f9dc7927fcd5a9d 100644 (file)
--- 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.
+
 \f
 * Incompatible Lisp Changes in Emacs 28.1
 
index 96c400c54adf3b9f8f700bb8dc2367ddc302327f..607fb37807cc4532f57e164a2f43b8d232d14baf 100644 (file)
@@ -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)