@@ -263,7 +263,7 @@ one from the minibuffer, and move to the next line."
263
263
(" C" " Uncommit" magit-stgit-uncommit)
264
264
(" r" " Repair" magit-stgit-repair)
265
265
(" R" " Rebase" magit-stgit-rebase)]
266
- [(" z" " Undo" magit-stgit-undo-popup )
266
+ [(" z" " Undo" magit-stgit-undo)
267
267
(" Z" " Redo" magit-stgit-redo-popup)]]
268
268
[" Patch"
269
269
[(" N" " New" magit-stgit-new)
@@ -559,19 +559,21 @@ ask for confirmation before deleting."
559
559
(interactive (magit-stgit-read-patches nil nil t t " Show patch" ))
560
560
(magit-show-commit (car (magit-stgit-lines " id" patch))))
561
561
562
- (magit-define-popup magit-stgit-undo-popup
563
- " Popup console for StGit undo."
564
- 'magit-stgit-commands
565
- :options '((?n " Undo the last N commands" " --number=" read-number))
566
- :switches '((?h " Discard changes in index/worktree" " --hard" ))
567
- :actions '((?z " Undo" magit-stgit-undo))
568
- :default-action #'magit-stgit-undo )
562
+ (transient-define-prefix magit-stgit-undo ()
563
+ " Undo a previous stack operation."
564
+ :man-page " stg-undo"
565
+ [" Arguments"
566
+ (" -n" " Undo the last N operations" " --number="
567
+ :reader (lambda (prompt _initial-input history )
568
+ (number-to-string (read-number prompt nil history))))
569
+ (" -h" " Discard changes in index/worktree" " --hard" )]
570
+ [" Actions"
571
+ (" z" " Undo" magit-stgit--undo)])
569
572
570
573
;;;### autoload
571
- (defun magit-stgit-undo (&rest args )
572
- " Undo the last operation.
573
- Use ARGS to pass additional arguments."
574
- (interactive (magit-stgit-undo-arguments))
574
+ (defun magit-stgit--undo (&rest args )
575
+ " Invoke `stg undo ARGS...'."
576
+ (interactive (transient-args 'magit-stgit-undo ))
575
577
(magit-run-stgit " undo" args))
576
578
577
579
(magit-define-popup magit-stgit-redo-popup
@@ -712,8 +714,8 @@ the To, Cc, and Bcc fields for all patches."
712
714
[" Rebase series" magit-stgit-rebase
713
715
:help " Rebase an StGit patch series" ]
714
716
" ---"
715
- [" Undo the last operation" magit-stgit-undo-popup
716
- :help " Undo the last operation" ]
717
+ [" Undo stack operation" magit-stgit-undo
718
+ :help " Undo a previous stack operation" ]
717
719
[" Undo the last undo operation" magit-stgit-redo-popup
718
720
:help " Undo the last undo operation" ]))
719
721
0 commit comments