##// END OF EJS Templates
test-convert-cvs: test fuzz
Mads Kiilerich <mads at kiilerich.com> -
r12029:84a09639 stable
parent child Browse files
Show More
@@ -1,143 +1,153
1 1 #!/bin/sh
2 2
3 3 "$TESTDIR/hghave" cvs || exit 80
4 4
5 5 cvscall()
6 6 {
7 7 cvs -f "$@"
8 8 }
9 9
10 10 hgcat()
11 11 {
12 12 hg --cwd src-hg cat -r tip "$1"
13 13 }
14 14
15 15 echo "[extensions]" >> $HGRCPATH
16 16 echo "convert = " >> $HGRCPATH
17 17 echo "graphlog = " >> $HGRCPATH
18 18
19 19 cat > cvshooks.py <<EOF
20 20 def cvslog(ui,repo,hooktype,log):
21 21 print "%s hook: %d entries"%(hooktype,len(log))
22 22
23 23 def cvschangesets(ui,repo,hooktype,changesets):
24 24 print "%s hook: %d changesets"%(hooktype,len(changesets))
25 25 EOF
26 26 hookpath=`pwd`
27 27
28 28 echo "[hooks]" >> $HGRCPATH
29 29 echo "cvslog=python:$hookpath/cvshooks.py:cvslog" >> $HGRCPATH
30 30 echo "cvschangesets=python:$hookpath/cvshooks.py:cvschangesets" >> $HGRCPATH
31 31
32 32 echo % create cvs repository
33 33 mkdir cvsrepo
34 34 cd cvsrepo
35 35 CVSROOT=`pwd`
36 36 export CVSROOT
37 37 CVS_OPTIONS=-f
38 38 export CVS_OPTIONS
39 39 cd ..
40 40
41 41 cvscall -q -d "$CVSROOT" init
42 42
43 43 echo % create source directory
44 44 mkdir src-temp
45 45 cd src-temp
46 46 echo a > a
47 47 mkdir b
48 48 cd b
49 49 echo c > c
50 50 cd ..
51 51
52 52 echo % import source directory
53 53 cvscall -q import -m import src INITIAL start
54 54 cd ..
55 55
56 56 echo % checkout source directory
57 57 cvscall -q checkout src
58 58
59 59 echo % commit a new revision changing b/c
60 60 cd src
61 61 sleep 1
62 62 echo c >> b/c
63 63 cvscall -q commit -mci0 . | grep '<--' |\
64 64 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
65 65 cd ..
66 66
67 67 echo % convert fresh repo
68 68 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
69 69 hgcat a
70 70 hgcat b/c
71 71
72 72 echo % convert fresh repo with --filemap
73 73 echo include b/c > filemap
74 74 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
75 75 hgcat b/c
76 76 hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
77 77
78 78 echo % 'convert full repository (issue1649)'
79 79 cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT
80 80 ls srcfull
81 81 hg convert srcfull srcfull-hg \
82 82 | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g' \
83 83 | grep -v 'log entries' | grep -v 'hook:' \
84 84 | grep -v '^[0-3] .*' # filter instable changeset order
85 85 hg cat -r tip srcfull-hg/src/a
86 86 hg cat -r tip srcfull-hg/src/b/c
87 87
88 88 echo % commit new file revisions
89 89 cd src
90 90 echo a >> a
91 91 echo c >> b/c
92 92 cvscall -q commit -mci1 . | grep '<--' |\
93 93 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
94 94 cd ..
95 95
96 96 echo % convert again
97 97 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
98 98 hgcat a
99 99 hgcat b/c
100 100
101 101 echo % convert again with --filemap
102 102 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
103 103 hgcat b/c
104 104 hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
105 105
106 106 echo % commit branch
107 107 cd src
108 108 cvs -q update -r1.1 b/c
109 109 cvs -q tag -b branch
110 110 cvs -q update -r branch > /dev/null
111 111 echo d >> b/c
112 112 cvs -q commit -mci2 . | grep '<--' |\
113 113 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
114 114 cd ..
115 115
116 116 echo % convert again
117 117 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
118 118 hgcat b/c
119 119
120 120 echo % convert again with --filemap
121 121 hg convert --filemap filemap src src-filemap | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
122 122 hgcat b/c
123 123 hg -R src-filemap log --template '{rev} {desc} files: {files}\n'
124 124
125 125 echo % commit a new revision with funny log message
126 126 cd src
127 127 sleep 1
128 128 echo e >> a
129 129 cvscall -q commit -m'funny
130 130 ----------------------------
131 131 log message' . | grep '<--' |\
132 132 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
133 133 cd ..
134 134
135 echo % commit new file revisions with some fuzz
136 cd src
137 echo f >> a
138 cvscall -q commit -mfuzzy . | grep '<--' |\
139 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
140 sleep 4 # the two changes will be split if fuzz < 4
141 echo g >> b/c
142 cvscall -q commit -mfuzzy . | grep '<--' |\
143 sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'
144 cd ..
145
135 146 echo % convert again
136 hg convert src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
147 hg convert --config convert.cvsps.fuzz=2 src src-hg | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'
137 148
138 echo "graphlog = " >> $HGRCPATH
139 149 hg -R src-hg glog --template '{rev} ({branches}) {desc} files: {files}\n'
140 150
141 151 echo % testing debugcvsps
142 152 cd src
143 hg debugcvsps | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
153 hg debugcvsps --fuzz=2 | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/'
@@ -1,288 +1,321
1 1 % create cvs repository
2 2 % create source directory
3 3 % import source directory
4 4 N src/a
5 5 N src/b/c
6 6
7 7 No conflicts created by this import
8 8
9 9 % checkout source directory
10 10 U src/a
11 11 U src/b/c
12 12 % commit a new revision changing b/c
13 13 checking in src/b/c,v
14 14 % convert fresh repo
15 15 initializing destination src-hg repository
16 16 connecting to cvsrepo
17 17 scanning source...
18 18 collecting CVS rlog
19 19 5 log entries
20 20 cvslog hook: 5 entries
21 21 creating changesets
22 22 3 changeset entries
23 23 cvschangesets hook: 3 changesets
24 24 sorting...
25 25 converting...
26 26 2 Initial revision
27 27 1 import
28 28 0 ci0
29 29 updating tags
30 30 a
31 31 c
32 32 c
33 33 % convert fresh repo with --filemap
34 34 initializing destination src-filemap repository
35 35 connecting to cvsrepo
36 36 scanning source...
37 37 collecting CVS rlog
38 38 5 log entries
39 39 cvslog hook: 5 entries
40 40 creating changesets
41 41 3 changeset entries
42 42 cvschangesets hook: 3 changesets
43 43 sorting...
44 44 converting...
45 45 2 Initial revision
46 46 1 import
47 47 filtering out empty revision
48 48 rolling back to revision 0 (undo commit)
49 49 0 ci0
50 50 updating tags
51 51 c
52 52 c
53 53 2 update tags files: .hgtags
54 54 1 ci0 files: b/c
55 55 0 Initial revision files: b/c
56 56 % convert full repository (issue1649)
57 57 U srcfull/src/a
58 58 U srcfull/src/b/c
59 59 CVS
60 60 CVSROOT
61 61 src
62 62 initializing destination srcfull-hg repository
63 63 connecting to cvsrepo
64 64 scanning source...
65 65 collecting CVS rlog
66 66 creating changesets
67 67 4 changeset entries
68 68 sorting...
69 69 converting...
70 70 updating tags
71 71 a
72 72 c
73 73 c
74 74 % commit new file revisions
75 75 checking in src/a,v
76 76 checking in src/b/c,v
77 77 % convert again
78 78 connecting to cvsrepo
79 79 scanning source...
80 80 collecting CVS rlog
81 81 7 log entries
82 82 cvslog hook: 7 entries
83 83 creating changesets
84 84 4 changeset entries
85 85 cvschangesets hook: 4 changesets
86 86 sorting...
87 87 converting...
88 88 0 ci1
89 89 a
90 90 a
91 91 c
92 92 c
93 93 c
94 94 % convert again with --filemap
95 95 connecting to cvsrepo
96 96 scanning source...
97 97 collecting CVS rlog
98 98 7 log entries
99 99 cvslog hook: 7 entries
100 100 creating changesets
101 101 4 changeset entries
102 102 cvschangesets hook: 4 changesets
103 103 sorting...
104 104 converting...
105 105 0 ci1
106 106 c
107 107 c
108 108 c
109 109 3 ci1 files: b/c
110 110 2 update tags files: .hgtags
111 111 1 ci0 files: b/c
112 112 0 Initial revision files: b/c
113 113 % commit branch
114 114 U b/c
115 115 T a
116 116 T b/c
117 117 checking in src/b/c,v
118 118 % convert again
119 119 connecting to cvsrepo
120 120 scanning source...
121 121 collecting CVS rlog
122 122 8 log entries
123 123 cvslog hook: 8 entries
124 124 creating changesets
125 125 5 changeset entries
126 126 cvschangesets hook: 5 changesets
127 127 sorting...
128 128 converting...
129 129 0 ci2
130 130 c
131 131 d
132 132 % convert again with --filemap
133 133 connecting to cvsrepo
134 134 scanning source...
135 135 collecting CVS rlog
136 136 8 log entries
137 137 cvslog hook: 8 entries
138 138 creating changesets
139 139 5 changeset entries
140 140 cvschangesets hook: 5 changesets
141 141 sorting...
142 142 converting...
143 143 0 ci2
144 144 c
145 145 d
146 146 4 ci2 files: b/c
147 147 3 ci1 files: b/c
148 148 2 update tags files: .hgtags
149 149 1 ci0 files: b/c
150 150 0 Initial revision files: b/c
151 151 % commit a new revision with funny log message
152 152 checking in src/a,v
153 % commit new file revisions with some fuzz
154 checking in src/a,v
155 checking in src/b/c,v
153 156 % convert again
154 157 connecting to cvsrepo
155 158 scanning source...
156 159 collecting CVS rlog
157 9 log entries
158 cvslog hook: 9 entries
160 11 log entries
161 cvslog hook: 11 entries
159 162 creating changesets
160 6 changeset entries
161 cvschangesets hook: 6 changesets
163 8 changeset entries
164 cvschangesets hook: 8 changesets
162 165 sorting...
163 166 converting...
164 0 funny
167 2 funny
168 1 fuzzy
169 0 fuzzy
170 o 8 (branch) fuzzy files: b/c
171 |
172 o 7 (branch) fuzzy files: a
173 |
165 174 o 6 (branch) funny
166 175 | ----------------------------
167 176 | log message files: a
168 177 o 5 (branch) ci2 files: b/c
169 178
170 179 o 4 () ci1 files: a b/c
171 180 |
172 181 o 3 () update tags files: .hgtags
173 182 |
174 183 o 2 () ci0 files: b/c
175 184 |
176 185 | o 1 (INITIAL) import files:
177 186 |/
178 187 o 0 () Initial revision files: a b/c
179 188
180 189 % testing debugcvsps
181 190 collecting CVS rlog
182 9 log entries
183 cvslog hook: 9 entries
191 11 log entries
192 cvslog hook: 11 entries
184 193 creating changesets
185 8 changeset entries
186 cvschangesets hook: 8 changesets
194 10 changeset entries
195 cvschangesets hook: 10 changesets
187 196 ---------------------
188 197 PatchSet 1
189 198 Date:
190 199 Author:
191 200 Branch: HEAD
192 201 Tag: (none)
193 202 Branchpoints: INITIAL
194 203 Log:
195 204 Initial revision
196 205
197 206 Members:
198 207 a:INITIAL->1.1
199 208
200 209 ---------------------
201 210 PatchSet 2
202 211 Date:
203 212 Author:
204 213 Branch: HEAD
205 214 Tag: (none)
206 215 Branchpoints: INITIAL, branch
207 216 Log:
208 217 Initial revision
209 218
210 219 Members:
211 220 b/c:INITIAL->1.1
212 221
213 222 ---------------------
214 223 PatchSet 3
215 224 Date:
216 225 Author:
217 226 Branch: INITIAL
218 227 Tag: start
219 228 Log:
220 229 import
221 230
222 231 Members:
223 232 a:1.1->1.1.1.1
224 233 b/c:1.1->1.1.1.1
225 234
226 235 ---------------------
227 236 PatchSet 4
228 237 Date:
229 238 Author:
230 239 Branch: HEAD
231 240 Tag: (none)
232 241 Log:
233 242 ci0
234 243
235 244 Members:
236 245 b/c:1.1->1.2
237 246
238 247 ---------------------
239 248 PatchSet 5
240 249 Date:
241 250 Author:
242 251 Branch: HEAD
243 252 Tag: (none)
244 253 Branchpoints: branch
245 254 Log:
246 255 ci1
247 256
248 257 Members:
249 258 a:1.1->1.2
250 259
251 260 ---------------------
252 261 PatchSet 6
253 262 Date:
254 263 Author:
255 264 Branch: HEAD
256 265 Tag: (none)
257 266 Log:
258 267 ci1
259 268
260 269 Members:
261 270 b/c:1.2->1.3
262 271
263 272 ---------------------
264 273 PatchSet 7
265 274 Date:
266 275 Author:
267 276 Branch: branch
268 277 Tag: (none)
269 278 Log:
270 279 ci2
271 280
272 281 Members:
273 282 b/c:1.1->1.1.2.1
274 283
275 284 ---------------------
276 285 PatchSet 8
277 286 Date:
278 287 Author:
279 288 Branch: branch
280 289 Tag: (none)
281 290 Log:
282 291 funny
283 292 ----------------------------
284 293 log message
285 294
286 295 Members:
287 296 a:1.2->1.2.2.1
288 297
298 ---------------------
299 PatchSet 9
300 Date:
301 Author:
302 Branch: branch
303 Tag: (none)
304 Log:
305 fuzzy
306
307 Members:
308 a:1.2.2.1->1.2.2.2
309
310 ---------------------
311 PatchSet 10
312 Date:
313 Author:
314 Branch: branch
315 Tag: (none)
316 Log:
317 fuzzy
318
319 Members:
320 b/c:1.1.2.1->1.1.2.2
321
General Comments 0
You need to be logged in to leave comments. Login now