/[svn2cvs]/trunk/test.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /trunk/test.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 47 - (show annotations)
Fri Nov 2 12:11:31 2007 UTC (13 years, 11 months ago) by dpavlin
File MIME type: application/x-sh
File size: 3785 byte(s)
integrated changes from Samuel GĂ©lineau which implement .keepme files inside
directories to fix basically all problems with directories.
1 #!/bin/sh -x
2
3 dir=/dev/shm
4 test -e $dir || dir=/tmp/
5
6 svn_rep=$dir/test-svn-rep/
7 svn_co=$dir/test-svn-co/
8 cvs_rep=$dir/test-cvs-rep/
9 cvs_co=$dir/test-cvs-co/
10
11 test -d $svn_rep && rm -Rf $svn_rep
12 test -d $svn_co && rm -Rf $svn_co
13 test -d $cvs_rep && rm -Rf $cvs_rep
14 test -d $cvs_co && rm -Rf $cvs_co
15
16 svnadmin create $svn_rep || exit
17 mkdir $svn_co || exit
18 svn import -m "initial import" $svn_co file://$svn_rep || exit
19 rm -Rf $svn_co || exit
20 svn co file://$svn_rep $svn_co || exit
21 mkdir $svn_co/dir || exit
22 svn add $svn_co/dir || exit
23 svn commit -m "dir" $svn_co/dir || exit
24
25 mkdir "$svn_co/dir/with space" || exit
26 svn add "$svn_co/dir/with space" || exit
27 svn commit -m "dir with space" "$svn_co/dir/with space" || exit
28
29 ps ax > $svn_co/dir/file || exit
30 ps ax > "$svn_co/dir/file with spaces" || exit
31 svn add $svn_co/dir/file "$svn_co/dir/file with spaces" || exit
32 svn commit -m "files" $svn_co || exit
33
34 svn rm $svn_co/dir/file || exit
35 svn rm "$svn_co/dir/file with spaces" || exit
36 svn commit -m "delete files" $svn_co || exit
37
38 export CVSROOT=$cvs_rep
39
40 mkdir $cvs_rep || exit
41 cvs -f init || exit
42 mkdir $cvs_co || exit
43 cd $cvs_co || exit
44 cvs -f co . || exit
45 mkdir $cvs_co/dir || exit
46 cvs -f add dir $cvs_co/dir || exit
47 cvs -f commit -m "fake repository root" dir $cvs_co/dir || exit
48 echo 0 > $cvs_co/dir/.svnrev || exit
49 cvs -f add $cvs_co/dir/.svnrev || exit
50 cvs -f commit -m "fake existing repository" $cvs_co/dir/.svnrev || exit
51 cd - || exit
52
53 rm -Rf $cvs_co || exit
54 mkdir $cvs_co || exit
55 cd $cvs_co && cvs -f co -P dir && cd - || exit
56
57 function svn2cvs() {
58 ./svn2cvs.pl file://$svn_rep/dir $cvs_rep dir || exit
59 }
60 function update_cvs() {
61 cd $cvs_co && cvs -f update -P -d dir && cd - || exit
62 }
63 function update_svn() {
64 svn update $svn_co || exit
65 }
66 function update_all() {
67 update_svn
68 update_cvs
69 }
70 function test() {
71 svn2cvs
72 update_all
73 diff -x .svn\* -x CVS -x '\.keepme' -urw $svn_co/dir/ $cvs_co/dir/ || exit
74 }
75
76 svn2cvs
77 update_cvs
78
79 test -d "$cvs_co/dir/with space" || exit
80
81 ps ax > $svn_co/dir/file || exit
82 svn add $svn_co/dir/file || exit
83 svn commit -m "file again" $svn_co || exit
84
85 test
86
87 svn rm $svn_co/dir/file || exit
88 svn commit -m "remove file again" $svn_co || exit
89
90 test
91
92 echo "new file" > $svn_co/dir/skip_add
93 svn add $svn_co/dir/skip_add || exit
94 svn commit -m "add skip_add" $svn_co || exit
95
96 echo "modify file" >> $svn_co/dir/skip_add
97 svn commit -m "modify skip_add" $svn_co || exit
98
99 cvs_rev=`cat $cvs_co/dir/.svnrev`
100 echo "*** skipping revision $cvs_rev ***"
101 echo `expr $cvs_rev + 1` > $cvs_co/dir/.svnrev || exit
102 cd $cvs_co && cvs -f commit -m "skip $cvs_rev" dir/.svnrev && cd - || exit
103
104 test
105
106 echo keep > $svn_co/dir/keep
107 svn add $svn_co/dir/keep
108 svn mkdir $svn_co/dir/keep-dir
109 echo keep > $svn_co/dir/keep-dir/keep
110 svn add $svn_co/dir/keep-dir/keep
111 svn commit -m "stuff to keep" $svn_co || exit
112
113 test
114
115 svn rm $svn_co/dir/keep-dir/keep
116 svn commit -m "remove keep in keep-dir" $svn_co || exit
117
118 test
119
120 svn mv $svn_co/dir/keep $svn_co/dir/keep-dir/ || exit
121 svn commit -m "move keep into keep-dir" $svn_co || exit
122
123 test
124
125 svn mv $svn_co/dir/keep-dir/keep $svn_co/dir/keep || exit
126 svn commit -m "move keep back" $svn_co || exit
127
128 test
129
130 echo bar > $svn_co/dir/bar
131 echo baz > $svn_co/dir/baz
132 svn mkdir $svn_co/dir/l1
133 echo bar > $svn_co/dir/l1/bar
134 echo baz > $svn_co/dir/l1/baz
135 svn mkdir $svn_co/dir/l1/l2
136 echo bar > $svn_co/dir/l1/l2/bar
137 echo baz > $svn_co/dir/l1/l2/baz
138 svn mkdir $svn_co/dir/l1/l2/l3
139 echo bar > $svn_co/dir/l1/l2/l3/bar
140 echo baz > $svn_co/dir/l1/l2/l3/baz
141
142 svn add $svn_co/dir/* $svn_co/dir/l1 $svn_co/dir/l1/* $svn_co/dir/l1/l2/* $svn_co/dir/l1/l2/l3/*
143 svn commit -m "add a bunch of stuff" $svn_co || exit
144
145 test
146
147 svn rm $svn_co/dir/* || exit
148 svn revert $svn_co/dir/keep $svn_co/dir/keep-dir{,/keep}
149 svn commit -m "remove everything" $svn_co || exit
150
151 test

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26