chiark / gitweb /
Merge branch 'proposed'
authorCatalin Marinas <catalin.marinas@gmail.com>
Sat, 8 Nov 2008 22:00:42 +0000 (22:00 +0000)
committerCatalin Marinas <catalin.marinas@gmail.com>
Sat, 8 Nov 2008 22:00:42 +0000 (22:00 +0000)
contrib/stgit.el

index aafefafa630c6bf356d7f6e72961b73435aa8756..d0f19c38b2c7b81fc7d79289dd951da64ae6dc40 100644 (file)
@@ -131,7 +131,8 @@ (defun stgit-rescan ()
                  (when (memq patchsym stgit-marked-patches)
                    (replace-match "*" nil nil nil 2)
                    (setq marked (cons patchsym marked)))))
-              ((looking-at "stg series: Branch \".*\" not initialised")
+              ((or (looking-at "stg series: Branch \".*\" not initialised")
+                   (looking-at "stg series: .*: branch not initialized"))
                (forward-line 1)
                (insert "Run M-x stgit-init to initialise")))
         (forward-line 1))
@@ -165,7 +166,9 @@   (define-key stgit-mode-map "<"   'stgit-pop-next)
   (define-key stgit-mode-map "P"   'stgit-push-or-pop)
   (define-key stgit-mode-map "G"   'stgit-goto)
   (define-key stgit-mode-map "="   'stgit-show)
-  (define-key stgit-mode-map "D"   'stgit-delete))
+  (define-key stgit-mode-map "D"   'stgit-delete)
+  (define-key stgit-mode-map [(control ?/)] 'stgit-undo)
+  (define-key stgit-mode-map "\C-_" 'stgit-undo))
 
 (defun stgit-mode ()
   "Major mode for interacting with StGit.
@@ -274,16 +277,19 @@ (defun stgit-uncommit (arg)
   (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 ()
@@ -408,4 +414,14 @@ (defun stgit-help ()
   (interactive)
   (describe-function 'stgit-mode))
 
+(defun stgit-undo (&optional arg)
+  "Run stg undo.
+With prefix argument, run it with the --hard flag."
+  (interactive "P")
+  (stgit-capture-output nil
+    (if arg
+        (stgit-run "undo" "--hard")
+      (stgit-run "undo")))
+  (stgit-refresh))
+
 (provide 'stgit)