##// END OF EJS Templates
patch: support diff data loss detection and upgrade...
patch: support diff data loss detection and upgrade In worst case, generating diff in upgrade mode can be two times more expensive than generating it in git mode directly: we may have to regenerate the whole diff again whenever a git feature is detected. Also, the first diff attempt is completely buffered instead of being streamed. That said, even without having profiled it yet, I am convinced we can fast-path the upgrade mode if necessary were it to be used in regular diff commands, and not only in mq where avoiding data loss is worth the price.

File last commit:

r7680:89c2b78f default
r10189:e451e599 default
Show More
test-diff-change
63 lines | 1.2 KiB | text/plain | TextLexer
Stepan Koltsov
diff: add --change option to display single changeset diff (issue1420)
r7628 #!/bin/sh -e
# test of hg diff --change
set -e
ec() {
echo "invoking $@:"
"$@"
}
hg init a
cd a
echo "first" > file.txt
hg add file.txt
hg commit -m 'first commit' # 0
echo "second" > file.txt
hg commit -m 'second commit' # 1
echo "third" > file.txt
hg commit -m 'third commit' # 2
ec hg diff --nodates --change 1
echo
#rev=$(hg log -r 1 --template '{node|short}')
rev=e9b286083166
ec hg diff --nodates --change "$rev"
##
# Testing diff -c when merge
for i in 1 2 3 4 5 6 7 8 9 10; do
echo $i >> file.txt
done
hg commit -m "lots of text" # 3
Dirkjan Ochtman
tests: eliminate use of sed -i (which fails on NetBSD)
r7680 sed -e 's,^2$,x,' file.txt > file.txt.tmp
mv file.txt.tmp file.txt
Stepan Koltsov
diff: add --change option to display single changeset diff (issue1420)
r7628 hg commit -m "changed 2 to x" # 4
hg up -r 3 > /dev/null 2>&1 # updated, merged, removed, unresolved
Dirkjan Ochtman
tests: eliminate use of sed -i (which fails on NetBSD)
r7680 sed -e 's,^8$,y,' file.txt > file.txt.tmp
mv file.txt.tmp file.txt
Stepan Koltsov
diff: add --change option to display single changeset diff (issue1420)
r7628 hg commit -m "change 8 to y" > /dev/null 2>&1 # 5 # created new head
hg up -C -r 4 > /dev/null 2>&1 # updated, merged, removed, unresolved
hg merge -r 5 > /dev/null 2>&1 # updated, merged, removed, unresolved
hg commit -m "merging 8 to y" # 6
echo
ec hg diff --nodates --change 6 # must be similar to hg diff --nodates --change 5
#echo
#hg log
echo
echo "EOF"
# vim: set ts=4 sw=4 et: