changeset 9857:24bc6e414610

diff: change --inverse to --reverse This fixes an incompatibility with patch(1), which also uses --reverse for reversed diffs. The --inverse flag was added in 3f522d2fa633. That name was chosen over --reverse since it was thought that --reverse would make --rev ambiguous. It turns out that both flags can co-exist, with the cost that --rev can no longer be shortened to --r and --re. Since one can always use the short -r option, this is not a real problem.
author Martin Geisler <mg@lazybytes.net>
date Sat, 14 Nov 2009 14:21:53 +0100
parents ed362d41d1f6
children ea38a2c1bdd3
files hgext/mq.py mercurial/commands.py tests/test-debugcomplete.out tests/test-diff-inverse tests/test-diff-inverse.out tests/test-diff-reverse tests/test-diff-reverse.out tests/test-help.out tests/test-mq-qdiff tests/test-mq-qdiff.out
diffstat 10 files changed, 53 insertions(+), 53 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Mon Nov 09 17:41:21 2009 +0100
+++ b/hgext/mq.py	Sat Nov 14 14:21:53 2009 +0100
@@ -1129,7 +1129,7 @@
             self.ui.write(_("no patches applied\n"))
             return
         qp = self.qparents(repo, top)
-        if opts.get('inverse'):
+        if opts.get('reverse'):
             node1, node2 = None, qp
         else:
             node1, node2 = qp, None
--- a/mercurial/commands.py	Mon Nov 09 17:41:21 2009 +0100
+++ b/mercurial/commands.py	Sat Nov 14 14:21:53 2009 +0100
@@ -1099,7 +1099,7 @@
     revs = opts.get('rev')
     change = opts.get('change')
     stat = opts.get('stat')
-    inv = opts.get('inverse')
+    reverse = opts.get('reverse')
 
     if revs and change:
         msg = _('cannot specify --rev and --change at the same time')
@@ -1110,7 +1110,7 @@
     else:
         node1, node2 = cmdutil.revpair(repo, revs)
 
-    if inv:
+    if reverse:
         node1, node2 = node2, node1
 
     if stat:
@@ -3284,7 +3284,7 @@
 
 diffopts2 = [
     ('p', 'show-function', None, _('show which function each change is in')),
-    ('', 'inverse', None, _('produce a diff that undoes the changes')),
+    ('', 'reverse', None, _('produce a diff that undoes the changes')),
     ('w', 'ignore-all-space', None,
      _('ignore white space when comparing lines')),
     ('b', 'ignore-space-change', None,
--- a/tests/test-debugcomplete.out	Mon Nov 09 17:41:21 2009 +0100
+++ b/tests/test-debugcomplete.out	Sat Nov 14 14:21:53 2009 +0100
@@ -167,7 +167,7 @@
 annotate: rev, follow, text, user, date, number, changeset, line-number, include, exclude
 clone: noupdate, updaterev, rev, pull, uncompressed, ssh, remotecmd
 commit: addremove, close-branch, include, exclude, message, logfile, date, user
-diff: rev, change, text, git, nodates, show-function, inverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
+diff: rev, change, text, git, nodates, show-function, reverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude
 export: output, switch-parent, text, git, nodates
 forget: include, exclude
 init: ssh, remotecmd
--- a/tests/test-diff-inverse	Mon Nov 09 17:41:21 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-#!/bin/sh
-
-hg init
-cat > a <<EOF
-a
-b
-c
-EOF
-hg ci -Am adda
-
-cat > a <<EOF
-d
-e
-f
-EOF
-hg ci -m moda
-
-hg diff --inverse -r0 -r1
-
-cat >> a <<EOF
-g
-h
-EOF
-hg diff --inverse --nodates
--- a/tests/test-diff-inverse.out	Mon Nov 09 17:41:21 2009 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-adding a
-diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
---- a/a	Thu Jan 01 00:00:00 1970 +0000
-+++ b/a	Thu Jan 01 00:00:00 1970 +0000
-@@ -1,3 +1,3 @@
--d
--e
--f
-+a
-+b
-+c
-diff -r 2855cdcfcbb7 a
---- a/a
-+++ b/a
-@@ -1,5 +1,3 @@
- d
- e
- f
--g
--h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-reverse	Sat Nov 14 14:21:53 2009 +0100
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+hg init
+cat > a <<EOF
+a
+b
+c
+EOF
+hg ci -Am adda
+
+cat > a <<EOF
+d
+e
+f
+EOF
+hg ci -m moda
+
+hg diff --reverse -r0 -r1
+
+cat >> a <<EOF
+g
+h
+EOF
+hg diff --reverse --nodates
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/test-diff-reverse.out	Sat Nov 14 14:21:53 2009 +0100
@@ -0,0 +1,20 @@
+adding a
+diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a
+--- a/a	Thu Jan 01 00:00:00 1970 +0000
++++ b/a	Thu Jan 01 00:00:00 1970 +0000
+@@ -1,3 +1,3 @@
+-d
+-e
+-f
++a
++b
++c
+diff -r 2855cdcfcbb7 a
+--- a/a
++++ b/a
+@@ -1,5 +1,3 @@
+ d
+ e
+ f
+-g
+-h
--- a/tests/test-help.out	Mon Nov 09 17:41:21 2009 +0100
+++ b/tests/test-help.out	Sat Nov 14 14:21:53 2009 +0100
@@ -239,7 +239,7 @@
  -g --git                  use git extended diff format
     --nodates              don't include dates in diff headers
  -p --show-function        show which function each change is in
-    --inverse              produce a diff that undoes the changes
+    --reverse              produce a diff that undoes the changes
  -w --ignore-all-space     ignore white space when comparing lines
  -b --ignore-space-change  ignore changes in the amount of white space
  -B --ignore-blank-lines   ignore changes whose lines are all blank
--- a/tests/test-mq-qdiff	Mon Nov 09 17:41:21 2009 +0100
+++ b/tests/test-mq-qdiff	Sat Nov 14 14:21:53 2009 +0100
@@ -58,5 +58,5 @@
 echo % qdiff -w
 hg qdiff --nodates -w
 
-echo % qdiff --inverse
-hg qdiff --nodates --inverse
+echo % qdiff --reverse
+hg qdiff --nodates --reverse
--- a/tests/test-mq-qdiff.out	Mon Nov 09 17:41:21 2009 +0100
+++ b/tests/test-mq-qdiff.out	Sat Nov 14 14:21:53 2009 +0100
@@ -85,7 +85,7 @@
  1
  2
  3
-% qdiff --inverse
+% qdiff --reverse
 diff -r 35fb829491c1 lines
 --- a/lines
 +++ b/lines