##// END OF EJS Templates
diff: add --inverse option...
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.

File last commit:

r8936:1de6e7e1 default
r9725:3f522d2f default
Show More
test-issue322
49 lines | 574 B | text/plain | TextLexer
Vadim Gelfer
add test for issue 322....
r2946 #!/bin/sh
Dirkjan Ochtman
change wiki/bts URLs to point to new hostname
r8936 # http://mercurial.selenic.com/bts/issue322
Vadim Gelfer
add test for issue 322....
r2946
Vadim Gelfer
add other dir/file case to test for issue322.
r2949 echo % file replaced with directory
Vadim Gelfer
add test for issue 322....
r2946 hg init a
Thomas Arendsen Hein
Kill trailing spaces
r4659 cd a
echo a > a
hg commit -Ama
rm a
mkdir a
Vadim Gelfer
add test for issue 322....
r2946 echo a > a/a
Vadim Gelfer
add other dir/file case to test for issue322.
r2949 echo % should fail - would corrupt dirstate
Vadim Gelfer
add test for issue 322....
r2946 hg add a/a
Vadim Gelfer
add other dir/file case to test for issue322.
r2949
Thomas Arendsen Hein
Kill trailing spaces
r4659 cd ..
Vadim Gelfer
add test for issue 322....
r2946
Vadim Gelfer
add other dir/file case to test for issue322.
r2949 echo % directory replaced with file
hg init c
cd c
mkdir a
echo a > a/a
hg commit -Ama
Thomas Arendsen Hein
Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
r3988 rm -r a
Vadim Gelfer
add other dir/file case to test for issue322.
r2949 echo a > a
echo % should fail - would corrupt dirstate
hg add a
Vadim Gelfer
fix issue 322....
r2953 cd ..
echo % directory replaced with file
Vadim Gelfer
add other dir/file case to test for issue322.
r2949
Vadim Gelfer
fix issue 322....
r2953 hg init d
cd d
mkdir b
mkdir b/c
echo a > b/c/d
hg commit -Ama
Thomas Arendsen Hein
Don't use -f for rm in tests where not needed. Drop /bin/ from /bin/rm.
r3988 rm -r b
Vadim Gelfer
fix issue 322....
r2953 echo a > b
echo % should fail - would corrupt dirstate
hg add b
exit 0