Skip to content

Commit 199acd6

Browse files
committed
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.
1 parent a1e2a68 commit 199acd6

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

etc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,9 @@ key binding
184184
The original key binding was 'M-s', which interfered with I-search,
185185
since the latter uses 'M-s' as a prefix key of the search prefix map.
186186

187+
** vc-print-branch-log shows the change log for BRANCH from its root
188+
directory instead of the default directory.
189+
187190

188191
* Incompatible Lisp Changes in Emacs 28.1
189192

lisp/vc/vc.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2558,15 +2558,17 @@ with its diffs (if the underlying VCS supports that)."
25582558

25592559
;;;###autoload
25602560
(defun vc-print-branch-log (branch)
2561-
"Show the change log for BRANCH in a window."
2561+
"Show the change log for BRANCH root in a window."
25622562
(interactive
25632563
(list
25642564
(vc-read-revision "Branch to log: ")))
25652565
(when (equal branch "")
25662566
(error "No branch specified"))
2567-
(vc-print-log-internal (vc-responsible-backend default-directory)
2568-
(list default-directory) branch t
2569-
(when (> vc-log-show-limit 0) vc-log-show-limit)))
2567+
(let* ((backend (vc-responsible-backend default-directory))
2568+
(rootdir (vc-call-backend backend 'root default-directory)))
2569+
(vc-print-log-internal backend
2570+
(list rootdir) branch t
2571+
(when (> vc-log-show-limit 0) vc-log-show-limit))))
25702572

25712573
;;;###autoload
25722574
(defun vc-log-incoming (&optional remote-location)

0 commit comments

Comments
 (0)