Mercurial > hg
view tests/test-convert-hg-svn @ 5556:61fdf2558c0a
convert: some tidyups, doc improvements, and test fixes
The various back end options are now documented.
The hg source can now be configured not to hand out a revision ID.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 27 Nov 2007 09:44:09 -0800 |
parents | 2147a734dcf9 |
children | 34c4131abdf9 |
line wrap: on
line source
#!/bin/sh "$TESTDIR/hghave" svn svn-bindings || exit 80 fix_path() { tr '\\' / } echo "[extensions]" >> $HGRCPATH echo "convert = " >> $HGRCPATH svnpath=`pwd`/svn-repo svnadmin create $svnpath cat > $svnpath/hooks/pre-revprop-change <<'EOF' #!/bin/sh REPOS="$1" REV="$2" USER="$3" PROPNAME="$4" ACTION="$5" if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi echo "Changing prohibited revision property" >&2 exit 1 EOF chmod +x $svnpath/hooks/pre-revprop-change svnurl=file://$svnpath svn co $svnurl $svnpath-wc cd $svnpath-wc echo a > a svn add a svn ci -m'added a' a cd .. echo % initial roundtrip hg convert -s svn -d hg $svnpath-wc $svnpath-hg | grep -v initializing hg convert -s hg -d svn $svnpath-hg $svnpath-wc echo % second roundtrip should do nothing hg convert -s svn -d hg $svnpath-wc $svnpath-hg hg convert -s hg -d svn $svnpath-hg $svnpath-wc echo % new hg rev hg clone $svnpath-hg $svnpath-work echo b > $svnpath-work/b hg --cwd $svnpath-work add b hg --cwd $svnpath-work ci -mb echo % echo hg to svn hg --cwd $svnpath-hg pull -q $svnpath-work hg convert -s hg -d svn $svnpath-hg $svnpath-wc echo % svn back to hg should do nothing hg convert -s svn -d hg $svnpath-wc $svnpath-hg echo % hg back to svn should do nothing hg convert -s hg -d svn $svnpath-hg $svnpath-wc