From 4d1a21a4a72285c22d1e53f3a9058d431e039af6 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 30 Apr 2009 12:46:54 -0700 Subject: [PATCH] Deal with hg authors missing email attributes. --- git_handler.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/git_handler.py b/git_handler.py index ab627fe4b6..1c8c883d91 100644 --- a/git_handler.py +++ b/git_handler.py @@ -194,7 +194,12 @@ class GitHandler(object): 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 + ' ' + commit['author'] = author + ' ' + str(int(time)) + ' ' + seconds_to_offset(timezone) message = ctx.description() commit['message'] = ctx.description()