Mercurial > hg > mercurial-source
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 | 8 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/mq.py +++ b/hgext/mq.py @@ -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 +++ b/mercurial/commands.py @@ -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 +++ b/tests/test-debugcomplete.out @@ -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
rename from tests/test-diff-inverse rename to tests/test-diff-reverse --- a/tests/test-diff-inverse +++ b/tests/test-diff-reverse @@ -15,10 +15,10 @@ EOF hg ci -m moda -hg diff --inverse -r0 -r1 +hg diff --reverse -r0 -r1 cat >> a <<EOF g h EOF -hg diff --inverse --nodates +hg diff --reverse --nodates
--- a/tests/test-help.out +++ b/tests/test-help.out @@ -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