mq.el: allow mq-diff to take a git option.
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 08 May 2007 11:54:39 -0700
changeset 4425 a57ac6049e22
parent 4424 1d31302c4522
child 4426 807c7b99ff13
mq.el: allow mq-diff to take a git option.
contrib/mq.el
--- 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)))