diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-04-06 11:39:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-04-06 11:39:05 -0700 |
commit | 1d851b9d30f5a7d2efdda71623839dcabd27577e (patch) | |
tree | 5ca1df24ff4f7978cf920a273af8b9313133c290 /git-p4.py | |
parent | 5e533f8ffd12cdc2d20283c3900fc3561d449b82 (diff) | |
parent | 10d08a149d2295a239ac7710d32c0b77492f61c3 (diff) | |
download | git-1d851b9d30f5a7d2efdda71623839dcabd27577e.tar.gz |
Merge branch 'ls/p4-map-user'
"git p4" now allows P4 author names to be mapped to Git author
names.
* ls/p4-map-user:
git-p4: map a P4 user to Git author name and email address
Diffstat (limited to 'git-p4.py')
-rwxr-xr-x | git-p4.py | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -1160,6 +1160,15 @@ class P4UserMap: self.users[output["User"]] = output["FullName"] + " <" + output["Email"] + ">" self.emails[output["Email"]] = output["User"] + mapUserConfigRegex = re.compile(r"^\s*(\S+)\s*=\s*(.+)\s*<(\S+)>\s*$", re.VERBOSE) + for mapUserConfig in gitConfigList("git-p4.mapUser"): + mapUser = mapUserConfigRegex.findall(mapUserConfig) + if mapUser and len(mapUser[0]) == 3: + user = mapUser[0][0] + fullname = mapUser[0][1] + email = mapUser[0][2] + self.users[user] = fullname + " <" + email + ">" + self.emails[email] = user s = '' for (key, val) in self.users.items(): |