Show More
@@ -1,654 +1,659 b'' | |||
|
1 | 1 | #require cvs |
|
2 | 2 | |
|
3 | 3 | $ cvscall() |
|
4 | 4 | > { |
|
5 | 5 | > cvs -f "$@" |
|
6 | 6 | > } |
|
7 | 7 | $ hgcat() |
|
8 | 8 | > { |
|
9 | 9 | > hg --cwd src-hg cat -r tip "$1" |
|
10 | 10 | > } |
|
11 | 11 | $ echo "[extensions]" >> $HGRCPATH |
|
12 | 12 | $ echo "convert = " >> $HGRCPATH |
|
13 | 13 | $ cat > cvshooks.py <<EOF |
|
14 | 14 | > def cvslog(ui,repo,hooktype,log): |
|
15 | 15 | > ui.write('%s hook: %d entries\n' % (hooktype,len(log))) |
|
16 | 16 | > |
|
17 | 17 | > def cvschangesets(ui,repo,hooktype,changesets): |
|
18 | 18 | > ui.write('%s hook: %d changesets\n' % (hooktype,len(changesets))) |
|
19 | 19 | > EOF |
|
20 | 20 | $ hookpath=`pwd` |
|
21 | 21 | $ cat <<EOF >> $HGRCPATH |
|
22 | 22 | > [hooks] |
|
23 | 23 | > cvslog = python:$hookpath/cvshooks.py:cvslog |
|
24 | 24 | > cvschangesets = python:$hookpath/cvshooks.py:cvschangesets |
|
25 | 25 | > EOF |
|
26 | 26 | |
|
27 | 27 | create cvs repository |
|
28 | 28 | |
|
29 | 29 | $ mkdir cvsrepo |
|
30 | 30 | $ cd cvsrepo |
|
31 | 31 | $ CVSROOT=`pwd` |
|
32 | 32 | $ export CVSROOT |
|
33 | 33 | $ CVS_OPTIONS=-f |
|
34 | 34 | $ export CVS_OPTIONS |
|
35 | 35 | $ cd .. |
|
36 | 36 | $ rmdir cvsrepo |
|
37 | 37 | $ cvscall -q -d "$CVSROOT" init |
|
38 | 38 | |
|
39 | 39 | create source directory |
|
40 | 40 | |
|
41 | 41 | $ mkdir src-temp |
|
42 | 42 | $ cd src-temp |
|
43 | 43 | $ echo a > a |
|
44 | 44 | $ mkdir b |
|
45 | 45 | $ cd b |
|
46 | 46 | $ echo c > c |
|
47 | 47 | $ cd .. |
|
48 | 48 | |
|
49 | 49 | import source directory |
|
50 | 50 | |
|
51 | 51 | $ cvscall -q import -m import src INITIAL start |
|
52 | 52 | N src/a |
|
53 | 53 | N src/b/c |
|
54 | 54 | |
|
55 | 55 | No conflicts created by this import |
|
56 | 56 | |
|
57 | 57 | $ cd .. |
|
58 | 58 | |
|
59 | 59 | checkout source directory |
|
60 | 60 | |
|
61 | 61 | $ cvscall -q checkout src |
|
62 | 62 | U src/a |
|
63 | 63 | U src/b/c |
|
64 | 64 | |
|
65 | 65 | commit a new revision changing b/c |
|
66 | 66 | |
|
67 | 67 | $ cd src |
|
68 | 68 | $ sleep 1 |
|
69 | 69 | $ echo c >> b/c |
|
70 | 70 | $ cvscall -q commit -mci0 . | grep '<--' |
|
71 | 71 | $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) |
|
72 | 72 | $ cd .. |
|
73 | 73 | |
|
74 | 74 | convert fresh repo and also check localtimezone option |
|
75 | 75 | |
|
76 | 76 | NOTE: This doesn't check all time zones -- it merely determines that |
|
77 | 77 | the configuration option is taking effect. |
|
78 | 78 | |
|
79 | 79 | An arbitrary (U.S.) time zone is used here. TZ=US/Hawaii is selected |
|
80 | 80 | since it does not use DST (unlike other U.S. time zones) and is always |
|
81 | 81 | a fixed difference from UTC. |
|
82 | 82 | |
|
83 | $ TZ=US/Hawaii hg convert --config convert.localtimezone=True src src-hg | |
|
83 | This choice is limited to work on Linux environments. At least on | |
|
84 | FreeBSD 11 this timezone is not known. A better choice is | |
|
85 | TZ=Pacific/Johnston. On Linux "US/Hawaii" is just a symlink to this | |
|
86 | name and also it is known on FreeBSD and on Solaris. | |
|
87 | ||
|
88 | $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True src src-hg | |
|
84 | 89 | initializing destination src-hg repository |
|
85 | 90 | connecting to $TESTTMP/cvsrepo |
|
86 | 91 | scanning source... |
|
87 | 92 | collecting CVS rlog |
|
88 | 93 | 5 log entries |
|
89 | 94 | cvslog hook: 5 entries |
|
90 | 95 | creating changesets |
|
91 | 96 | 3 changeset entries |
|
92 | 97 | cvschangesets hook: 3 changesets |
|
93 | 98 | sorting... |
|
94 | 99 | converting... |
|
95 | 100 | 2 Initial revision |
|
96 | 101 | 1 ci0 |
|
97 | 102 | 0 import |
|
98 | 103 | updating tags |
|
99 | 104 | $ hgcat a |
|
100 | 105 | a |
|
101 | 106 | $ hgcat b/c |
|
102 | 107 | c |
|
103 | 108 | c |
|
104 | 109 | |
|
105 | 110 | convert fresh repo with --filemap |
|
106 | 111 | |
|
107 | 112 | $ echo include b/c > filemap |
|
108 | 113 | $ hg convert --filemap filemap src src-filemap |
|
109 | 114 | initializing destination src-filemap repository |
|
110 | 115 | connecting to $TESTTMP/cvsrepo |
|
111 | 116 | scanning source... |
|
112 | 117 | collecting CVS rlog |
|
113 | 118 | 5 log entries |
|
114 | 119 | cvslog hook: 5 entries |
|
115 | 120 | creating changesets |
|
116 | 121 | 3 changeset entries |
|
117 | 122 | cvschangesets hook: 3 changesets |
|
118 | 123 | sorting... |
|
119 | 124 | converting... |
|
120 | 125 | 2 Initial revision |
|
121 | 126 | 1 ci0 |
|
122 | 127 | 0 import |
|
123 | 128 | filtering out empty revision |
|
124 | 129 | repository tip rolled back to revision 1 (undo convert) |
|
125 | 130 | updating tags |
|
126 | 131 | $ hgcat b/c |
|
127 | 132 | c |
|
128 | 133 | c |
|
129 | 134 | $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n' |
|
130 | 135 | 2 update tags files: .hgtags |
|
131 | 136 | 1 ci0 files: b/c |
|
132 | 137 | 0 Initial revision files: b/c |
|
133 | 138 | |
|
134 | 139 | convert full repository (issue1649) |
|
135 | 140 | |
|
136 | 141 | $ cvscall -q -d "$CVSROOT" checkout -d srcfull "." | grep -v CVSROOT |
|
137 | 142 | U srcfull/src/a |
|
138 | 143 | U srcfull/src/b/c |
|
139 | 144 | $ ls srcfull |
|
140 | 145 | CVS |
|
141 | 146 | CVSROOT |
|
142 | 147 | src |
|
143 | 148 | $ hg convert srcfull srcfull-hg \ |
|
144 | 149 | > | grep -v 'log entries' | grep -v 'hook:' \ |
|
145 | 150 | > | grep -v '^[0-3] .*' # filter instable changeset order |
|
146 | 151 | initializing destination srcfull-hg repository |
|
147 | 152 | connecting to $TESTTMP/cvsrepo |
|
148 | 153 | scanning source... |
|
149 | 154 | collecting CVS rlog |
|
150 | 155 | creating changesets |
|
151 | 156 | 4 changeset entries |
|
152 | 157 | sorting... |
|
153 | 158 | converting... |
|
154 | 159 | updating tags |
|
155 | 160 | $ hg cat -r tip --cwd srcfull-hg src/a |
|
156 | 161 | a |
|
157 | 162 | $ hg cat -r tip --cwd srcfull-hg src/b/c |
|
158 | 163 | c |
|
159 | 164 | c |
|
160 | 165 | |
|
161 | 166 | commit new file revisions |
|
162 | 167 | |
|
163 | 168 | $ cd src |
|
164 | 169 | $ echo a >> a |
|
165 | 170 | $ echo c >> b/c |
|
166 | 171 | $ cvscall -q commit -mci1 . | grep '<--' |
|
167 | 172 | $TESTTMP/cvsrepo/src/a,v <-- a |
|
168 | 173 | $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) |
|
169 | 174 | $ cd .. |
|
170 | 175 | |
|
171 | 176 | convert again |
|
172 | 177 | |
|
173 |
$ TZ= |
|
|
178 | $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True src src-hg | |
|
174 | 179 | connecting to $TESTTMP/cvsrepo |
|
175 | 180 | scanning source... |
|
176 | 181 | collecting CVS rlog |
|
177 | 182 | 7 log entries |
|
178 | 183 | cvslog hook: 7 entries |
|
179 | 184 | creating changesets |
|
180 | 185 | 4 changeset entries |
|
181 | 186 | cvschangesets hook: 4 changesets |
|
182 | 187 | sorting... |
|
183 | 188 | converting... |
|
184 | 189 | 0 ci1 |
|
185 | 190 | $ hgcat a |
|
186 | 191 | a |
|
187 | 192 | a |
|
188 | 193 | $ hgcat b/c |
|
189 | 194 | c |
|
190 | 195 | c |
|
191 | 196 | c |
|
192 | 197 | |
|
193 | 198 | convert again with --filemap |
|
194 | 199 | |
|
195 | 200 | $ hg convert --filemap filemap src src-filemap |
|
196 | 201 | connecting to $TESTTMP/cvsrepo |
|
197 | 202 | scanning source... |
|
198 | 203 | collecting CVS rlog |
|
199 | 204 | 7 log entries |
|
200 | 205 | cvslog hook: 7 entries |
|
201 | 206 | creating changesets |
|
202 | 207 | 4 changeset entries |
|
203 | 208 | cvschangesets hook: 4 changesets |
|
204 | 209 | sorting... |
|
205 | 210 | converting... |
|
206 | 211 | 0 ci1 |
|
207 | 212 | $ hgcat b/c |
|
208 | 213 | c |
|
209 | 214 | c |
|
210 | 215 | c |
|
211 | 216 | $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n' |
|
212 | 217 | 3 ci1 files: b/c |
|
213 | 218 | 2 update tags files: .hgtags |
|
214 | 219 | 1 ci0 files: b/c |
|
215 | 220 | 0 Initial revision files: b/c |
|
216 | 221 | |
|
217 | 222 | commit branch |
|
218 | 223 | |
|
219 | 224 | $ cd src |
|
220 | 225 | $ cvs -q update -r1.1 b/c |
|
221 | 226 | U b/c |
|
222 | 227 | $ cvs -q tag -b branch |
|
223 | 228 | T a |
|
224 | 229 | T b/c |
|
225 | 230 | $ cvs -q update -r branch > /dev/null |
|
226 | 231 | $ sleep 1 |
|
227 | 232 | $ echo d >> b/c |
|
228 | 233 | $ cvs -q commit -mci2 . | grep '<--' |
|
229 | 234 | $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) |
|
230 | 235 | $ cd .. |
|
231 | 236 | |
|
232 | 237 | convert again |
|
233 | 238 | |
|
234 |
$ TZ= |
|
|
239 | $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True src src-hg | |
|
235 | 240 | connecting to $TESTTMP/cvsrepo |
|
236 | 241 | scanning source... |
|
237 | 242 | collecting CVS rlog |
|
238 | 243 | 8 log entries |
|
239 | 244 | cvslog hook: 8 entries |
|
240 | 245 | creating changesets |
|
241 | 246 | 5 changeset entries |
|
242 | 247 | cvschangesets hook: 5 changesets |
|
243 | 248 | sorting... |
|
244 | 249 | converting... |
|
245 | 250 | 0 ci2 |
|
246 | 251 | $ hgcat b/c |
|
247 | 252 | c |
|
248 | 253 | d |
|
249 | 254 | |
|
250 | 255 | convert again with --filemap |
|
251 | 256 | |
|
252 |
$ TZ= |
|
|
257 | $ TZ=Pacific/Johnston hg convert --config convert.localtimezone=True --filemap filemap src src-filemap | |
|
253 | 258 | connecting to $TESTTMP/cvsrepo |
|
254 | 259 | scanning source... |
|
255 | 260 | collecting CVS rlog |
|
256 | 261 | 8 log entries |
|
257 | 262 | cvslog hook: 8 entries |
|
258 | 263 | creating changesets |
|
259 | 264 | 5 changeset entries |
|
260 | 265 | cvschangesets hook: 5 changesets |
|
261 | 266 | sorting... |
|
262 | 267 | converting... |
|
263 | 268 | 0 ci2 |
|
264 | 269 | $ hgcat b/c |
|
265 | 270 | c |
|
266 | 271 | d |
|
267 | 272 | $ hg -R src-filemap log --template '{rev} {desc} files: {files}\n' |
|
268 | 273 | 4 ci2 files: b/c |
|
269 | 274 | 3 ci1 files: b/c |
|
270 | 275 | 2 update tags files: .hgtags |
|
271 | 276 | 1 ci0 files: b/c |
|
272 | 277 | 0 Initial revision files: b/c |
|
273 | 278 | |
|
274 | 279 | commit a new revision with funny log message |
|
275 | 280 | |
|
276 | 281 | $ cd src |
|
277 | 282 | $ sleep 1 |
|
278 | 283 | $ echo e >> a |
|
279 | 284 | $ cvscall -q commit -m'funny |
|
280 | 285 | > ---------------------------- |
|
281 | 286 | > log message' . | grep '<--' |\ |
|
282 | 287 | > sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g' |
|
283 | 288 | checking in src/a,v |
|
284 | 289 | |
|
285 | 290 | commit new file revisions with some fuzz |
|
286 | 291 | |
|
287 | 292 | $ sleep 1 |
|
288 | 293 | $ echo f >> a |
|
289 | 294 | $ cvscall -q commit -mfuzzy . | grep '<--' |
|
290 | 295 | $TESTTMP/cvsrepo/src/a,v <-- a |
|
291 | 296 | $ sleep 4 # the two changes will be split if fuzz < 4 |
|
292 | 297 | $ echo g >> b/c |
|
293 | 298 | $ cvscall -q commit -mfuzzy . | grep '<--' |
|
294 | 299 | $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) |
|
295 | 300 | $ cd .. |
|
296 | 301 | |
|
297 | 302 | convert again |
|
298 | 303 | |
|
299 |
$ TZ= |
|
|
304 | $ TZ=Pacific/Johnston hg convert --config convert.cvsps.fuzz=2 --config convert.localtimezone=True src src-hg | |
|
300 | 305 | connecting to $TESTTMP/cvsrepo |
|
301 | 306 | scanning source... |
|
302 | 307 | collecting CVS rlog |
|
303 | 308 | 11 log entries |
|
304 | 309 | cvslog hook: 11 entries |
|
305 | 310 | creating changesets |
|
306 | 311 | 8 changeset entries |
|
307 | 312 | cvschangesets hook: 8 changesets |
|
308 | 313 | sorting... |
|
309 | 314 | converting... |
|
310 | 315 | 2 funny |
|
311 | 316 | 1 fuzzy |
|
312 | 317 | 0 fuzzy |
|
313 | 318 | $ hg -R src-hg log -G --template '{rev} ({branches}) {desc} date: {date|date} files: {files}\n' |
|
314 | 319 | o 8 (branch) fuzzy date: * -1000 files: b/c (glob) |
|
315 | 320 | | |
|
316 | 321 | o 7 (branch) fuzzy date: * -1000 files: a (glob) |
|
317 | 322 | | |
|
318 | 323 | o 6 (branch) funny |
|
319 | 324 | | ---------------------------- |
|
320 | 325 | | log message date: * -1000 files: a (glob) |
|
321 | 326 | o 5 (branch) ci2 date: * -1000 files: b/c (glob) |
|
322 | 327 | |
|
323 | 328 | o 4 () ci1 date: * -1000 files: a b/c (glob) |
|
324 | 329 | | |
|
325 | 330 | o 3 () update tags date: * +0000 files: .hgtags (glob) |
|
326 | 331 | | |
|
327 | 332 | | o 2 (INITIAL) import date: * -1000 files: (glob) |
|
328 | 333 | | | |
|
329 | 334 | o | 1 () ci0 date: * -1000 files: b/c (glob) |
|
330 | 335 | |/ |
|
331 | 336 | o 0 () Initial revision date: * -1000 files: a b/c (glob) |
|
332 | 337 | |
|
333 | 338 | |
|
334 | 339 | testing debugcvsps |
|
335 | 340 | |
|
336 | 341 | $ cd src |
|
337 | 342 | $ hg debugcvsps --fuzz=2 -x >/dev/null |
|
338 | 343 | |
|
339 | 344 | commit a new revision changing a and removing b/c |
|
340 | 345 | |
|
341 | 346 | $ cvscall -q update -A |
|
342 | 347 | U a |
|
343 | 348 | U b/c |
|
344 | 349 | $ sleep 1 |
|
345 | 350 | $ echo h >> a |
|
346 | 351 | $ cvscall -Q remove -f b/c |
|
347 | 352 | $ cvscall -q commit -mci | grep '<--' |
|
348 | 353 | $TESTTMP/cvsrepo/src/a,v <-- a |
|
349 | 354 | $TESTTMP/cvsrepo/src/b/c,v <-- *c (glob) |
|
350 | 355 | |
|
351 | 356 | update and verify the cvsps cache |
|
352 | 357 | |
|
353 | 358 | $ hg debugcvsps --fuzz=2 -u |
|
354 | 359 | collecting CVS rlog |
|
355 | 360 | 13 log entries |
|
356 | 361 | cvslog hook: 13 entries |
|
357 | 362 | creating changesets |
|
358 | 363 | 11 changeset entries |
|
359 | 364 | cvschangesets hook: 11 changesets |
|
360 | 365 | --------------------- |
|
361 | 366 | PatchSet 1 |
|
362 | 367 | Date: * (glob) |
|
363 | 368 | Author: * (glob) |
|
364 | 369 | Branch: HEAD |
|
365 | 370 | Tag: (none) |
|
366 | 371 | Branchpoints: INITIAL |
|
367 | 372 | Log: |
|
368 | 373 | Initial revision |
|
369 | 374 | |
|
370 | 375 | Members: |
|
371 | 376 | a:INITIAL->1.1 |
|
372 | 377 | |
|
373 | 378 | --------------------- |
|
374 | 379 | PatchSet 2 |
|
375 | 380 | Date: * (glob) |
|
376 | 381 | Author: * (glob) |
|
377 | 382 | Branch: HEAD |
|
378 | 383 | Tag: (none) |
|
379 | 384 | Branchpoints: INITIAL, branch |
|
380 | 385 | Log: |
|
381 | 386 | Initial revision |
|
382 | 387 | |
|
383 | 388 | Members: |
|
384 | 389 | b/c:INITIAL->1.1 |
|
385 | 390 | |
|
386 | 391 | --------------------- |
|
387 | 392 | PatchSet 3 |
|
388 | 393 | Date: * (glob) |
|
389 | 394 | Author: * (glob) |
|
390 | 395 | Branch: INITIAL |
|
391 | 396 | Tag: start |
|
392 | 397 | Log: |
|
393 | 398 | import |
|
394 | 399 | |
|
395 | 400 | Members: |
|
396 | 401 | a:1.1->1.1.1.1 |
|
397 | 402 | b/c:1.1->1.1.1.1 |
|
398 | 403 | |
|
399 | 404 | --------------------- |
|
400 | 405 | PatchSet 4 |
|
401 | 406 | Date: * (glob) |
|
402 | 407 | Author: * (glob) |
|
403 | 408 | Branch: HEAD |
|
404 | 409 | Tag: (none) |
|
405 | 410 | Log: |
|
406 | 411 | ci0 |
|
407 | 412 | |
|
408 | 413 | Members: |
|
409 | 414 | b/c:1.1->1.2 |
|
410 | 415 | |
|
411 | 416 | --------------------- |
|
412 | 417 | PatchSet 5 |
|
413 | 418 | Date: * (glob) |
|
414 | 419 | Author: * (glob) |
|
415 | 420 | Branch: HEAD |
|
416 | 421 | Tag: (none) |
|
417 | 422 | Branchpoints: branch |
|
418 | 423 | Log: |
|
419 | 424 | ci1 |
|
420 | 425 | |
|
421 | 426 | Members: |
|
422 | 427 | a:1.1->1.2 |
|
423 | 428 | |
|
424 | 429 | --------------------- |
|
425 | 430 | PatchSet 6 |
|
426 | 431 | Date: * (glob) |
|
427 | 432 | Author: * (glob) |
|
428 | 433 | Branch: HEAD |
|
429 | 434 | Tag: (none) |
|
430 | 435 | Log: |
|
431 | 436 | ci1 |
|
432 | 437 | |
|
433 | 438 | Members: |
|
434 | 439 | b/c:1.2->1.3 |
|
435 | 440 | |
|
436 | 441 | --------------------- |
|
437 | 442 | PatchSet 7 |
|
438 | 443 | Date: * (glob) |
|
439 | 444 | Author: * (glob) |
|
440 | 445 | Branch: branch |
|
441 | 446 | Tag: (none) |
|
442 | 447 | Log: |
|
443 | 448 | ci2 |
|
444 | 449 | |
|
445 | 450 | Members: |
|
446 | 451 | b/c:1.1->1.1.2.1 |
|
447 | 452 | |
|
448 | 453 | --------------------- |
|
449 | 454 | PatchSet 8 |
|
450 | 455 | Date: * (glob) |
|
451 | 456 | Author: * (glob) |
|
452 | 457 | Branch: branch |
|
453 | 458 | Tag: (none) |
|
454 | 459 | Log: |
|
455 | 460 | funny |
|
456 | 461 | ---------------------------- |
|
457 | 462 | log message |
|
458 | 463 | |
|
459 | 464 | Members: |
|
460 | 465 | a:1.2->1.2.2.1 |
|
461 | 466 | |
|
462 | 467 | --------------------- |
|
463 | 468 | PatchSet 9 |
|
464 | 469 | Date: * (glob) |
|
465 | 470 | Author: * (glob) |
|
466 | 471 | Branch: branch |
|
467 | 472 | Tag: (none) |
|
468 | 473 | Log: |
|
469 | 474 | fuzzy |
|
470 | 475 | |
|
471 | 476 | Members: |
|
472 | 477 | a:1.2.2.1->1.2.2.2 |
|
473 | 478 | |
|
474 | 479 | --------------------- |
|
475 | 480 | PatchSet 10 |
|
476 | 481 | Date: * (glob) |
|
477 | 482 | Author: * (glob) |
|
478 | 483 | Branch: branch |
|
479 | 484 | Tag: (none) |
|
480 | 485 | Log: |
|
481 | 486 | fuzzy |
|
482 | 487 | |
|
483 | 488 | Members: |
|
484 | 489 | b/c:1.1.2.1->1.1.2.2 |
|
485 | 490 | |
|
486 | 491 | --------------------- |
|
487 | 492 | PatchSet 11 |
|
488 | 493 | Date: * (glob) |
|
489 | 494 | Author: * (glob) |
|
490 | 495 | Branch: HEAD |
|
491 | 496 | Tag: (none) |
|
492 | 497 | Log: |
|
493 | 498 | ci |
|
494 | 499 | |
|
495 | 500 | Members: |
|
496 | 501 | a:1.2->1.3 |
|
497 | 502 | b/c:1.3->1.4(DEAD) |
|
498 | 503 | |
|
499 | 504 | |
|
500 | 505 | $ cd .. |
|
501 | 506 | |
|
502 | 507 | Test transcoding CVS log messages (issue5597) |
|
503 | 508 | ============================================= |
|
504 | 509 | |
|
505 | 510 | To emulate commit messages in (non-ascii) multiple encodings portably, |
|
506 | 511 | this test scenario writes CVS history file (*,v file) directly via |
|
507 | 512 | python code. |
|
508 | 513 | |
|
509 | 514 | Commit messages of version 1.2 - 1.4 use u3042 in 3 encodings below. |
|
510 | 515 | |
|
511 | 516 | |encoding |byte sequence | decodable as: | |
|
512 | 517 | | | | utf-8 euc-jp cp932 | |
|
513 | 518 | +----------+--------------+--------------------+ |
|
514 | 519 | |utf-8 |\xe3\x81\x82 | o x x | |
|
515 | 520 | |euc-jp |\xa4\xa2 | x o o | |
|
516 | 521 | |cp932 |\x82\xa0 | x x o | |
|
517 | 522 | |
|
518 | 523 | $ mkdir -p cvsrepo/transcoding |
|
519 | 524 | $ python <<EOF |
|
520 | 525 | > fp = open('cvsrepo/transcoding/file,v', 'w') |
|
521 | 526 | > fp.write((''' |
|
522 | 527 | > head 1.4; |
|
523 | 528 | > access; |
|
524 | 529 | > symbols |
|
525 | 530 | > start:1.1.1.1 INITIAL:1.1.1; |
|
526 | 531 | > locks; strict; |
|
527 | 532 | > comment @# @; |
|
528 | 533 | > |
|
529 | 534 | > |
|
530 | 535 | > 1.4 |
|
531 | 536 | > date 2017.07.10.00.00.04; author nobody; state Exp; |
|
532 | 537 | > branches; |
|
533 | 538 | > next 1.3; |
|
534 | 539 | > commitid 10059635D016A510FFA; |
|
535 | 540 | > |
|
536 | 541 | > 1.3 |
|
537 | 542 | > date 2017.07.10.00.00.03; author nobody; state Exp; |
|
538 | 543 | > branches; |
|
539 | 544 | > next 1.2; |
|
540 | 545 | > commitid 10059635CFF6A4FF34E; |
|
541 | 546 | > |
|
542 | 547 | > 1.2 |
|
543 | 548 | > date 2017.07.10.00.00.02; author nobody; state Exp; |
|
544 | 549 | > branches; |
|
545 | 550 | > next 1.1; |
|
546 | 551 | > commitid 10059635CFD6A4D5095; |
|
547 | 552 | > |
|
548 | 553 | > 1.1 |
|
549 | 554 | > date 2017.07.10.00.00.01; author nobody; state Exp; |
|
550 | 555 | > branches |
|
551 | 556 | > 1.1.1.1; |
|
552 | 557 | > next ; |
|
553 | 558 | > commitid 10059635CFB6A4A3C33; |
|
554 | 559 | > |
|
555 | 560 | > 1.1.1.1 |
|
556 | 561 | > date 2017.07.10.00.00.01; author nobody; state Exp; |
|
557 | 562 | > branches; |
|
558 | 563 | > next ; |
|
559 | 564 | > commitid 10059635CFB6A4A3C33; |
|
560 | 565 | > |
|
561 | 566 | > |
|
562 | 567 | > desc |
|
563 | 568 | > @@ |
|
564 | 569 | > |
|
565 | 570 | > |
|
566 | 571 | > 1.4 |
|
567 | 572 | > log |
|
568 | 573 | > @''' + u'\u3042'.encode('cp932') + ''' (cp932) |
|
569 | 574 | > @ |
|
570 | 575 | > text |
|
571 | 576 | > @1 |
|
572 | 577 | > 2 |
|
573 | 578 | > 3 |
|
574 | 579 | > 4 |
|
575 | 580 | > @ |
|
576 | 581 | > |
|
577 | 582 | > |
|
578 | 583 | > 1.3 |
|
579 | 584 | > log |
|
580 | 585 | > @''' + u'\u3042'.encode('euc-jp') + ''' (euc-jp) |
|
581 | 586 | > @ |
|
582 | 587 | > text |
|
583 | 588 | > @d4 1 |
|
584 | 589 | > @ |
|
585 | 590 | > |
|
586 | 591 | > |
|
587 | 592 | > 1.2 |
|
588 | 593 | > log |
|
589 | 594 | > @''' + u'\u3042'.encode('utf-8') + ''' (utf-8) |
|
590 | 595 | > @ |
|
591 | 596 | > text |
|
592 | 597 | > @d3 1 |
|
593 | 598 | > @ |
|
594 | 599 | > |
|
595 | 600 | > |
|
596 | 601 | > 1.1 |
|
597 | 602 | > log |
|
598 | 603 | > @Initial revision |
|
599 | 604 | > @ |
|
600 | 605 | > text |
|
601 | 606 | > @d2 1 |
|
602 | 607 | > @ |
|
603 | 608 | > |
|
604 | 609 | > |
|
605 | 610 | > 1.1.1.1 |
|
606 | 611 | > log |
|
607 | 612 | > @import |
|
608 | 613 | > @ |
|
609 | 614 | > text |
|
610 | 615 | > @@ |
|
611 | 616 | > ''').lstrip()) |
|
612 | 617 | > EOF |
|
613 | 618 | |
|
614 | 619 | $ cvscall -q checkout transcoding |
|
615 | 620 | U transcoding/file |
|
616 | 621 | |
|
617 | 622 | Test converting in normal case |
|
618 | 623 | ------------------------------ |
|
619 | 624 | |
|
620 | 625 | (filtering by grep in order to check only form of debug messages) |
|
621 | 626 | |
|
622 | 627 | $ hg convert --config convert.cvsps.logencoding=utf-8,euc-jp,cp932 -q --debug transcoding transcoding-hg | grep 'transcoding by' |
|
623 | 628 | transcoding by utf-8: 1.1 of file |
|
624 | 629 | transcoding by utf-8: 1.1.1.1 of file |
|
625 | 630 | transcoding by utf-8: 1.2 of file |
|
626 | 631 | transcoding by euc-jp: 1.3 of file |
|
627 | 632 | transcoding by cp932: 1.4 of file |
|
628 | 633 | $ hg -R transcoding-hg --encoding utf-8 log -T "{rev}: {desc}\n" |
|
629 | 634 | 5: update tags |
|
630 | 635 | 4: import |
|
631 | 636 | 3: \xe3\x81\x82 (cp932) (esc) |
|
632 | 637 | 2: \xe3\x81\x82 (euc-jp) (esc) |
|
633 | 638 | 1: \xe3\x81\x82 (utf-8) (esc) |
|
634 | 639 | 0: Initial revision |
|
635 | 640 | $ rm -rf transcoding-hg |
|
636 | 641 | |
|
637 | 642 | Test converting in error cases |
|
638 | 643 | ------------------------------ |
|
639 | 644 | |
|
640 | 645 | unknown encoding in convert.cvsps.logencoding |
|
641 | 646 | |
|
642 | 647 | $ hg convert --config convert.cvsps.logencoding=foobar -q transcoding transcoding-hg |
|
643 | 648 | abort: unknown encoding: foobar |
|
644 | 649 | (check convert.cvsps.logencoding configuration) |
|
645 | 650 | [255] |
|
646 | 651 | $ rm -rf transcoding-hg |
|
647 | 652 | |
|
648 | 653 | no acceptable encoding in convert.cvsps.logencoding |
|
649 | 654 | |
|
650 | 655 | $ hg convert --config convert.cvsps.logencoding=utf-8,euc-jp -q transcoding transcoding-hg |
|
651 | 656 | abort: no encoding can transcode CVS log message for 1.4 of file |
|
652 | 657 | (check convert.cvsps.logencoding configuration) |
|
653 | 658 | [255] |
|
654 | 659 | $ rm -rf transcoding-hg |
General Comments 0
You need to be logged in to leave comments.
Login now