comparison tests/test-convert-svn-branches @ 7475:90d8dfb481e7

Rewrite svn tests using svndump They are: - faster to run (12s vs 30s in test-convert-svn-branches case) - easier to craft - easier to debug - more portable
author Patrick Mezard <pmezard@gmail.com>
date Sat, 06 Dec 2008 20:07:44 +0100
parents 6ec941b6003d
children 29f4f0d66cd5
comparison
equal deleted inserted replaced
7468:3e5db4228f8f 7475:90d8dfb481e7
10 echo "[extensions]" >> $HGRCPATH 10 echo "[extensions]" >> $HGRCPATH
11 echo "convert = " >> $HGRCPATH 11 echo "convert = " >> $HGRCPATH
12 echo "hgext.graphlog =" >> $HGRCPATH 12 echo "hgext.graphlog =" >> $HGRCPATH
13 13
14 svnadmin create svn-repo 14 svnadmin create svn-repo
15 cat "$TESTDIR/svn/branches.svndump" | svnadmin load svn-repo > /dev/null
15 16
16 svnpath=`pwd | fix_path` 17 svnpath=`pwd | fix_path`
17 # SVN wants all paths to start with a slash. Unfortunately, 18 # SVN wants all paths to start with a slash. Unfortunately,
18 # Windows ones don't. Handle that. 19 # Windows ones don't. Handle that.
19 expr $svnpath : "\/" > /dev/null 20 expr $svnpath : "\/" > /dev/null
20 if [ $? -ne 0 ]; then 21 if [ $? -ne 0 ]; then
21 svnpath='/'$svnpath 22 svnpath='/'$svnpath
22 fi 23 fi
23 24 svnurl=file://$svnpath/svn-repo
24 echo % initial svn import
25 mkdir projA
26 cd projA
27 mkdir trunk
28 mkdir branches
29 mkdir tags
30 cd ..
31
32 svnurl=file://$svnpath/svn-repo/projA
33 svn import -m "init projA" projA $svnurl | fix_path
34
35 echo % update svn repository
36 svn co $svnurl A | fix_path
37 cd A
38 echo a > trunk/a
39 echo b > trunk/b
40 echo c > trunk/c
41 # Add a file within branches, used to confuse branch detection
42 echo d > branches/notinbranch
43 svn add trunk/a trunk/b trunk/c branches/notinbranch
44 svn ci -m hello
45
46 echo % branch to old
47 svn copy trunk branches/old
48 svn rm branches/old/c
49 svn ci -m "branch trunk, remove c"
50 svn up
51
52 echo % update trunk
53 "$TESTDIR/svn-safe-append.py" a trunk/a
54 svn ci -m "change a"
55
56 echo % update old branch
57 "$TESTDIR/svn-safe-append.py" b branches/old/b
58 svn ci -m "change b"
59
60 echo % create a cross-branch revision
61 svn move trunk/b branches/old/c
62 "$TESTDIR/svn-safe-append.py" c branches/old/c
63 svn ci -m "move and update c"
64
65 echo % update old branch again
66 "$TESTDIR/svn-safe-append.py" b branches/old/b
67 svn ci -m "change b again"
68
69 echo % move back and forth between branch of similar names
70 # This used to generate fake copy records
71 svn up
72 svn move branches/old branches/old2
73 svn ci -m "move to old2"
74 svn move branches/old2 branches/old
75 svn ci -m "move back to old"
76
77 echo % update trunk again
78 "$TESTDIR/svn-safe-append.py" a trunk/a
79 svn ci -m "last change to a"
80 cd ..
81 25
82 echo % convert trunk and branches 26 echo % convert trunk and branches
83 hg convert --datesort $svnurl A-hg 27 hg convert --datesort -r 10 $svnurl A-hg
84
85 echo % branch again from a converted revision
86 cd A
87 svn copy -r 1 $svnurl/trunk branches/old3
88 svn ci -m "branch trunk@1 into old3"
89 cd ..
90 28
91 echo % convert again 29 echo % convert again
92 hg convert --datesort $svnurl A-hg 30 hg convert --datesort $svnurl A-hg
93 31
94 cd A-hg 32 cd A-hg