Show More
@@ -0,0 +1,24 b'' | |||||
|
1 | #!/bin/sh | |||
|
2 | ||||
|
3 | hg init | |||
|
4 | cat > a <<EOF | |||
|
5 | a | |||
|
6 | b | |||
|
7 | c | |||
|
8 | EOF | |||
|
9 | hg ci -Am adda | |||
|
10 | ||||
|
11 | cat > a <<EOF | |||
|
12 | d | |||
|
13 | e | |||
|
14 | f | |||
|
15 | EOF | |||
|
16 | hg ci -m moda | |||
|
17 | ||||
|
18 | hg diff --inverse -r0 -r1 | |||
|
19 | ||||
|
20 | cat >> a <<EOF | |||
|
21 | g | |||
|
22 | h | |||
|
23 | EOF | |||
|
24 | hg diff --inverse --nodates |
@@ -0,0 +1,20 b'' | |||||
|
1 | adding a | |||
|
2 | diff -r 2855cdcfcbb7 -r 8e1805a3cf6e a | |||
|
3 | --- a/a Thu Jan 01 00:00:00 1970 +0000 | |||
|
4 | +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |||
|
5 | @@ -1,3 +1,3 @@ | |||
|
6 | -d | |||
|
7 | -e | |||
|
8 | -f | |||
|
9 | +a | |||
|
10 | +b | |||
|
11 | +c | |||
|
12 | diff -r 2855cdcfcbb7 a | |||
|
13 | --- a/a | |||
|
14 | +++ b/a | |||
|
15 | @@ -1,5 +1,3 @@ | |||
|
16 | d | |||
|
17 | e | |||
|
18 | f | |||
|
19 | -g | |||
|
20 | -h |
@@ -1129,8 +1129,12 b' class queue(object):' | |||||
1129 | self.ui.write(_("no patches applied\n")) |
|
1129 | self.ui.write(_("no patches applied\n")) | |
1130 | return |
|
1130 | return | |
1131 | qp = self.qparents(repo, top) |
|
1131 | qp = self.qparents(repo, top) | |
|
1132 | if opts.get('inverse'): | |||
|
1133 | node1, node2 = None, qp | |||
|
1134 | else: | |||
|
1135 | node1, node2 = qp, None | |||
1132 | self._diffopts = patch.diffopts(self.ui, opts) |
|
1136 | self._diffopts = patch.diffopts(self.ui, opts) | |
1133 |
self.printdiff(repo, |
|
1137 | self.printdiff(repo, node1, node2, files=pats, opts=opts) | |
1134 |
|
1138 | |||
1135 | def refresh(self, repo, pats=None, **opts): |
|
1139 | def refresh(self, repo, pats=None, **opts): | |
1136 | if len(self.applied) == 0: |
|
1140 | if len(self.applied) == 0: |
@@ -1102,6 +1102,7 b' def diff(ui, repo, *pats, **opts):' | |||||
1102 | revs = opts.get('rev') |
|
1102 | revs = opts.get('rev') | |
1103 | change = opts.get('change') |
|
1103 | change = opts.get('change') | |
1104 | stat = opts.get('stat') |
|
1104 | stat = opts.get('stat') | |
|
1105 | inv = opts.get('inverse') | |||
1105 |
|
1106 | |||
1106 | if revs and change: |
|
1107 | if revs and change: | |
1107 | msg = _('cannot specify --rev and --change at the same time') |
|
1108 | msg = _('cannot specify --rev and --change at the same time') | |
@@ -1112,6 +1113,9 b' def diff(ui, repo, *pats, **opts):' | |||||
1112 | else: |
|
1113 | else: | |
1113 | node1, node2 = cmdutil.revpair(repo, revs) |
|
1114 | node1, node2 = cmdutil.revpair(repo, revs) | |
1114 |
|
1115 | |||
|
1116 | if inv: | |||
|
1117 | node1, node2 = node2, node1 | |||
|
1118 | ||||
1115 | if stat: |
|
1119 | if stat: | |
1116 | opts['unified'] = '0' |
|
1120 | opts['unified'] = '0' | |
1117 | diffopts = patch.diffopts(ui, opts) |
|
1121 | diffopts = patch.diffopts(ui, opts) | |
@@ -3280,6 +3284,7 b' diffopts = [' | |||||
3280 |
|
3284 | |||
3281 | diffopts2 = [ |
|
3285 | diffopts2 = [ | |
3282 | ('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')), | |||
3283 | ('w', 'ignore-all-space', None, |
|
3288 | ('w', 'ignore-all-space', None, | |
3284 | _('ignore white space when comparing lines')), |
|
3289 | _('ignore white space when comparing lines')), | |
3285 | ('b', 'ignore-space-change', None, |
|
3290 | ('b', 'ignore-space-change', None, |
@@ -1216,7 +1216,7 b' def diff(repo, node1=None, node2=None, m' | |||||
1216 | if opts is None: |
|
1216 | if opts is None: | |
1217 | opts = mdiff.defaultopts |
|
1217 | opts = mdiff.defaultopts | |
1218 |
|
1218 | |||
1219 | if not node1: |
|
1219 | if not node1 and not node2: | |
1220 | node1 = repo.dirstate.parents()[0] |
|
1220 | node1 = repo.dirstate.parents()[0] | |
1221 |
|
1221 | |||
1222 | def lrugetfilectx(): |
|
1222 | def lrugetfilectx(): |
@@ -167,7 +167,7 b' add: include, exclude, dry-run' | |||||
167 | annotate: rev, follow, text, user, date, number, changeset, line-number, include, exclude |
|
167 | annotate: rev, follow, text, user, date, number, changeset, line-number, include, exclude | |
168 | clone: noupdate, updaterev, rev, pull, uncompressed, ssh, remotecmd |
|
168 | clone: noupdate, updaterev, rev, pull, uncompressed, ssh, remotecmd | |
169 | commit: addremove, close-branch, include, exclude, message, logfile, date, user |
|
169 | commit: addremove, close-branch, include, exclude, message, logfile, date, user | |
170 | diff: rev, change, text, git, nodates, show-function, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude |
|
170 | diff: rev, change, text, git, nodates, show-function, inverse, ignore-all-space, ignore-space-change, ignore-blank-lines, unified, stat, include, exclude | |
171 | export: output, switch-parent, text, git, nodates |
|
171 | export: output, switch-parent, text, git, nodates | |
172 | forget: include, exclude |
|
172 | forget: include, exclude | |
173 | init: ssh, remotecmd |
|
173 | init: ssh, remotecmd |
@@ -237,6 +237,7 b' options:' | |||||
237 | -g --git use git extended diff format |
|
237 | -g --git use git extended diff format | |
238 | --nodates don't include dates in diff headers |
|
238 | --nodates don't include dates in diff headers | |
239 | -p --show-function show which function each change is in |
|
239 | -p --show-function show which function each change is in | |
|
240 | --inverse produce a diff that undoes the changes | |||
240 | -w --ignore-all-space ignore white space when comparing lines |
|
241 | -w --ignore-all-space ignore white space when comparing lines | |
241 | -b --ignore-space-change ignore changes in the amount of white space |
|
242 | -b --ignore-space-change ignore changes in the amount of white space | |
242 | -B --ignore-blank-lines ignore changes whose lines are all blank |
|
243 | -B --ignore-blank-lines ignore changes whose lines are all blank |
@@ -55,5 +55,8 b' hg qdiff --nodates -b' | |||||
55 | echo % qdiff -U 1 -B |
|
55 | echo % qdiff -U 1 -B | |
56 | hg qdiff --nodates -U 1 -B |
|
56 | hg qdiff --nodates -U 1 -B | |
57 |
|
57 | |||
58 | echo qdiff -w |
|
58 | echo % qdiff -w | |
59 | hg qdiff --nodates -w |
|
59 | hg qdiff --nodates -w | |
|
60 | ||||
|
61 | echo % qdiff --inverse | |||
|
62 | hg qdiff --nodates --inverse |
@@ -76,7 +76,7 b' diff -r 35fb829491c1 lines' | |||||
76 | +hello world |
|
76 | +hello world | |
77 | + goodbye world |
|
77 | + goodbye world | |
78 | 7 |
|
78 | 7 | |
79 | qdiff -w |
|
79 | % qdiff -w | |
80 | diff -r 35fb829491c1 lines |
|
80 | diff -r 35fb829491c1 lines | |
81 | --- a/lines |
|
81 | --- a/lines | |
82 | +++ b/lines |
|
82 | +++ b/lines | |
@@ -86,3 +86,21 b' diff -r 35fb829491c1 lines' | |||||
86 | 1 |
|
86 | 1 | |
87 | 2 |
|
87 | 2 | |
88 | 3 |
|
88 | 3 | |
|
89 | % qdiff --inverse | |||
|
90 | diff -r 35fb829491c1 lines | |||
|
91 | --- a/lines | |||
|
92 | +++ b/lines | |||
|
93 | @@ -1,11 +1,9 @@ | |||
|
94 | - | |||
|
95 | - | |||
|
96 | 1 | |||
|
97 | 2 | |||
|
98 | 3 | |||
|
99 | 4 | |||
|
100 | -hello world | |||
|
101 | - goodbye world | |||
|
102 | +hello world | |||
|
103 | +goodbye world | |||
|
104 | 7 | |||
|
105 | 8 | |||
|
106 | 9 |
General Comments 0
You need to be logged in to leave comments.
Login now