changeset 68:d28d3763eda3

Deal with hg authors missing email attributes.
author Chris Wanstrath <chris@ozmm.org>
date Thu, 30 Apr 2009 12:46:54 -0700
parents a061dce264b7
children 983c2792f8d8
files git_handler.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/git_handler.py
+++ b/git_handler.py
@@ -194,7 +194,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()