/[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

Annotation of /trunk/test.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 35 - (hide annotations)
Fri Sep 7 16:39:42 2007 UTC (16 years, 6 months ago) by dpavlin
File MIME type: application/x-sh
File size: 3437 byte(s)
implemented (hopefully correct) delete of subtrees from CVS. I still quite
don't get cvs update -dP policy, this might need re-visit
1 dpavlin 29 #!/bin/sh -x
2    
3 dpavlin 33 dir=/dev/shm
4     test -e $dir || dir=/tmp/
5 dpavlin 29
6 dpavlin 33 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 dpavlin 29 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 dir && cd - || exit
56    
57 dpavlin 32 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 -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 dpavlin 33 diff -x .svn\* -x CVS -urw $svn_co/dir/ $cvs_co/dir/ || exit
74 dpavlin 32 }
75 dpavlin 29
76 dpavlin 32 svn2cvs
77     update_cvs
78    
79 dpavlin 29 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 dpavlin 32 test
86 dpavlin 29
87     svn rm $svn_co/dir/file || exit
88     svn commit -m "remove file again" $svn_co || exit
89    
90 dpavlin 32 test
91 dpavlin 29
92 dpavlin 30 echo "new file" > $svn_co/dir/skip_add
93 dpavlin 33 svn add $svn_co/dir/skip_add || exit
94     svn commit -m "add skip_add" $svn_co || exit
95 dpavlin 30
96     echo "modify file" >> $svn_co/dir/skip_add
97 dpavlin 33 svn commit -m "modify skip_add" $svn_co || exit
98 dpavlin 30
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 dpavlin 32 test
105 dpavlin 30
106 dpavlin 33 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     echo bar > $svn_co/dir/bar
116     echo baz > $svn_co/dir/baz
117 dpavlin 35 svn mkdir $svn_co/dir/l1
118     echo bar > $svn_co/dir/l1/bar
119     echo baz > $svn_co/dir/l1/baz
120     svn mkdir $svn_co/dir/l1/l2
121     echo bar > $svn_co/dir/l1/l2/bar
122     echo baz > $svn_co/dir/l1/l2/baz
123     svn mkdir $svn_co/dir/l1/l2/l3
124     echo bar > $svn_co/dir/l1/l2/l3/bar
125     echo baz > $svn_co/dir/l1/l2/l3/baz
126    
127     svn add $svn_co/dir/* $svn_co/dir/l1 $svn_co/dir/l1/* $svn_co/dir/l1/l2/* $svn_co/dir/l1/l2/l3/*
128 dpavlin 33 svn commit -m "add a bunch of stuff" $svn_co || exit
129    
130     test
131    
132     svn rm $svn_co/dir/* || exit
133     svn revert $svn_co/dir/keep $svn_co/dir/keep-dir/keep
134     svn commit -m "remove everything" $svn_co || exit
135    
136     test

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26