changeset 70:5b91477fe215

merged in defunkts changes
author Scott Chacon <schacon@gmail.com>
date Thu, 30 Apr 2009 12:57:06 -0700
parents 759ac56497e7 (current diff) 983c2792f8d8 (diff)
children 19053d11d520 11574d06ae32
files git_handler.py
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/git_handler.py
+++ b/git_handler.py
@@ -25,8 +25,10 @@
     if hours > 12:
         sign = '+'
         hours = 12 - (hours - 12)
+    elif hours > 0:
+        sign = '-'
     else:
-        sign = '-'
+        sign = ''
     return sign + str(hours).rjust(2, '0') + str(minutes).rjust(2, '0')
 
 def offset_to_seconds(offset):
@@ -191,7 +193,12 @@
         commit = {}
         commit['tree'] = tree_sha
         (time, timezone) = ctx.date()
-        commit['author'] = ctx.user() + ' ' + str(int(time)) + ' ' + seconds_to_offset(timezone)
+
+        # hg authors might not have emails
+        author = ctx.user()
+        if not '>' in author:
+            author = author + ' <none@none>'
+        commit['author'] = author + ' ' + str(int(time)) + ' ' + seconds_to_offset(timezone)
         message = ctx.description()
         commit['message'] = ctx.description()