diff options
author | Ionuț Arțăriși <iartarisi@suse.cz> | 2013-01-16 15:06:00 +0100 |
---|---|---|
committer | Ionuț Arțăriși <iartarisi@suse.cz> | 2013-01-16 15:06:59 +0100 |
commit | 1773f0b17ad6ebbcdb16c56bc8c70545e14d7420 (patch) | |
tree | 4791e6b67cc61e369bb8655ab674bc2f18e4886c /setup.py | |
parent | f45c20e0edfd4fe9c88fd7ba35b32293d03e87f1 (diff) | |
download | pbr-1773f0b17ad6ebbcdb16c56bc8c70545e14d7420.tar.gz |
use regexp to parse the mailmap
this also makes parse_mailmap() work with the swift .mailmap and should
be more readable
Change-Id: I3abb2a18d655e507bee5f621ebc64421d943cf0b
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -34,11 +34,12 @@ def parse_mailmap(mailmap='.mailmap'): if os.path.exists(mailmap): with open(mailmap, 'r') as fp: for l in fp: - l = l.strip() - if not l.startswith('#') and ' ' in l: - canonical_email, alias = [x for x in l.split(' ') - if x.startswith('<')] - mapping[alias] = canonical_email + try: + canonical_email, alias = re.match( + r'[^#]*?(<.+>).*(<.+>).*', l).groups() + except AttributeError: + continue + mapping[alias] = canonical_email return mapping |