From a236442581b52a8d83df52e42a848e7482d62f49 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Fri, 17 Apr 2026 14:39:03 -0400 Subject: [PATCH] vc-hg--checkin: Use vc-hg--active-bookmark-internal * lisp/vc/vc-hg.el (vc-hg--active-bookmark-internal): Make it work when default-directory is not the repository root. (vc-hg--checkin): Use vc-hg--active-bookmark-internal instead of vc-hg--working-branch. --- lisp/vc/vc-hg.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 08a58425104..1c12271e0cb 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -325,13 +325,14 @@ large repositories." (defun vc-hg--active-bookmark-internal (rev) (when (equal rev ".") - (let* ((current-bookmarks-file ".hg/bookmarks.current")) - (when (file-exists-p current-bookmarks-file) - (ignore-errors - (with-temp-buffer - (insert-file-contents current-bookmarks-file) - (buffer-substring-no-properties - (point-min) (point-max)))))))) + (let* ((current-bookmarks-file + (expand-file-name ".hg/bookmarks.current" + (vc-hg-root default-directory)))) + (and (file-exists-p current-bookmarks-file) + (ignore-errors + (with-temp-buffer + (insert-file-contents current-bookmarks-file) + (buffer-substring-no-properties (point-min) (point-max)))))))) (defun vc-hg--run-log (template rev path) (ignore-errors @@ -1305,7 +1306,7 @@ It is an error to supply both or neither." ;; need to make both of them part of the async command, ;; possibly by writing out a tiny shell script (bug#79235). (when patch-file - (let ((bmark (alist-get 'bookmark (vc-hg--working-branch)))) + (let ((bmark (vc-hg--active-bookmark-internal "."))) (when bmark (vc-hg-command nil 0 nil "bookmark" "-f" "-r" "tip" bmark)) (vc-hg-command nil 0 nil "update" "--merge"