Replace vc-async-checkin-backends with a backend properties function

* lisp/vc/vc-git.el (vc-git-async-checkins):
* lisp/vc/vc-hg.el (vc-hg-async-checkins):
* lisp/vc/vc.el (vc-default-async-checkins): New functions.
(vc-checkin): Use them.
(vc-async-checkin-backends): Delete.
This commit is contained in:
Sean Whitton 2025-06-12 10:18:54 +01:00
parent 3b7fc1b717
commit 932e413f8a
3 changed files with 12 additions and 4 deletions

View file

@ -1141,6 +1141,8 @@ It is based on `log-edit-mode', and has Git-specific extensions."
(file-local-name ,temp)))
(delete-file ,temp))))
(defalias 'vc-git-async-checkins #'always)
(defun vc-git-checkin (files comment &optional _rev)
(let* ((parent (current-buffer))
(file1 (or (car files) default-directory))

View file

@ -1183,6 +1183,8 @@ It is based on `log-edit-mode', and has Hg-specific extensions.")
(autoload 'vc-wait-for-process-before-save "vc-dispatcher")
(defalias 'vc-hg-async-checkins #'always)
(defun vc-hg-checkin (files comment &optional _rev)
"Hg-specific version of `vc-backend-checkin'.
REV is ignored."

View file

@ -119,6 +119,11 @@
;; Takes no arguments. Backends that return non-nil can update
;; buffers on `vc-retrieve-tag' based on user input. In this case
;; user will be prompted to update buffers on `vc-retrieve-tag'.
;;
;; - async-checkins
;;
;; Takes no arguments. Backends that return non-nil can (and do)
;; perform async checkins when `vc-async-checkin' is non-nil.
;; STATE-QUERYING FUNCTIONS
;;
@ -1034,9 +1039,6 @@ Not supported by all backends."
:safe #'booleanp
:version "31.1")
(defvar vc-async-checkin-backends '(Git Hg)
"Backends which support `vc-async-checkin'.")
(defmacro vc--with-backend-in-rootdir (desc &rest body)
(declare (indent 1) (debug (sexp body)))
;; Intentionally capture `backend' and `rootdir':
@ -1912,6 +1914,8 @@ Type \\[vc-next-action] to check in changes.")
(substitute-command-keys
"Please explain why you stole the lock. Type \\`C-c C-c' when done"))))
(defalias 'vc-default-async-checkins #'ignore)
(defun vc-checkin
(files backend &optional comment initial-contents rev patch-string register)
"Check in FILES.
@ -1930,7 +1934,7 @@ registered the checkin will abort.
Runs the normal hooks `vc-before-checkin-hook' and `vc-checkin-hook'."
(run-hooks 'vc-before-checkin-hook)
(let ((do-async (and vc-async-checkin
(memq backend vc-async-checkin-backends))))
(vc-call-backend backend 'async-checkins))))
(vc-start-logentry
files comment initial-contents
"Enter a change comment."