convert-repo: Fix timezone handling
authorMatt Mackall <mpm@selenic.com>
Wed, 05 Oct 2005 17:09:51 -0700
changeset 1385 adb3de56635b
parent 1384 d729850d52fa
child 1386 a1040345fdda
convert-repo: Fix timezone handling
contrib/convert-repo
--- a/contrib/convert-repo	Wed Oct 05 10:59:42 2005 -0700
+++ b/contrib/convert-repo	Wed Oct 05 17:09:51 2005 -0700
@@ -61,16 +61,20 @@
             n,v = e.split(" ", 1)
             if n == "author":
                 p = v.split()
-                date = " ".join(p[-2:])
+                tm, tz = p[-2:]
                 author = " ".join(p[:-2])
                 if author[0] == "<": author = author[1:-1]
             if n == "committer":
                 p = v.split()
-                date = " ".join(p[-2:])
+                tm, tz = p[-2:]
                 committer = " ".join(p[:-2])
                 if committer[0] == "<": committer = committer[1:-1]
-                message += "\ncommitter: %s %s\n" % (committer, date)
+                message += "\ncommitter: %s\n" % v
             if n == "parent": parents.append(v)
+
+        tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
+        tz = int(tzs) * (int(tzh) * 3600 + int(tzm))
+        date = tm + " " + str(tz)
         return (parents, author, date, message)
 
     def gettags(self):