comparison tests/test-mq-qdiff.out @ 9725:3f522d2fa633

diff: add --inverse option Most of the time, one can reverse a diff by swapping the revisions passed with -r but it happens that if you use the global -R, and diff against the tip of the current repo, you can't swap the revisions. One use-case for that is reviewing changes from a bundle before unbundling. One could also pipe the output of `hg diff` to a command line filter that reverses the diff, but that would remove the benefit from color diffs. Therefore, having an option in `hg diff` to reverse a diff is a good thing. The option flag selection was tricky. GNU patch uses -R/--reverse but -R is already used as a global option and --reverse would make --rev ambiguous.
author Yannick Gingras <ygingras@ygingras.net>
date Thu, 05 Nov 2009 15:18:56 +0100
parents 561ff8d9e4f0
children 4fe9ca519637
comparison
equal deleted inserted replaced
9724:40ef3bf3e04a 9725:3f522d2fa633
74 -hello world 74 -hello world
75 -goodbye world 75 -goodbye world
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
83 @@ -1,3 +1,5 @@ 83 @@ -1,3 +1,5 @@
84 + 84 +
85 + 85 +
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