# HG changeset patch # User Gregory Szorc # Date 1348281593 25200 # Node ID 3fb942852b1c617226d12987e10c2d1854df7a17 # Parent 7bf60690386c90d9c1c89698184986bcbcbc1e12 Precompile Git author extra data regular expression diff -r 7bf60690386c -r 3fb942852b1c hggit/git_handler.py --- a/hggit/git_handler.py Fri Sep 21 19:36:57 2012 -0700 +++ b/hggit/git_handler.py Fri Sep 21 19:39:53 2012 -0700 @@ -33,6 +33,8 @@ RE_GIT_SANITIZE_AUTHOR = re.compile('[<>\n]') +RE_GIT_AUTHOR_EXTRA = re.compile('^(.*?)\ ext:\((.*)\) <(.*)\>$') + # Test for git:// and git+ssh:// URI. # Support several URL forms, including separating the # host and path with either a / or : (sepr) @@ -707,8 +709,7 @@ # convert extra data back to the end if ' ext:' in commit.author: - regex = re.compile('^(.*?)\ ext:\((.*)\) <(.*)\>$') - m = regex.match(commit.author) + m = RE_GIT_AUTHOR_EXTRA.match(commit.author) if m: name = m.group(1) ex = urllib.unquote(m.group(2))