##// END OF EJS Templates
convert/bzr: handle Bazaar timestamps correctly (issue1652).
Greg Ward -
r8305:7a0fcdd3 default
parent child Browse files
Show More
@@ -110,8 +110,7 b' class bzr_source(converter_source):'
110 self._parentids[version] = parents
110 self._parentids[version] = parents
111
111
112 return commit(parents=parents,
112 return commit(parents=parents,
113 # bzr uses 1 second timezone precision
113 date='%d %d' % (rev.timestamp, -rev.timezone),
114 date='%d %d' % (rev.timestamp, rev.timezone / 3600),
115 author=self.recode(rev.committer),
114 author=self.recode(rev.committer),
116 # bzr returns bytestrings or unicode, depending on the content
115 # bzr returns bytestrings or unicode, depending on the content
117 desc=self.recode(rev.message),
116 desc=self.recode(rev.message),
@@ -33,6 +33,26 b' exclude a'
33 EOF
33 EOF
34 hg convert --filemap filemap source source-filemap-hg
34 hg convert --filemap filemap source source-filemap-hg
35 hg -R source-filemap-hg manifest -r tip
35 hg -R source-filemap-hg manifest -r tip
36
37 # extract timestamps that look just like hg's {date|isodate}:
38 # yyyy-mm-dd HH:MM zzzz (no seconds!)
39 echo "% compare timestamps"
40 cd source
41 bzr log | \
42 awk -F'[ :]' '$1 == "timestamp" { printf "%s %s:%s %s\n", $4, $5, $6, $8 }' \
43 > ../bzr-timestamps
44 cd ..
45
46 hg -R source-hg log --template "{date|isodate}\n" > hg-timestamps
47 if diff -q bzr-timestamps hg-timestamps ; then
48 echo "good: hg timestamps match bzr timestamps"
49 else
50 echo "fail: bzr timestamps are:"
51 cat bzr-timestamps
52 echo "but hg timestamps are:"
53 cat hg-timestamps
54 fi
55
36 cd ..
56 cd ..
37
57
38 echo % merge
58 echo % merge
@@ -35,6 +35,8 b' 0 rename a into b, create a, rename c in'
35 b
35 b
36 d
36 d
37 f
37 f
38 % compare timestamps
39 good: hg timestamps match bzr timestamps
38 % merge
40 % merge
39 initializing destination source-hg repository
41 initializing destination source-hg repository
40 scanning source...
42 scanning source...
General Comments 0
You need to be logged in to leave comments. Login now