comparison mercurial/commands.py @ 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 0a3fc37261ab
children 541218fbad2a
comparison
equal deleted inserted replaced
9856:ed362d41d1f6 9857:24bc6e414610
1097 """ 1097 """
1098 1098
1099 revs = opts.get('rev') 1099 revs = opts.get('rev')
1100 change = opts.get('change') 1100 change = opts.get('change')
1101 stat = opts.get('stat') 1101 stat = opts.get('stat')
1102 inv = opts.get('inverse') 1102 reverse = opts.get('reverse')
1103 1103
1104 if revs and change: 1104 if revs and change:
1105 msg = _('cannot specify --rev and --change at the same time') 1105 msg = _('cannot specify --rev and --change at the same time')
1106 raise util.Abort(msg) 1106 raise util.Abort(msg)
1107 elif change: 1107 elif change:
1108 node2 = repo.lookup(change) 1108 node2 = repo.lookup(change)
1109 node1 = repo[node2].parents()[0].node() 1109 node1 = repo[node2].parents()[0].node()
1110 else: 1110 else:
1111 node1, node2 = cmdutil.revpair(repo, revs) 1111 node1, node2 = cmdutil.revpair(repo, revs)
1112 1112
1113 if inv: 1113 if reverse:
1114 node1, node2 = node2, node1 1114 node1, node2 = node2, node1
1115 1115
1116 if stat: 1116 if stat:
1117 opts['unified'] = '0' 1117 opts['unified'] = '0'
1118 diffopts = patch.diffopts(ui, opts) 1118 diffopts = patch.diffopts(ui, opts)
3282 ('', 'nodates', None, _("don't include dates in diff headers")) 3282 ('', 'nodates', None, _("don't include dates in diff headers"))
3283 ] 3283 ]
3284 3284
3285 diffopts2 = [ 3285 diffopts2 = [
3286 ('p', 'show-function', None, _('show which function each change is in')), 3286 ('p', 'show-function', None, _('show which function each change is in')),
3287 ('', 'inverse', None, _('produce a diff that undoes the changes')), 3287 ('', 'reverse', None, _('produce a diff that undoes the changes')),
3288 ('w', 'ignore-all-space', None, 3288 ('w', 'ignore-all-space', None,
3289 _('ignore white space when comparing lines')), 3289 _('ignore white space when comparing lines')),
3290 ('b', 'ignore-space-change', None, 3290 ('b', 'ignore-space-change', None,
3291 _('ignore changes in the amount of white space')), 3291 _('ignore changes in the amount of white space')),
3292 ('B', 'ignore-blank-lines', None, 3292 ('B', 'ignore-blank-lines', None,