]> git.eshelyaron.com Git - emacs.git/commitdiff
Properly operate on current fileset revision in vc-hg-print-log
authorSpencer Baugh <sbaugh@janestreet.com>
Wed, 2 Oct 2024 19:20:31 +0000 (15:20 -0400)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:38:43 +0000 (19:38 +0200)
* lisp/vc/vc-hg.el (vc-hg-print-log): If start-revision is nil,
reliably log the working revision. (bug#73604)

(cherry picked from commit fbeb3d22b7fabf13cd788772ade2ed594ee60872)

lisp/vc/vc-hg.el

index 876d86dc24ffb5d3e866d0fe168359f24b84f165..4cdcfe5cb960981b8815ec36e08b86f3488b667b 100644 (file)
@@ -397,8 +397,11 @@ specific file to query."
 (defun vc-hg-print-log (files buffer &optional shortlog start-revision limit)
   "Print commit log associated with FILES into specified BUFFER.
 If SHORTLOG is non-nil, use a short format based on `vc-hg-root-log-format'.
-If START-REVISION is non-nil, it is the newest revision to show.
-If LIMIT is non-nil, show no more than this many entries."
+If LIMIT is non-nil, show no more than this many entries.
+
+If START-REVISION is nil, the commit log is printed starting from the
+working directory parent (revset \".\").  If START-REVISION is non-nil,
+the log is printed starting from that revision."
   ;; `vc-do-command' creates the buffer, but we need it before running
   ;; the command.
   (vc-setup-buffer buffer)
@@ -408,8 +411,8 @@ If LIMIT is non-nil, show no more than this many entries."
     (with-current-buffer
        buffer
       (apply #'vc-hg-command buffer 'async files "log"
+             (format "-r%s:0" (or start-revision "."))
             (nconc
-             (when start-revision (list (format "-r%s:0" start-revision)))
              (when limit (list "-l" (format "%s" limit)))
               (when (eq vc-log-view-type 'with-diff)
                 (list "-p"))