Show More
@@ -1389,6 +1389,7 b' PROPNAME="$4"' | |||||
1389 | ACTION="$5" |
|
1389 | ACTION="$5" | |
1390 |
|
1390 | |||
1391 | if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi |
|
1391 | if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi | |
|
1392 | if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:date" ]; then exit 0; fi | |||
1392 | if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi |
|
1393 | if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi | |
1393 | if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi |
|
1394 | if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi | |
1394 |
|
1395 | |||
@@ -1636,6 +1637,9 b' class svn_sink(converter_sink, commandli' | |||||
1636 | fp = os.fdopen(fd, 'wb') |
|
1637 | fp = os.fdopen(fd, 'wb') | |
1637 | fp.write(util.tonativeeol(commit.desc)) |
|
1638 | fp.write(util.tonativeeol(commit.desc)) | |
1638 | fp.close() |
|
1639 | fp.close() | |
|
1640 | # Subverson always uses UTC to represent date and time | |||
|
1641 | date = dateutil.parsedate(commit.date) | |||
|
1642 | svndate = dateutil.datestr((date[0], 0), b'%Y-%m-%dT%H:%M:%S.000000Z') | |||
1639 | try: |
|
1643 | try: | |
1640 | output = self.run0( |
|
1644 | output = self.run0( | |
1641 | b'commit', |
|
1645 | b'commit', | |
@@ -1667,6 +1671,14 b' class svn_sink(converter_sink, commandli' | |||||
1667 | revprop=True, |
|
1671 | revprop=True, | |
1668 | revision=rev, |
|
1672 | revision=rev, | |
1669 | ) |
|
1673 | ) | |
|
1674 | # The only way to set date and time for svn commit is to use propset after commit is done | |||
|
1675 | self.run( | |||
|
1676 | b'propset', | |||
|
1677 | b'svn:date', | |||
|
1678 | svndate, | |||
|
1679 | revprop=True, | |||
|
1680 | revision=rev, | |||
|
1681 | ) | |||
1670 | for parent in parents: |
|
1682 | for parent in parents: | |
1671 | self.addchild(parent, rev) |
|
1683 | self.addchild(parent, rev) | |
1672 | return self.revid(rev) |
|
1684 | return self.revid(rev) |
@@ -15,6 +15,7 b' def parseentry(entry):' | |||||
15 | e['revision'] = entry.getAttribute('revision') |
|
15 | e['revision'] = entry.getAttribute('revision') | |
16 | e['author'] = xmltext(entry.getElementsByTagName('author')[0]) |
|
16 | e['author'] = xmltext(entry.getElementsByTagName('author')[0]) | |
17 | e['msg'] = xmltext(entry.getElementsByTagName('msg')[0]) |
|
17 | e['msg'] = xmltext(entry.getElementsByTagName('msg')[0]) | |
|
18 | e['date'] = xmltext(entry.getElementsByTagName('date')[0]) | |||
18 | e['paths'] = [] |
|
19 | e['paths'] = [] | |
19 | paths = entry.getElementsByTagName('paths') |
|
20 | paths = entry.getElementsByTagName('paths') | |
20 | if paths: |
|
21 | if paths: | |
@@ -42,7 +43,7 b' def printentries(entries):' | |||||
42 | except AttributeError: |
|
43 | except AttributeError: | |
43 | fp = sys.stdout |
|
44 | fp = sys.stdout | |
44 | for e in entries: |
|
45 | for e in entries: | |
45 | for k in ('revision', 'author', 'msg'): |
|
46 | for k in ('revision', 'author', 'date', 'msg'): | |
46 | fp.write(('%s: %s\n' % (k, e[k])).encode('utf-8')) |
|
47 | fp.write(('%s: %s\n' % (k, e[k])).encode('utf-8')) | |
47 | for path, action, fpath, frev in sorted(e['paths']): |
|
48 | for path, action, fpath, frev in sorted(e['paths']): | |
48 | frominfo = b'' |
|
49 | frominfo = b'' |
@@ -24,6 +24,7 b'' | |||||
24 | > ACTION="$5" |
|
24 | > ACTION="$5" | |
25 | > |
|
25 | > | |
26 | > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi |
|
26 | > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi | |
|
27 | > if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:date" ]; then exit 0; fi | |||
27 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi |
|
28 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-branch" ]; then exit 0; fi | |
28 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi |
|
29 | > if [ "$ACTION" = "A" -a "$PROPNAME" = "hg:convert-rev" ]; then exit 0; fi | |
29 | > |
|
30 | > |
@@ -54,10 +54,12 b' Modify' | |||||
54 | 2 2 test a |
|
54 | 2 2 test a | |
55 | revision: 2 |
|
55 | revision: 2 | |
56 | author: test |
|
56 | author: test | |
|
57 | date: 1970-01-01T00:00:01.000000Z | |||
57 | msg: modify a file |
|
58 | msg: modify a file | |
58 | M /a |
|
59 | M /a | |
59 | revision: 1 |
|
60 | revision: 1 | |
60 | author: test |
|
61 | author: test | |
|
62 | date: 1970-01-01T00:00:00.000000Z | |||
61 | msg: add a file |
|
63 | msg: add a file | |
62 | A /a |
|
64 | A /a | |
63 | A /d1 |
|
65 | A /d1 | |
@@ -95,6 +97,7 b' Rename' | |||||
95 | 3 3 test b |
|
97 | 3 3 test b | |
96 | revision: 3 |
|
98 | revision: 3 | |
97 | author: test |
|
99 | author: test | |
|
100 | date: 1970-01-01T00:00:02.000000Z | |||
98 | msg: rename a file |
|
101 | msg: rename a file | |
99 | D /a |
|
102 | D /a | |
100 | A /b (from /a@2) |
|
103 | A /b (from /a@2) | |
@@ -131,6 +134,7 b' Copy' | |||||
131 | 4 4 test c |
|
134 | 4 4 test c | |
132 | revision: 4 |
|
135 | revision: 4 | |
133 | author: test |
|
136 | author: test | |
|
137 | date: 1970-01-01T00:00:03.000000Z | |||
134 | msg: copy a file |
|
138 | msg: copy a file | |
135 | A /c (from /b@3) |
|
139 | A /c (from /b@3) | |
136 | $ ls a a-hg-wc |
|
140 | $ ls a a-hg-wc | |
@@ -167,6 +171,7 b' Remove' | |||||
167 | 5 5 test . |
|
171 | 5 5 test . | |
168 | revision: 5 |
|
172 | revision: 5 | |
169 | author: test |
|
173 | author: test | |
|
174 | date: 1970-01-01T00:00:04.000000Z | |||
170 | msg: remove a file |
|
175 | msg: remove a file | |
171 | D /b |
|
176 | D /b | |
172 | $ ls a a-hg-wc |
|
177 | $ ls a a-hg-wc | |
@@ -209,6 +214,7 b' Executable' | |||||
209 | 6 6 test c |
|
214 | 6 6 test c | |
210 | revision: 6 |
|
215 | revision: 6 | |
211 | author: test |
|
216 | author: test | |
|
217 | date: 1970-01-01T00:00:05.000000Z | |||
212 | msg: make a file executable |
|
218 | msg: make a file executable | |
213 | M /c |
|
219 | M /c | |
214 | #if execbit |
|
220 | #if execbit | |
@@ -247,6 +253,7 b' Symlinks' | |||||
247 | 8 8 test newlink |
|
253 | 8 8 test newlink | |
248 | revision: 8 |
|
254 | revision: 8 | |
249 | author: test |
|
255 | author: test | |
|
256 | date: 1970-01-01T00:00:00.000000Z | |||
250 | msg: move symlink |
|
257 | msg: move symlink | |
251 | D /link |
|
258 | D /link | |
252 | A /newlink (from /link@7) |
|
259 | A /newlink (from /link@7) | |
@@ -278,6 +285,7 b' Convert with --full adds and removes fil' | |||||
278 | 7 7 test f |
|
285 | 7 7 test f | |
279 | revision: 7 |
|
286 | revision: 7 | |
280 | author: test |
|
287 | author: test | |
|
288 | date: 1970-01-01T00:00:00.000000Z | |||
281 | msg: f |
|
289 | msg: f | |
282 | D /c |
|
290 | D /c | |
283 | A /d |
|
291 | A /d | |
@@ -315,6 +323,7 b' Executable in new directory' | |||||
315 | 1 1 test d1/a |
|
323 | 1 1 test d1/a | |
316 | revision: 1 |
|
324 | revision: 1 | |
317 | author: test |
|
325 | author: test | |
|
326 | date: 1970-01-01T00:00:00.000000Z | |||
318 | msg: add executable file in new directory |
|
327 | msg: add executable file in new directory | |
319 | A /d1 |
|
328 | A /d1 | |
320 | A /d1/a |
|
329 | A /d1/a | |
@@ -343,6 +352,7 b' Copy to new directory' | |||||
343 | 2 2 test d2/a |
|
352 | 2 2 test d2/a | |
344 | revision: 2 |
|
353 | revision: 2 | |
345 | author: test |
|
354 | author: test | |
|
355 | date: 1970-01-01T00:00:01.000000Z | |||
346 | msg: copy file to new directory |
|
356 | msg: copy file to new directory | |
347 | A /d2 |
|
357 | A /d2 | |
348 | A /d2/a (from /d1/a@1) |
|
358 | A /d2/a (from /d1/a@1) | |
@@ -416,21 +426,25 b' Expect 4 changes' | |||||
416 | 4 4 test right-2 |
|
426 | 4 4 test right-2 | |
417 | revision: 4 |
|
427 | revision: 4 | |
418 | author: test |
|
428 | author: test | |
|
429 | date: 1970-01-01T00:00:05.000000Z | |||
419 | msg: merge |
|
430 | msg: merge | |
420 | A /right-1 |
|
431 | A /right-1 | |
421 | A /right-2 |
|
432 | A /right-2 | |
422 | revision: 3 |
|
433 | revision: 3 | |
423 | author: test |
|
434 | author: test | |
|
435 | date: 1970-01-01T00:00:02.000000Z | |||
424 | msg: left-2 |
|
436 | msg: left-2 | |
425 | M /b |
|
437 | M /b | |
426 | A /left-2 |
|
438 | A /left-2 | |
427 | revision: 2 |
|
439 | revision: 2 | |
428 | author: test |
|
440 | author: test | |
|
441 | date: 1970-01-01T00:00:01.000000Z | |||
429 | msg: left-1 |
|
442 | msg: left-1 | |
430 | M /b |
|
443 | M /b | |
431 | A /left-1 |
|
444 | A /left-1 | |
432 | revision: 1 |
|
445 | revision: 1 | |
433 | author: test |
|
446 | author: test | |
|
447 | date: 1970-01-01T00:00:00.000000Z | |||
434 | msg: base |
|
448 | msg: base | |
435 | A /b |
|
449 | A /b | |
436 |
|
450 | |||
@@ -459,10 +473,12 b' Tags are not supported, but must not bre' | |||||
459 | 2 2 test .hgtags |
|
473 | 2 2 test .hgtags | |
460 | revision: 2 |
|
474 | revision: 2 | |
461 | author: test |
|
475 | author: test | |
|
476 | date: 1970-01-01T00:00:01.000000Z | |||
462 | msg: Tagged as v1.0 |
|
477 | msg: Tagged as v1.0 | |
463 | A /.hgtags |
|
478 | A /.hgtags | |
464 | revision: 1 |
|
479 | revision: 1 | |
465 | author: test |
|
480 | author: test | |
|
481 | date: 1970-01-01T00:00:00.000000Z | |||
466 | msg: Add file a |
|
482 | msg: Add file a | |
467 | A /a |
|
483 | A /a | |
468 | $ rm -rf a a-hg a-hg-wc |
|
484 | $ rm -rf a a-hg a-hg-wc | |
@@ -494,10 +510,12 b' Executable bit removal' | |||||
494 | 2 2 test exec |
|
510 | 2 2 test exec | |
495 | revision: 2 |
|
511 | revision: 2 | |
496 | author: test |
|
512 | author: test | |
|
513 | date: 1970-01-01T00:00:02.000000Z | |||
497 | msg: remove executable bit |
|
514 | msg: remove executable bit | |
498 | M /exec |
|
515 | M /exec | |
499 | revision: 1 |
|
516 | revision: 1 | |
500 | author: test |
|
517 | author: test | |
|
518 | date: 1970-01-01T00:00:01.000000Z | |||
501 | msg: create executable |
|
519 | msg: create executable | |
502 | A /exec |
|
520 | A /exec | |
503 | $ test ! -x a-hg-wc/exec |
|
521 | $ test ! -x a-hg-wc/exec | |
@@ -540,10 +558,12 b' Skipping empty commits' | |||||
540 | 2 2 test b |
|
558 | 2 2 test b | |
541 | revision: 2 |
|
559 | revision: 2 | |
542 | author: test |
|
560 | author: test | |
|
561 | date: 1970-01-01T00:00:00.000000Z | |||
543 | msg: Another change |
|
562 | msg: Another change | |
544 | A /b |
|
563 | A /b | |
545 | revision: 1 |
|
564 | revision: 1 | |
546 | author: test |
|
565 | author: test | |
|
566 | date: 1970-01-01T00:00:00.000000Z | |||
547 | msg: Some change |
|
567 | msg: Some change | |
548 | A /a |
|
568 | A /a | |
549 |
|
569 |
General Comments 0
You need to be logged in to leave comments.
Login now