From 4d73c4d8b0d4491fd8331b25c5c7eb74a666c89c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20K=C3=A5gedal?= Date: Sun, 7 Dec 2008 13:32:07 +0100 Subject: [PATCH] stgit.el: Add the stgit-refresh command MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: David Kågedal Signed-off-by: Karl Hasselström --- contrib/stgit.el | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/contrib/stgit.el b/contrib/stgit.el index 721ca2d..646056b 100644 --- a/contrib/stgit.el +++ b/contrib/stgit.el @@ -154,6 +154,7 @@ Argument DIR is the repository path." (define-key stgit-mode-map "p" 'previous-line) (define-key stgit-mode-map "n" 'next-line) (define-key stgit-mode-map "g" 'stgit-reload) + (define-key stgit-mode-map "r" 'stgit-refresh) (define-key stgit-mode-map "\C-c\C-r" 'stgit-rename) (define-key stgit-mode-map "e" 'stgit-edit) (define-key stgit-mode-map "c" 'stgit-coalesce) @@ -434,4 +435,21 @@ With prefix argument, run it with the --hard flag." (stgit-run "undo"))) (stgit-reload)) +(defun stgit-refresh (&optional arg) + "Run stg refresh. +With prefix argument, refresh the patch under point." + (interactive "P") + (let ((patchargs (if arg + (let ((patches (stgit-patches-marked-or-at-point))) + (cond ((null patches) + (error "no patch to update")) + ((> (length patches) 1) + (error "too many patches selected")) + (t + (cons "-p" patches)))) + nil))) + (stgit-capture-output nil + (apply 'stgit-run "refresh" patchargs))) + (stgit-reload)) + (provide 'stgit) -- 2.11.0