[PATCH] Make 'hg diff' format options available in 'hg export' too

Giorgos Keramidas keramida at ceid.upatras.gr
Wed May 7 21:39:39 CDT 2008

# HG changeset patch
# User Giorgos Keramidas <keramida at ceid.upatras.gr>
# Date 1210214285 -10800
# Branch keramida
# Node ID c977c4720bffbe0fa3a90e612cdcb16f16338372
# Parent  3a85021b051eccc56d929637783e2f1260529c43
Make 'hg diff' format options available in 'hg export' too.

The implementation of 'hg export' can parse & use any patch
options recognizable by patch.diffopts(), but the command-line
parser rejects them.  With this change one can use the -p, -[wbB]
and -U diff options in 'hg export' too.

diff --git a/mercurial/commands.py b/mercurial/commands.py
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -3081,6 +3081,16 @@
          [('o', 'output', '', _('print output to file with formatted name')),
           ('a', 'text', None, _('treat all files as text')),
           ('g', 'git', None, _('use git extended diff format')),
+          ('p', 'show-function', None,
+           _('show which function each change is in')),
+          ('w', 'ignore-all-space', None,
+           _('ignore white space when comparing lines')),
+          ('b', 'ignore-space-change', None,
+           _('ignore changes in the amount of white space')),
+          ('B', 'ignore-blank-lines', None,
+           _('ignore changes whose lines are all blank')),
+          ('U', 'unified', '',
+           _('number of lines of context to show')),
           ('', 'nodates', None, _("don't include dates in diff headers")),
           ('', 'switch-parent', None, _('diff against the second parent'))],
          _('hg export [OPTION]... [-o OUTFILESPEC] REV...')),

More information about the Mercurial-devel mailing list