summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2016-06-17 00:49:16 -0400
committerKyle Meyer <kyle@kyleam.com>2016-06-17 00:49:16 -0400
commitf3ba622e61856118856a65cd1245926f6e284efb (patch)
tree50b7f95a4d69d24187a174a3eed7396013954257 /lisp
parent003f7cc95a8be3a025738e9d566f9efc6a553bfc (diff)
downloademacs.d-f3ba622e61856118856a65cd1245926f6e284efb.tar.gz
Add magit-cherry-flip-revs command
Diffstat (limited to 'lisp')
-rw-r--r--lisp/km-magit.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisp/km-magit.el b/lisp/km-magit.el
index 19dca10..0835ff1 100644
--- a/lisp/km-magit.el
+++ b/lisp/km-magit.el
@@ -565,12 +565,21 @@ show tags by default."
(magit-refresh))
(user-error "No range to swap"))))
+(defun km/magit-cherry-flip-revs ()
+ (interactive)
+ (pcase-let ((`(,rev0 ,rev1) magit-refresh-args))
+ (setf (nth 0 magit-refresh-args) rev1)
+ (setf (nth 1 magit-refresh-args) rev0)
+ (magit-refresh)))
+
(defun km/magit-flip-revs ()
(interactive)
(cond ((derived-mode-p 'magit-diff-mode)
(call-interactively #'magit-diff-flip-revs))
((derived-mode-p 'magit-log-mode)
- (call-interactively #'km/magit-log-flip-revs))))
+ (call-interactively #'km/magit-log-flip-revs))
+ ((derived-mode-p 'magit-cherry-mode)
+ (call-interactively #'km/magit-cherry-flip-revs))))
(defun km/magit-diff-visit-file (&optional prev-rev other-window)
"Like `magit-diff-visit-file', but with the option to visit REV^.