##// END OF EJS Templates
convert: handle past or foreign partial svn copies...
convert: handle past or foreign partial svn copies Subversion allows revisions to be composed of subparts coming from revisions before the parent or from other part of the repository. There is no simple representation for these now, keep the changes but do not track their origins.

File last commit:

r6543:a6e2e60b default
r6543:a6e2e60b default
Show More
test-convert-svn-move
71 lines | 1.7 KiB | text/plain | TextLexer
/ tests / test-convert-svn-move
Patrick Mezard
convert: fix svn_source.latest()
r5955 #!/bin/sh
"$TESTDIR/hghave" svn svn-bindings || exit 80
fix_path()
{
tr '\\' /
}
echo "[extensions]" >> $HGRCPATH
echo "convert = " >> $HGRCPATH
echo "hgext.graphlog =" >> $HGRCPATH
svnadmin create svn-repo
svnpath=`pwd | fix_path`
# SVN wants all paths to start with a slash. Unfortunately,
# Windows ones don't. Handle that.
expr $svnpath : "\/" > /dev/null
if [ $? -ne 0 ]; then
svnpath='/'$svnpath
fi
echo % initial svn import
mkdir projA
cd projA
mkdir trunk
Patrick Mezard
convert: prevent svn branches to leave the root module tree
r5957 echo a > trunk/a
Patrick Mezard
convert: fix svn_source.latest()
r5955 mkdir trunk/d1
Patrick Mezard
convert: handle past or foreign partial svn copies...
r6543 mkdir trunk/d2
Patrick Mezard
convert: fix svn_source.latest()
r5955 echo b > trunk/d1/b
Patrick Mezard
convert: prevent svn branches to leave the root module tree
r5957 echo c > trunk/d1/c
Patrick Mezard
convert: handle past or foreign partial svn copies...
r6543 echo d > trunk/d2/d
Patrick Mezard
convert: fix svn_source.latest()
r5955 cd ..
svnurl=file://$svnpath/svn-repo/projA
svn import -m "init projA" projA $svnurl | fix_path
# Build a module renaming chain which used to confuse the converter.
echo % update svn repository
svn co $svnurl A | fix_path
cd A
Peter Arrenbrecht
convert: fix test-convert-svn-* problems with mtime not changing...
r6439 "$TESTDIR/svn-safe-append.py" a trunk/a
"$TESTDIR/svn-safe-append.py" c trunk/d1/c
Patrick Mezard
convert: prevent svn branches to leave the root module tree
r5957 svn ci -m commitbeforemove
Patrick Mezard
convert: fix svn_source.latest()
r5955 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
svn up
mkdir subproject/trunk
svn add subproject/trunk
svn ci -m createtrunk
mkdir subproject/branches
svn add subproject/branches
svn ci -m createbranches
svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
Patrick Mezard
convert: handle past or foreign partial svn copies...
r6543 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2
Patrick Mezard
convert: fix svn_source.latest()
r5955 svn up
Peter Arrenbrecht
convert: fix test-convert-svn-* problems with mtime not changing...
r6439 "$TESTDIR/svn-safe-append.py" b subproject/trunk/d1/b
Patrick Mezard
convert: handle past or foreign partial svn copies...
r6543 svn rm subproject/trunk/d2
svn ci -m "changeb and rm d2"
Patrick Mezard
convert: fix svn_source.latest()
r5955 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
Patrick Mezard
convert: handle past or foreign partial svn copies...
r6543 echo % copy a directory from a past revision
svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
Patrick Mezard
convert: fix svn_source.latest()
r5955 cd ..
echo % convert trunk and branches
hg convert --datesort $svnurl/subproject A-hg
cd A-hg
hg glog --template '#rev# #desc|firstline# files: #files#\n'
hg branches | sed 's/:.*/:/'
cd ..