]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace vc-async-checkin-backends with a backend properties function
authorSean Whitton <spwhitton@spwhitton.name>
Thu, 12 Jun 2025 09:18:54 +0000 (10:18 +0100)
committerEshel Yaron <me@eshelyaron.com>
Wed, 18 Jun 2025 08:12:00 +0000 (10:12 +0200)
* 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.

(cherry picked from commit 932e413f8afb290fa38476b0f8a78c4073240ff5)

lisp/vc/vc-git.el
lisp/vc/vc-hg.el
lisp/vc/vc.el

index cc1e8a7f885cded503514acdd4cf19c8f85b1423..cb461efa763abe98536e46874ea4b02bbaa4325e 100644 (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))
index 31506ee649344350d16d40c2425ac8379c634ec2..ff761f825354ffdc4033a025fa2cca5aad4e88f2 100644 (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."
index 4e74b25ad072aec734eebf36a967485866c6974c..504bc8b39f51c9e981e200a7d9a76c513681012b 100644 (file)
 ;;   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
 ;;
@@ -1031,9 +1036,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':
@@ -1907,6 +1909,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.
@@ -1925,7 +1929,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."