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