Update the mkdevbranch script for new Trac location, don't clobber existing paths The script has been cleaned up, adjusted to avoid clobbering an SVN path that already exists when running it for a single sprinter login, and run with the new locations for the Trac system. This is a decently huge rewrite of the script. It's pulled a lot of logic into functions, excised the python code into its own file, etc. - Legacy-Id: 19076 Note: SVN reference [19071] has been migrated to Git commit 537b76eb76170d69036999f8a8ef20fd81caca93
22 lines
698 B
Python
22 lines
698 B
Python
import sys, re
|
|
|
|
with open("aliases") as afile:
|
|
try:
|
|
aliases = dict([line.strip().split(None, 1) for line in afile.read().splitlines() if line.strip()])
|
|
except ValueError:
|
|
sys.stderr.write([line.strip().split(None, 1) for line in afile.read().splitlines() if line.strip()])
|
|
raise
|
|
|
|
for line in sys.stdin:
|
|
try:
|
|
blank, name, email, rest = line.strip().split("||", 3)
|
|
email = email.strip()
|
|
except ValueError:
|
|
sys.stderr.write(line + "\n")
|
|
raise
|
|
|
|
login, dummy = re.split("[@.]", email, 1)
|
|
if email in aliases:
|
|
login = aliases[email]
|
|
print("\t".join((login.strip().lower(), email.strip().lower(), name.strip())))
|