stgit.el: Add numeric prefix argument to push and pop commands.
authorDavid Kågedal <davidk@lysator.liu.se>
Thu, 6 Nov 2008 07:34:37 +0000 (08:34 +0100)
committerKarl Hasselström <kha@treskal.com>
Thu, 6 Nov 2008 07:34:37 +0000 (08:34 +0100)
By using a numerical prefix (or simply C-u) it is possible to push or
pop more than one patch.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Karl Hasselström <kha@treskal.com>
contrib/stgit.el

index aafefaf..e6ce70a 100644 (file)
@@ -274,16 +274,19 @@ Commands:
   (stgit-capture-output nil (stgit-run "uncommit" "-n" (number-to-string arg)))
   (stgit-refresh))
 
-(defun stgit-push-next ()
-  "Push the first unapplied patch"
-  (interactive)
-  (stgit-capture-output nil (stgit-run "push"))
+(defun stgit-push-next (npatches)
+  "Push the first unapplied patch.
+With numeric prefix argument, push that many patches."
+  (interactive "p")
+  (stgit-capture-output nil (stgit-run "push" "-n"
+                                       (number-to-string npatches)))
   (stgit-refresh))
 
-(defun stgit-pop-next ()
-  "Pop the topmost applied patch"
-  (interactive)
-  (stgit-capture-output nil (stgit-run "pop"))
+(defun stgit-pop-next (npatches)
+  "Pop the topmost applied patch.
+With numeric prefix argument, pop that many patches."
+  (interactive "p")
+  (stgit-capture-output nil (stgit-run "pop" "-n" (number-to-string npatches)))
   (stgit-refresh))
 
 (defun stgit-applied-at-point ()