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