From: Spencer Baugh Date: Wed, 2 Oct 2024 19:20:31 +0000 (-0400) Subject: Properly operate on current fileset revision in vc-hg-print-log X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4b0fccffe5ac4f744403426ef6940802957ca6a2;p=emacs.git Properly operate on current fileset revision in vc-hg-print-log * 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) --- diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 876d86dc24f..4cdcfe5cb96 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -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"))