@matheusbsbs / matheus-bagliano / commits / d93ed31ac4
Fork 0

Some fixes to the timezone conversion between the date of a perforce change and the git commit.

Signed-off-by: Simon Hausmann <hausmann@kde.org>

Simon Hausmann committed Jan 31, 2007 at 19:43 UTC d93ed31ac4b1f8963fa83d02aa6bf6148f86e50d
1 file changed +5 -3
contrib/fast-import/p4-fast-export.py
+5 -3
@@ -46,7 +46,7 @@ def describe(change):
46 splitted = firstLine.split(" ")
47 author = splitted[3]
48 author = author[:author.find("@")]
49 - tm = time.strptime(splitted[5] + " " + splitted[6] + time.tzname[0], "%Y/%m/%d %H:%M:%S %Z")
49 + tm = time.strptime(splitted[5] + " " + splitted[6], "%Y/%m/%d %H:%M:%S ")
50 epoch = int(time.mktime(tm))
51
52 filesSection = 0
@@ -126,6 +126,8 @@ changes.reverse()
126
127 sys.stderr.write("\n")
128
129 +tz = - time.timezone / 36
130 +
131 cnt = 1
132 for change in changes:
133 [ author, log, epoch, changedFiles, removedFiles ] = describe(change)
@@ -137,9 +139,9 @@ for change in changes:
139
140 print "commit refs/heads/master"
141 if author in users:
140 - print "committer %s %s +0000" % (users[author], epoch)
142 + print "committer %s %s %s" % (users[author], epoch, tz)
143 else:
142 - print "committer %s <a@b> %s +0000" % (author, epoch)
144 + print "committer %s <a@b> %s %s" % (author, epoch, tz)
145 print "data <<EOT"
146 for l in log:
147 print l[:len(l) - 1]