From: Catalin Marinas Date: Sat, 8 Nov 2008 22:00:42 +0000 (+0000) Subject: Merge branch 'proposed' X-Git-Tag: v0.15-rc1~102 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/stgit/commitdiff_plain/628746149bfb27e1d326e715d40e9ce3dd77583f?hp=eda45dbaabfc0b9991bb7626eddaacfa797048a5 Merge branch 'proposed' --- diff --git a/contrib/stgit.el b/contrib/stgit.el index aafefaf..d0f19c3 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -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)