changeset 4425:a57ac6049e22

mq.el: allow mq-diff to take a git option.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 08 May 2007 11:54:39 -0700
parents 1d31302c4522
children 807c7b99ff13
files contrib/mq.el
diffstat 1 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/contrib/mq.el	Tue May 08 11:54:39 2007 -0700
+++ b/contrib/mq.el	Tue May 08 11:54:39 2007 -0700
@@ -347,11 +347,14 @@
       (error "Not in an MQ repository!"))
     (find-file (concat root ".hg/patches/series"))))
 
-(defun mq-diff ()
-  "Display a diff of the topmost applied patch."
-  (interactive)
+(defun mq-diff (&optional git)
+  "Display a diff of the topmost applied patch.
+With a prefix argument, display a git-compatible diff."
+  (interactive "P")
   (hg-view-output ((format "MQ: Diff of %s" (mq-patch-info "qtop")))
-    (call-process (hg-binary) nil t nil "qdiff")
+    (if git
+	(call-process (hg-binary) nil t nil "qdiff" "--git")
+    (call-process (hg-binary) nil t nil "qdiff"))
     (diff-mode)
     (font-lock-fontify-buffer)))