comparison tests/svn/svndump-empty.sh @ 16466:c53a49c345e1 stable

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.
author Patrick Mezard <patrick@mezard.eu>
date Wed, 18 Apr 2012 14:04:58 +0200
parents
children
comparison
equal deleted inserted replaced
16465:ad38b96c88f9 16466:c53a49c345e1
1 #!/bin/sh
2 #
3 # Use this script to generate empty.svndump
4 #
5
6 mkdir temp
7 cd temp
8
9 mkdir project-orig
10 cd project-orig
11 mkdir trunk
12 mkdir branches
13 mkdir tags
14 cd ..
15
16 svnadmin create svn-repo
17 svnurl=file://`pwd`/svn-repo
18 svn import project-orig $svnurl -m "init projA"
19
20 svn co $svnurl project
21 cd project
22 mkdir trunk/dir
23 echo a > trunk/dir/a
24 svn add trunk/dir
25 svn ci -m adddir
26
27 echo b > trunk/b
28 svn add trunk/b
29 svn ci -m addb
30
31 echo c > c
32 svn add c
33 svn ci -m addc
34 cd ..
35
36 # svnsync repo/trunk/dir only so the last two revisions are empty
37 svnadmin create svn-empty
38 cat > svn-empty/hooks/pre-revprop-change <<EOF
39 #!/bin/sh
40 exit 0
41 EOF
42 chmod +x svn-empty/hooks/pre-revprop-change
43 svnsync init --username svnsync file://`pwd`/svn-empty file://`pwd`/svn-repo/trunk/dir
44 svnsync sync file://`pwd`/svn-empty
45 svn log -v file://`pwd`/svn-empty
46
47 svnadmin dump svn-empty > ../empty.svndump