diff --git a/hggit/git_handler.py b/hggit/git_handler.py index 3b82cf6ac73ad8455a632516735070610eb5cd32_aGdnaXQvZ2l0X2hhbmRsZXIucHk=..6e05aa1b536da05fd0f945e98b8f1d47c5c2cd53_aGdnaXQvZ2l0X2hhbmRsZXIucHk= 100644 --- a/hggit/git_handler.py +++ b/hggit/git_handler.py @@ -29,6 +29,8 @@ import util from overlay import overlayrepo +RE_GIT_AUTHOR = re.compile('^(.*?) ?\<(.*?)(?:\>(.*))?$') + class GitProgress(object): """convert git server progress strings into mercurial progress""" def __init__(self, ui): @@ -433,7 +435,6 @@ author = ctx.user() # see if a translation exists - if author in self.author_map: - author = self.author_map[author] + author = self.author_map.get(author, author) # check for git author pattern compliance @@ -438,7 +439,6 @@ # check for git author pattern compliance - regex = re.compile('^(.*?) ?\<(.*?)(?:\>(.*))?$') - a = regex.match(author) + a = RE_GIT_AUTHOR.match(author) if a: name = self.get_valid_git_username_email(a.group(1))