changeset 129:ed4e8c2cd016

cleanup dates handling.
author Dmitriy Taychenachev <dimichxp@gmail.com>
date Thu, 14 May 2009 20:20:48 -0700
parents 6b5925d56ecd
children 8241f16a114e
files git_handler.py
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/git_handler.py
+++ b/git_handler.py
@@ -13,7 +13,8 @@
     ShaFile,
     Tag,
     Tree,
-    hex_to_sha
+    hex_to_sha,
+    format_timezone,
     )
 
 import math
@@ -203,7 +204,7 @@
         author = ctx.user()
         if not '>' in author: # TODO : this kills losslessness - die (submodules)?
             author = author + ' <none@none>'
-        commit['author'] = author + ' ' + str(int(time)) + ' ' + seconds_to_offset(timezone)
+        commit['author'] = author + ' ' + str(int(time)) + ' ' + format_timezone(-timezone)
         message = ctx.description()
         commit['message'] = ctx.description() + "\n"
 
@@ -593,7 +594,7 @@
             extra['branch'] = hg_branch
 
         text = strip_message
-        date = datetime.datetime.fromtimestamp(commit.author_time).strftime("%Y-%m-%d %H:%M:%S")
+        date = (commit.author_time, -commit.author_timezone)
         ctx = context.memctx(self.repo, (p1, p2), text, files, getfilectx,
                              commit.author, date, extra)
         a = self.repo.commitctx(ctx)