From 1b6133b6225a5b6613932a355cc4c299209c9a9d Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Sun, 7 Sep 2008 23:05:54 +0300 Subject: [PATCH] Stopping. (R) --- magit.el | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/magit.el b/magit.el index 7c5ac4da..8086fe6d 100644 --- a/magit.el +++ b/magit.el @@ -1290,18 +1290,6 @@ Please see the manual for a complete description of Magit. "\n")))) (insert "\n")))) -(defun magit-rewrite-abort () - (interactive) - (let* ((info (magit-read-rewrite-info)) - (orig (cadr (assq 'orig info)))) - (or info - (error "No rewrite in progress.")) - (or (magit-everything-clean-p) - (error "You have uncommitted changes.")) - (when (yes-or-no-p "Abort rewrite? ") - (magit-write-rewrite-info nil) - (magit-run "git" "reset" "--hard" orig)))) - (defun magit-rewrite-start (from &optional onto) (interactive (list (magit-read-rev "Rewrite from" (magit-default-rev)))) (or (magit-everything-clean-p) @@ -1315,6 +1303,27 @@ Please see the manual for a complete description of Magit. (pending ,@pending))) (magit-run "git" "reset" "--hard" base))) +(defun magit-rewrite-stop () + (interactive) + (let* ((info (magit-read-rewrite-info))) + (or info + (error "No rewrite in progress.")) + (when (yes-or-no-p "Stop rewrite? ") + (magit-write-rewrite-info nil) + (magit-update-status (magit-find-status-buffer))))) + +(defun magit-rewrite-abort () + (interactive) + (let* ((info (magit-read-rewrite-info)) + (orig (cadr (assq 'orig info)))) + (or info + (error "No rewrite in progress.")) + (or (magit-everything-clean-p) + (error "You have uncommitted changes.")) + (when (yes-or-no-p "Abort rewrite? ") + (magit-write-rewrite-info nil) + (magit-run "git" "reset" "--hard" orig)))) + ;;; Updating, pull, and push (defun magit-remote-update ()