add --git option to qdiff
authorAlexis S. L. Carvalho <alexis@cecm.usp.br>
Mon, 20 Nov 2006 19:32:40 -0200
changeset 3697 da262f35fbc8
parent 3696 562a65635bcb
child 3698 a9090b264250
add --git option to qdiff
hgext/mq.py
tests/test-mq
tests/test-mq.out
--- a/hgext/mq.py	Mon Nov 20 19:32:38 2006 -0200
+++ b/hgext/mq.py	Mon Nov 20 19:32:40 2006 -0200
@@ -935,6 +935,8 @@
             self.ui.write("No patches applied\n")
             return
         qp = self.qparents(repo, top)
+        if opts.get('git'):
+            self.diffopts().git = True
         self.printdiff(repo, qp, files=pats, opts=opts)
 
     def refresh(self, repo, pats=None, **opts):
@@ -2071,7 +2073,8 @@
          commands.table["^commit|ci"][1],
          'hg qcommit [OPTION]... [FILE]...'),
     "^qdiff": (diff,
-               [('I', 'include', [], _('include names matching the given patterns')),
+               [('g', 'git', None, _('use git extended diff format')),
+                ('I', 'include', [], _('include names matching the given patterns')),
                 ('X', 'exclude', [], _('exclude names matching the given patterns'))],
                'hg qdiff [-I] [-X] [FILE]...'),
     "qdelete|qremove|qrm":
--- a/tests/test-mq	Mon Nov 20 19:32:38 2006 -0200
+++ b/tests/test-mq	Mon Nov 20 19:32:40 2006 -0200
@@ -202,3 +202,8 @@
 hg qpop
 hg qpush
 hg qdiff
+cat >>$HGRCPATH <<EOF
+[diff]
+git = False
+EOF
+hg qdiff --git
--- a/tests/test-mq.out	Mon Nov 20 19:32:38 2006 -0200
+++ b/tests/test-mq.out	Mon Nov 20 19:32:40 2006 -0200
@@ -198,3 +198,6 @@
 diff --git a/new b/copy
 copy from new
 copy to copy
+diff --git a/new b/copy
+copy from new
+copy to copy