1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Query-on-exit for VC push, pull and async checkin commands

* lisp/vc/vc-bzr.el (vc-bzr--pushpull):
* lisp/vc/vc-git.el (vc-git--checkin, vc-git--pushpull):
* lisp/vc/vc-hg.el (vc-hg--checkin, vc-hg--pushpull): Set
query-on-exit flag for async processes.
This commit is contained in:
Sean Whitton 2025-12-03 16:09:52 +00:00
parent 02afd1305b
commit ed87a95a78
3 changed files with 22 additions and 13 deletions

View file

@ -385,6 +385,7 @@ If PROMPT is non-nil, prompt for the Bzr command to run."
args (cddr args))) args (cddr args)))
(require 'vc-dispatcher) (require 'vc-dispatcher)
(let ((buf (apply #'vc-bzr-async-command command args))) (let ((buf (apply #'vc-bzr-async-command command args)))
(set-process-query-on-exit-flag (get-buffer-process buf) t)
(with-current-buffer buf (with-current-buffer buf
(vc-run-delayed (vc-run-delayed
(vc-compilation-mode 'bzr) (vc-compilation-mode 'bzr)

View file

@ -1320,16 +1320,18 @@ It is an error to supply both or neither."
(and (not patch-string) (and (not patch-string)
(if only (list "--only" "--") '("-a"))))) (if only (list "--only" "--") '("-a")))))
(if vc-async-checkin (if vc-async-checkin
(progn (vc-wait-for-process-before-save (let ((proc (apply #'vc-do-async-command buffer root
(apply #'vc-do-async-command buffer root vc-git-program (nconc args files))))
vc-git-program (nconc args files)) (set-process-query-on-exit-flag proc t)
"Finishing checking in files...") (vc-wait-for-process-before-save
(with-current-buffer buffer proc
(vc-run-delayed "Finishing checking in files...")
(vc-compilation-mode 'git) (with-current-buffer buffer
(funcall post))) (vc-run-delayed
(vc-set-async-update buffer) (vc-compilation-mode 'git)
(list 'async (get-buffer-process buffer))) (funcall post)))
(vc-set-async-update buffer)
(list 'async (get-buffer-process buffer)))
(apply #'vc-git-command nil 0 files args) (apply #'vc-git-command nil 0 files args)
(funcall post))))) (funcall post)))))
@ -1527,6 +1529,7 @@ If PROMPT is non-nil, prompt for the Git command to run."
vc-filter-command-function)) vc-filter-command-function))
(proc (apply #'vc-do-async-command (proc (apply #'vc-do-async-command
buffer root git-program command extra-args))) buffer root git-program command extra-args)))
(set-process-query-on-exit-flag proc t)
;; "git pull" includes progress output that uses ^M to move point ;; "git pull" includes progress output that uses ^M to move point
;; to the beginning of the line. Just translate these to newlines ;; to the beginning of the line. Just translate these to newlines
;; (but don't do anything with the CRLF sequence). ;; (but don't do anything with the CRLF sequence).

View file

@ -1291,9 +1291,12 @@ It is an error to supply both or neither."
(vc-hg-command nil 0 nil "update" "--merge" (vc-hg-command nil 0 nil "update" "--merge"
"--tool" "internal:local" "tip"))))) "--tool" "internal:local" "tip")))))
(if vc-async-checkin (if vc-async-checkin
(let ((buffer (vc-hg--async-buffer))) (let* ((buffer (vc-hg--async-buffer))
(proc (apply #'vc-hg--async-command buffer
(nconc args files))))
(set-process-query-on-exit-flag proc t)
(vc-wait-for-process-before-save (vc-wait-for-process-before-save
(apply #'vc-hg--async-command buffer (nconc args files)) proc
(if patch-file (if patch-file
"Finishing checking in patch...." "Finishing checking in patch...."
"Finishing checking in files...")) "Finishing checking in files..."))
@ -1613,7 +1616,9 @@ revisions, fetch only those revisions."
(setq hg-program (car args) (setq hg-program (car args)
command (cadr args) command (cadr args)
args (cddr args))) args (cddr args)))
(apply #'vc-do-async-command buffer root hg-program command args) (set-process-query-on-exit-flag
(apply #'vc-do-async-command buffer root hg-program command args)
t)
(with-current-buffer buffer (with-current-buffer buffer
(vc-run-delayed (vc-run-delayed
(dolist (cmd post-processing) (dolist (cmd post-processing)