##// END OF EJS Templates
convert/svn: do not try converting empty head revisions (issue3347)...
convert/svn: do not try converting empty head revisions (issue3347) Subversion conversion works by picking trunk and branches heads, computing a revision graph from them and converting the selected commits. By design we fail to convert empty revisions so we have to be careful when discovering the revision graph. In this particular issue, the source svn repository was a partial mirror made by svnsync. The funny part is svnsync preserves all revisions including empty ones. Also, we trusted ra.stat(path, stop).created_rev to give us the latest revision with changes in path history up to stop. This assumption broke at least when path is '', that is the repository root, which always returned 'stop' revision despited being empty. The workaround is to first trust ra.stat() but if the returned revision appear empty, search the whole path history from stop to r1 until some changes are found.

File last commit:

r16466:c53a49c3 stable
r16466:c53a49c3 stable
Show More
svndump-empty.sh
47 lines | 866 B | application/x-sh | BashLexer
#!/bin/sh
#
# Use this script to generate empty.svndump
#
mkdir temp
cd temp
mkdir project-orig
cd project-orig
mkdir trunk
mkdir branches
mkdir tags
cd ..
svnadmin create svn-repo
svnurl=file://`pwd`/svn-repo
svn import project-orig $svnurl -m "init projA"
svn co $svnurl project
cd project
mkdir trunk/dir
echo a > trunk/dir/a
svn add trunk/dir
svn ci -m adddir
echo b > trunk/b
svn add trunk/b
svn ci -m addb
echo c > c
svn add c
svn ci -m addc
cd ..
# svnsync repo/trunk/dir only so the last two revisions are empty
svnadmin create svn-empty
cat > svn-empty/hooks/pre-revprop-change <<EOF
#!/bin/sh
exit 0
EOF
chmod +x svn-empty/hooks/pre-revprop-change
svnsync init --username svnsync file://`pwd`/svn-empty file://`pwd`/svn-repo/trunk/dir
svnsync sync file://`pwd`/svn-empty
svn log -v file://`pwd`/svn-empty
svnadmin dump svn-empty > ../empty.svndump