From f1bc0ec32f1ee4d183b974f49cd3cf3e788cdebc Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 8 Jun 2025 11:25:17 +0100 Subject: [PATCH] vc-next-action: On mixed state sets, treat missing files as removed * 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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el index 0540bee2387..5abeb240cea 100644 --- a/lisp/vc/vc.el +++ b/lisp/vc/vc.el @@ -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...). -- 2.39.5