##// 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:

r10178:cd477be6 default
r10189:e451e599 default
Show More
test-subrepo-svn
72 lines | 1.2 KiB | text/plain | TextLexer
Augie Fackler
subrepo: Subversion support
r10178 #!/bin/sh
"$TESTDIR/hghave" svn || exit 80
escapedwd=$(pwd | \
python -c \
"import sys,urllib; print urllib.pathname2url(sys.stdin.read().strip())"
)
filterpath="sed s+$escapedwd+/root+"
echo % create subversion repo
SVNREPO="file://$escapedwd/svn-repo"
WCROOT="$(pwd)/svn-wc"
svnadmin create svn-repo
svn co $SVNREPO svn-wc
cd svn-wc
echo alpha > alpha
svn add alpha
svn ci -m 'Add alpha'
cd ..
echo % create hg repo
rm -rf sub
mkdir sub
cd sub
hg init t
cd t
echo % first revision, no sub
echo a > a
hg ci -Am0
echo % add first svn sub
echo "s = [svn]$SVNREPO" >> .hgsub
svn co --quiet $SVNREPO s
hg add .hgsub
hg ci -m1
echo % debugsub
hg debugsub | $filterpath
echo
echo % change file in svn and hg, commit
echo a >> a
echo alpha >> s/alpha
hg commit -m 'Message!'
hg debugsub | $filterpath
echo
echo a > s/a
echo % should be empty despite change to s/a
hg st
echo
echo % add a commit from svn
pushd "$WCROOT" > /dev/null
svn up
echo xyz >> alpha
svn ci -m 'amend a from svn'
popd > /dev/null
echo % this commit from hg will fail
echo zzz >> s/alpha
hg ci -m 'amend alpha from hg'
echo
echo % clone
cd ..
hg clone t tc
cd tc
echo % debugsub in clone
hg debugsub | $filterpath