@@ -257,7 +257,7 @@ one from the minibuffer, and move to the next line."
257
257
[" Stack"
258
258
[(" i" " Init" magit-stgit-init)
259
259
(" f" " Float" magit-stgit-float)
260
- (" s" " Sink" magit-stgit-sink-popup )
260
+ (" s" " Sink" magit-stgit-sink)
261
261
(" a" " Goto" magit-stgit-goto-popup)]
262
262
[(" c" " Commit" magit-stgit-commit-popup)
263
263
(" C" " Uncommit" magit-stgit-uncommit-popup)
@@ -360,28 +360,33 @@ minibuffer."
360
360
(read-from-minibuffer " New name: " )))
361
361
(magit-run-stgit " rename" oldname newname))
362
362
363
- (magit-define-popup magit-stgit-sink-popup
364
- " Popup console for StGit sink."
365
- 'magit-stgit-commands
366
- :switches '((?k " Keep the local changes" " --keep" ))
367
- :options '((?t " Sink patches below the target patch (else to bottom)"
368
- " --to="
369
- (lambda (prompt &optional default ) (magit-stgit-read-patch prompt t ))))
370
- :actions '((?s " Sink" magit-stgit-sink))
371
- :default-action #'magit-stgit--float )
363
+ (transient-define-prefix magit-stgit-sink ()
364
+ " Move a set of patches toward the bottom of the stack."
365
+ :man-page " stg-sink"
366
+ [" Arguments"
367
+ (" -k" " Keep the local changes" " --keep" )
368
+ (" -t" " Sink patches below target" " --to="
369
+ :reader (lambda (_prompt _initial-input _history )
370
+ (magit-stgit-read-patch " Sink below" t )))]
371
+ [" Actions"
372
+ (" s" " Sink" magit-stgit--sink)])
372
373
373
374
;;;### autoload
374
- (defun magit-stgit-sink (patches &rest args )
375
- " Sink StGit PATCHES deeper down the stack.
376
- Use ARGS to pass additional arguments."
377
- (interactive (list (magit-stgit-read-patches t t t t " Sink patch" )
378
- (magit-stgit-sink-arguments)))
379
- (when (and (called-interactively-p 'any )
380
- (not magit-current-popup))
381
- (let ((target (magit-stgit-read-patch " Target patch (default is bottom)" )))
382
- (when target
383
- (setq args (append args (list " -t" target))))))
384
- (magit-run-stgit-and-mark-remove patches " sink" args " --" patches))
375
+ (defun magit-stgit--sink (&optional patches &rest args )
376
+ " Invoke `stg sink ARGS... PATCHES...'.
377
+
378
+ If PATCHES is nil, sink the current patch.
379
+
380
+ If called interactively, sink the patches around point or read
381
+ one from the minibuffer. Read the target patch from the
382
+ minibuffer as well."
383
+ (interactive (cons (magit-stgit-read-patches t t t t " Sink patch" )
384
+ (transient-args 'magit-stgit-sink )))
385
+ (let ((target (and (called-interactively-p 'any )
386
+ (not transient-current-prefix)
387
+ (magit-stgit-read-patch " Sink below" t ))))
388
+ (magit-run-stgit-and-mark-remove
389
+ patches (and target (list " -t" target)) " sink" args patches)))
385
390
386
391
(magit-define-popup magit-stgit-commit-popup
387
392
" Popup console for StGit commit."
@@ -667,7 +672,7 @@ the To, Cc, and Bcc fields for all patches."
667
672
" ---"
668
673
[" Float patch" magit-stgit-float
669
674
:help " Float StGit patch to the top" ]
670
- [" Sink patch" magit-stgit-sink-popup
675
+ [" Sink patch" magit-stgit-sink
671
676
:help " Sink StGit patch deeper down the stack" ]
672
677
" ---"
673
678
[" Refresh patch" magit-stgit-refresh-popup
0 commit comments