Debian Codegraph @

tests/svn/svndump-replace.sh

raw
1 #!/bin/sh
2
3 RSVN="`pwd`/rsvn.py"
4 export PATH=/bin:/usr/bin
5 mkdir temp
6 cd temp
7
8 svnadmin create repo
9 svn co file://`pwd`/repo wc
10
11 cd wc
12 mkdir trunk branches
13 cd trunk
14 echo a > a
15 mkdir d
16 echo b > d/b
17 ln -s d dlink
18 ln -s d dlink2
19 ln -s d dlink3
20 mkdir d2
21 echo a > d2/a
22 cd ..
23 svn add *
24 svn ci -m 'initial'
25 # Clobber symlink with file with similar content
26 cd trunk
27 ls -Alh
28 readlink dlink3 > dlink3tmp
29 rm dlink3
30 mv dlink3tmp dlink3
31 svn propdel svn:special dlink3
32 svn ci -m 'clobber symlink'
33 cd ..
34 svn up
35
36 # Clobber files and symlink with directories
37 cd ..
38 cat > clobber.rsvn <<EOF
39 rdelete trunk/a
40 rdelete trunk/dlink
41 rcopy trunk/d trunk/a
42 rcopy trunk/d trunk/dlink
43 EOF
44
45 python $RSVN --message=clobber1 --username=evil `pwd`/repo < clobber.rsvn
46
47 # Clobber non-symlink with symlink with same content (kudos openwrt)
48 cat > clobber.rsvn <<EOF
49 rdelete trunk/dlink3
50 rcopy trunk/dlink2 trunk/dlink3
51 EOF
52
53 python $RSVN --message=clobber2 --username=evil `pwd`/repo < clobber.rsvn
54
55 # Create d2 in branch so d2 has 'a' is in branch/d2 and trunk/d2,
56 # 'b' is in trunk/d2 and 'c' is in branch/d2
57 cd wc/trunk
58 echo b > d2/b
59 svn add d2/b
60 svn ci -m adddb
61 cd ..
62 svn up
63 svn cp trunk branches/branch
64 cd branches/branch
65 svn rm d2/b
66 echo c > d2/c
67 svn add d2/c
68 cd ../..
69 svn ci -m branch
70 svn up
71 cd ..
72
73 cat > clobber.rsvn <<EOF
74 rdelete trunk/d2
75 rcopy branches/branch/d2 trunk/d2
76 EOF
77 python $RSVN --message=clobberdir --username=evil `pwd`/repo < clobber.rsvn
78
79 svn log -v file://`pwd`/repo
80
81 svnadmin dump repo > ../replace.svndump