##// END OF EJS Templates
tests: unify test-convert-cvsnt-mergepoints
Matt Mackall -
r12523:a164a9cf default
parent child Browse files
Show More
@@ -1,102 +1,202
1 #!/bin/sh
2 1
3 "$TESTDIR/hghave" cvs || exit 80
2 $ "$TESTDIR/hghave" cvs || exit 80
3 $ filterpath()
4 > {
5 > eval "$@" | sed "s:$CVSROOT:*REPO*:g"
6 > }
7 $ cvscall()
8 > {
9 > cvs -f "$@"
10 > }
11
12 output of 'cvs ci' varies unpredictably, so discard most of it
13 -- just keep the part that matters
4 14
5 filterpath()
6 {
7 eval "$@" | sed "s:$CVSROOT:*REPO*:g"
8 }
15 $ cvsci()
16 > {
17 > cvs -f ci -f "$@" > /dev/null
18 > }
19 $ hgcat()
20 > {
21 > hg --cwd src-hg cat -r tip "$1"
22 > }
23 $ echo "[extensions]" >> $HGRCPATH
24 $ echo "convert = " >> $HGRCPATH
25 $ echo "graphlog = " >> $HGRCPATH
9 26
10 cvscall()
11 {
12 echo cvs -f "$@"
13 cvs -f "$@"
14 }
27 create cvs repository
28
29 $ mkdir cvsmaster
30 $ cd cvsmaster
31 $ CVSROOT=`pwd`
32 $ export CVSROOT
33 $ CVS_OPTIONS=-f
34 $ export CVS_OPTIONS
35 $ cd ..
36 $ filterpath cvscall -Q -d "$CVSROOT" init
37
38 checkout #1: add foo.txt
15 39
16 # output of 'cvs ci' varies unpredictably, so discard most of it
17 # -- just keep the part that matters
18 cvsci()
19 {
20 echo cvs -f ci -f "$@"
21 cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:"
22 }
40 $ cvscall -Q checkout -d cvsworktmp .
41 $ cd cvsworktmp
42 $ mkdir foo
43 $ cvscall -Q add foo
44 $ cd foo
45 $ echo foo > foo.txt
46 $ cvscall -Q add foo.txt
47 $ cvsci -m "add foo.txt" foo.txt
48 $ cd ../..
49 $ rm -rf cvsworktmp
23 50
24 hgcat()
25 {
26 hg --cwd src-hg cat -r tip "$1"
27 }
51 checkout #2: create MYBRANCH1 and modify foo.txt on it
52
53 $ cvscall -Q checkout -d cvswork foo
54 $ cd cvswork
55 $ cvscall -q rtag -b -R MYBRANCH1 foo
56 $ cvscall -Q update -P -r MYBRANCH1
57 $ echo bar > foo.txt
58 $ cvsci -m "bar" foo.txt
59 $ echo baz > foo.txt
60 $ cvsci -m "baz" foo.txt
61
62 create MYBRANCH1_2 and modify foo.txt some more
28 63
29 echo "[extensions]" >> $HGRCPATH
30 echo "convert = " >> $HGRCPATH
31 echo "graphlog = " >> $HGRCPATH
64 $ cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
65 $ cvscall -Q update -P -r MYBRANCH1_2
66 $ echo bazzie > foo.txt
67 $ cvsci -m "bazzie" foo.txt
68
69 create MYBRANCH1_1 and modify foo.txt yet again
70
71 $ cvscall -q rtag -b -R MYBRANCH1_1 foo
72 $ cvscall -Q update -P -r MYBRANCH1_1
73 $ echo quux > foo.txt
74 $ cvsci -m "quux" foo.txt
75
76 merge MYBRANCH1 to MYBRANCH1_1
32 77
33 echo "% create cvs repository"
34 mkdir cvsmaster
35 cd cvsmaster
36 CVSROOT=`pwd`
37 export CVSROOT
38 CVS_OPTIONS=-f
39 export CVS_OPTIONS
40 cd ..
41 filterpath cvscall -Q -d "$CVSROOT" init
78 $ filterpath cvscall -Q update -P -jMYBRANCH1
79 rcsmerge: warning: conflicts during merge
80 RCS file: *REPO*/foo/foo.txt,v
81 retrieving revision 1.1
82 retrieving revision 1.1.2.2
83 Merging differences between 1.1 and 1.1.2.2 into foo.txt
84
85 carefully placed sleep to dodge cvs bug (optimization?) where it
86 sometimes ignores a "commit" command if it comes too fast (the -f
87 option in cvsci seems to work for all the other commits in this
88 script)
89
90 $ sleep 1
91 $ echo xyzzy > foo.txt
92 $ cvsci -m "merge1+clobber" foo.txt
93
94 return to trunk and merge MYBRANCH1_2
42 95
43 echo "% checkout #1: add foo.txt"
44 cvscall -Q checkout -d cvsworktmp .
45 cd cvsworktmp
46 mkdir foo
47 cvscall -Q add foo
48 cd foo
49 echo foo > foo.txt
50 cvscall -Q add foo.txt
51 cvsci -m "add foo.txt" foo.txt
52
53 cd ../..
54 rm -rf cvsworktmp
55
56 echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it"
57 cvscall -Q checkout -d cvswork foo
58
59 cd cvswork
60
61 cvscall -q rtag -b -R MYBRANCH1 foo
62 cvscall -Q update -P -r MYBRANCH1
63 echo bar > foo.txt
64 cvsci -m "bar" foo.txt
65 echo baz > foo.txt
66 cvsci -m "baz" foo.txt
67
68 echo "% create MYBRANCH1_2 and modify foo.txt some more"
69 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo
70 cvscall -Q update -P -r MYBRANCH1_2
71
72 echo bazzie > foo.txt
73 cvsci -m "bazzie" foo.txt
74
75 echo "% create MYBRANCH1_1 and modify foo.txt yet again"
76 cvscall -q rtag -b -R MYBRANCH1_1 foo
77 cvscall -Q update -P -r MYBRANCH1_1
78
79 echo quux > foo.txt
80 cvsci -m "quux" foo.txt
81
82 echo "% merge MYBRANCH1 to MYBRANCH1_1"
83 filterpath cvscall -Q update -P -jMYBRANCH1
84 # carefully placed sleep to dodge cvs bug (optimization?) where it
85 # sometimes ignores a "commit" command if it comes too fast (the -f
86 # option in cvsci seems to work for all the other commits in this
87 # script)
88 sleep 1
89 echo xyzzy > foo.txt
90 cvsci -m "merge1+clobber" foo.txt
91
92 echo "% return to trunk and merge MYBRANCH1_2"
93 cvscall -Q update -P -A
94 filterpath cvscall -Q update -P -jMYBRANCH1_2
95 cvsci -m "merge2" foo.txt
96
97 REALCVS=`which cvs`
98 echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs
99 chmod +x ../cvs
100 PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
101
102 cd ..
96 $ cvscall -Q update -P -A
97 $ filterpath cvscall -Q update -P -jMYBRANCH1_2
98 RCS file: *REPO*/foo/foo.txt,v
99 retrieving revision 1.1
100 retrieving revision 1.1.2.2.2.1
101 Merging differences between 1.1 and 1.1.2.2.2.1 into foo.txt
102 $ cvsci -m "merge2" foo.txt
103 $ REALCVS=`which cvs`
104 $ echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs
105 $ chmod +x ../cvs
106 $ PATH=..:${PATH} hg debugcvsps --parents foo
107 collecting CVS rlog
108 7 log entries
109 creating changesets
110 7 changeset entries
111 ---------------------
112 PatchSet 1
113 Date: * (glob)
114 Author: user
115 Branch: HEAD
116 Tag: (none)
117 Branchpoints: MYBRANCH1_1, MYBRANCH1
118 Log:
119 foo.txt
120
121 Members:
122 foo.txt:INITIAL->1.1
123
124 ---------------------
125 PatchSet 2
126 Date: * (glob)
127 Author: user
128 Branch: MYBRANCH1
129 Tag: (none)
130 Parent: 1
131 Log:
132 bar
133
134 Members:
135 foo.txt:1.1->1.1.2.1
136
137 ---------------------
138 PatchSet 3
139 Date: * (glob)
140 Author: user
141 Branch: MYBRANCH1
142 Tag: (none)
143 Branchpoints: MYBRANCH1_2
144 Parent: 2
145 Log:
146 baz
147
148 Members:
149 foo.txt:1.1.2.1->1.1.2.2
150
151 ---------------------
152 PatchSet 4
153 Date: * (glob)
154 Author: user
155 Branch: MYBRANCH1_1
156 Tag: (none)
157 Parent: 1
158 Log:
159 quux
160
161 Members:
162 foo.txt:1.1->1.1.4.1
163
164 ---------------------
165 PatchSet 5
166 Date: * (glob)
167 Author: user
168 Branch: MYBRANCH1_2
169 Tag: (none)
170 Parent: 3
171 Log:
172 bazzie
173
174 Members:
175 foo.txt:1.1.2.2->1.1.2.2.2.1
176
177 ---------------------
178 PatchSet 6
179 Date: * (glob)
180 Author: user
181 Branch: HEAD
182 Tag: (none)
183 Parents: 1,5
184 Log:
185 merge
186
187 Members:
188 foo.txt:1.1->1.2
189
190 ---------------------
191 PatchSet 7
192 Date: * (glob)
193 Author: user
194 Branch: MYBRANCH1_1
195 Tag: (none)
196 Parents: 4,3
197 Log:
198 merge
199
200 Members:
201 foo.txt:1.1.4.1->1.1.4.2
202
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now