diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el index 6b9530c9570..2a328f5cc9f 100644 --- a/lisp/vc/vc-git.el +++ b/lisp/vc/vc-git.el @@ -1975,17 +1975,22 @@ log entries." (setq-local log-view-file-re regexp-unmatchable) (setq-local log-view-per-file-logs nil) (setq-local log-view-message-re - (if (not (memq vc-log-view-type '(long log-search with-diff))) + (if (if (eq vc-log-view-type 'log-unintegrated) + vc--shortlog + (not (memq vc-log-view-type '(long log-search with-diff)))) (cadr vc-git-root-log-format) "^commit +\\([0-9a-z]+\\)")) ;; Allow expanding short log entries. - (when (memq vc-log-view-type - '(short log-outgoing log-incoming log-unintegrated mergebase)) + (when (if (eq vc-log-view-type 'log-unintegrated) + vc--shortlog + (memq vc-log-view-type '(short log-outgoing log-incoming mergebase))) (setq truncate-lines t) (setq-local log-view-expanded-log-entry-function 'vc-git-expanded-log-entry)) (setq-local log-view-font-lock-keywords - (if (not (memq vc-log-view-type '(long log-search with-diff))) + (if (if (eq vc-log-view-type 'log-unintegrated) + vc--shortlog + (not (memq vc-log-view-type '(long log-search with-diff)))) (list (cons (nth 1 vc-git-root-log-format) (nth 2 vc-git-root-log-format))) (append diff --git a/lisp/vc/vc-hg.el b/lisp/vc/vc-hg.el index 02db4b134fe..a45279a574c 100644 --- a/lisp/vc/vc-hg.el +++ b/lisp/vc/vc-hg.el @@ -471,8 +471,9 @@ the log starting from that revision." (define-derived-mode vc-hg-log-view-mode log-view-mode "Hg-Log-View" (require 'add-log) ;; we need the add-log faces - (let ((shortp (memq vc-log-view-type - '(short log-incoming log-outgoing log-unintegrated)))) + (let ((shortp (if (eq vc-log-view-type 'log-unintegrated) + vc--shortlog + (memq vc-log-view-type '(short log-incoming log-outgoing))))) (setq-local log-view-file-re regexp-unmatchable) (setq-local log-view-per-file-logs nil) (setq-local log-view-message-re diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 882e572b46b..8506e182799 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -4309,6 +4309,13 @@ button for. Same for CURRENT-REVISION. LIMIT means the usual." "Show the log for the file name(s) %s the rename" before-after)))) +(defvar-local vc--shortlog nil + "Whether this is a shortlog. +This is a hack to fix bug#81215 which came up after the Emacs 31 freeze. +For Emacs 32 that bug is fixed by replacing `vc-log-view-type' with +`vc-log-view-types'.") +(put 'vc--shortlog 'permanent-local t) + (defun vc-print-log-internal (backend files working-revision &optional is-start-revision limit type) "For specified BACKEND and FILES, show the VC log. @@ -4328,6 +4335,7 @@ LIMIT can also be a string, which means the revision before which to stop." (vc-log-internal-common backend buffer-name files type (lambda (bk buf _type-arg files-arg) + (with-current-buffer buf (setq-local vc--shortlog shortlog)) (vc-call-backend bk 'print-log files-arg buf shortlog (when is-start-revision working-revision) limit) (when log-view-vc-prev-fileset