Skip to content
Snippets Groups Projects
Commit 68f7129a authored by Matthew Turk's avatar Matthew Turk
Browse files

churn: split email aliases from the right

This splits churn email aliases from the right, to enable incorrectly-specified
addresses that include equal signs to be mapped to correct addresses.  This
will enable aliasing of bad addresses (typically typos) such as:

sername=myusername

that appear in the churn output through a churn alias such as:

sername=myusername = myusername

whereas previously splitting from the left would not enable this behavior.
parent f3393d45
No related branches found
No related tags found
No related merge requests found
......@@ -121,6 +121,7 @@
Such a file may be specified with the --aliases option, otherwise
a .hgchurn file will be looked for in the working directory root.
Aliases will be split from the rightmost "=".
'''
def pad(s, l):
return (s + " " * l)[:l]
......@@ -132,7 +133,7 @@
if aliases:
for l in open(aliases, "r"):
try:
alias, actual = l.split('=' in l and '=' or None, 1)
alias, actual = l.rsplit('=' in l and '=' or None, 1)
amap[alias.strip()] = actual.strip()
except ValueError:
l = l.strip()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment