comparison tests/svn/svndump-move.sh @ 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
children 8b603c7c808e
comparison
equal deleted inserted replaced
7468:3e5db4228f8f 7475:90d8dfb481e7
1 #!/bin/sh
2 #
3 # Use this script to generate move.svndump
4 #
5
6 mkdir temp
7 cd temp
8
9 mkdir project-orig
10 cd project-orig
11 mkdir trunk
12 echo a > trunk/a
13 mkdir trunk/d1
14 mkdir trunk/d2
15 echo b > trunk/d1/b
16 echo c > trunk/d1/c
17 echo d > trunk/d2/d
18 cd ..
19
20 svnadmin create svn-repo
21 svnurl=file://`pwd`/svn-repo
22 svn import project-orig $svnurl -m "init projA"
23
24 svn co $svnurl project
25 cd project
26 # Build a module renaming chain which used to confuse the converter.
27 # Update svn repository
28 echo a >> trunk/a
29 echo c >> trunk/d1/c
30 svn ci -m commitbeforemove
31 svn mv $svnurl/trunk $svnurl/subproject -m movedtrunk
32 svn up
33 mkdir subproject/trunk
34 svn add subproject/trunk
35 svn ci -m createtrunk
36 mkdir subproject/branches
37 svn add subproject/branches
38 svn ci -m createbranches
39 svn mv $svnurl/subproject/d1 $svnurl/subproject/trunk/d1 -m moved1
40 svn mv $svnurl/subproject/d2 $svnurl/subproject/trunk/d2 -m moved2
41 svn up
42 echo b >> subproject/trunk/d1/b
43
44 svn rm subproject/trunk/d2
45 svn ci -m "changeb and rm d2"
46 svn mv $svnurl/subproject/trunk/d1 $svnurl/subproject/branches/d1 -m moved1again
47
48 if svn help copy | grep 'SRC\[@REV\]' > /dev/null 2>&1; then
49 # SVN >= 1.5 replaced the -r REV syntax with @REV
50 # Copy a file from a past revision
51 svn copy $svnurl/subproject/trunk/d2/d@7 $svnurl/subproject/trunk -m copyfilefrompast
52 # Copy a directory from a past revision
53 svn copy $svnurl/subproject/trunk/d2@7 $svnurl/subproject/trunk -m copydirfrompast
54 else
55 # Copy a file from a past revision
56 svn copy -r 7 $svnurl/subproject/trunk/d2/d $svnurl/subproject/trunk -m copyfilefrompast
57 # Copy a directory from a past revision
58 svn copy -r 7 $svnurl/subproject/trunk/d2 $svnurl/subproject/trunk -m copydirfrompast
59 fi
60 cd ..
61
62 svnadmin dump svn-repo > ../move.svndump