Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
remote-bzr: improve author sanitazion
author
Felipe Contreras
<felipe.contreras@gmail.com>
Wed, 1 May 2013 01:10:04 +0000
(20:10 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 1 May 2013 05:06:47 +0000
(22:06 -0700)
So that we don't end up with '<None>', and also synchronize it with the
one from remote-hg.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/remote-helpers/git-remote-bzr
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
c95c35f
)
diff --git
a/contrib/remote-helpers/git-remote-bzr
b/contrib/remote-helpers/git-remote-bzr
index 9fe830e3cdae5f5d24893d78e1283442806cdf7c..af46016dc9488488bbc85530618e8a61926cfb47 100755
(executable)
--- a/
contrib/remote-helpers/git-remote-bzr
+++ b/
contrib/remote-helpers/git-remote-bzr
@@
-38,6
+38,7
@@
import atexit, shutil, hashlib, urlparse, subprocess
NAME_RE = re.compile('^([^<>]+)')
AUTHOR_RE = re.compile('^([^<>]+?)? ?<([^<>]*)>$')
NAME_RE = re.compile('^([^<>]+)')
AUTHOR_RE = re.compile('^([^<>]+?)? ?<([^<>]*)>$')
+EMAIL_RE = re.compile('^([^<>]+[^ \\\t<>])?\\b(?:[ \\t<>]*?)\\b([^ \\t<>]+@[^ \\t<>]+)')
RAW_AUTHOR_RE = re.compile('^(\w+) (.+)? <(.*)> (\d+) ([+-]\d+)')
def die(msg, *args):
RAW_AUTHOR_RE = re.compile('^(\w+) (.+)? <(.*)> (\d+) ([+-]\d+)')
def die(msg, *args):
@@
-175,9
+176,19
@@
def fixup_user(user):
name = m.group(1)
mail = m.group(2).strip()
else:
name = m.group(1)
mail = m.group(2).strip()
else:
- m =
NAME
_RE.match(user)
+ m =
EMAIL
_RE.match(user)
if m:
if m:
- name = m.group(1).strip()
+ name = m.group(1)
+ mail = m.group(2)
+ else:
+ m = NAME_RE.match(user)
+ if m:
+ name = m.group(1).strip()
+
+ if not name:
+ name = 'unknown'
+ if not mail:
+ mail = 'Unknown'
return '%s <%s>' % (name, mail)
return '%s <%s>' % (name, mail)