]> git.eshelyaron.com Git - emacs.git/commitdiff
vc-next-action: On mixed state sets, treat missing files as removed
authorSean Whitton <spwhitton@spwhitton.name>
Sun, 8 Jun 2025 10:25:17 +0000 (11:25 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sun, 8 Jun 2025 19:21:38 +0000 (21:21 +0200)
* lisp/vc/vc.el (vc-only-files-state-and-model, vc-next-action):
Add the 'missing' state to the set of compatible states for
mixed state actions.  This means you can commit removals of
files without first moving them to the 'removed' state.

(cherry picked from commit 988110fb6d13ce263574c8f4610a89a38ebb6835)

lisp/vc/vc.el

index 0540bee238732a96200300c4a230ee6965f44053..5abeb240ceaf8267a4a028633d20f55a0b2b43a8 100644 (file)
@@ -1371,12 +1371,12 @@ BACKEND is the VC backend responsible for FILES."
     (setq states (mapcar #'car states-alist))
     (cond ((length= states 1)
            (setq state (car states)))
-          ((cl-subsetp states '(added removed edited))
+          ((cl-subsetp states '(added missing removed edited))
            (setq state 'edited))
 
           ;; Special, but common case:
           ;; checking in both changes and new files at once.
-          ((and (cl-subsetp states '(added removed edited unregistered))
+          ((and (cl-subsetp states '(added missing removed edited unregistered))
                 (y-or-n-p "Some files are unregistered; register them first?"))
            (vc-register (list backend
                               (cdr (assq 'unregistered states-alist))))
@@ -1384,7 +1384,7 @@ BACKEND is the VC backend responsible for FILES."
 
           (t
            (let* ((pred (lambda (elt)
-                          (memq (car elt) '(added removed edited))))
+                          (memq (car elt) '(added missing removed edited))))
                   (compat-alist (cl-remove-if-not pred states-alist))
                   (other-alist (cl-remove-if pred states-alist))
                   (first (car (or compat-alist other-alist)))
@@ -1522,7 +1522,7 @@ from which to check out the file(s)."
         ;; do nothing
         (message "Fileset is up-to-date"))))
      ;; Files have local changes
-     ((memq state '(added removed edited))
+     ((memq state '(added missing removed edited))
       (let ((ready-for-commit files))
        ;; CVS, SVN and bzr don't care about read-only (bug#9781).
        ;; RCS does, SCCS might (someone should check...).