churn: support spaces in aliases (issue2222)

This commit is contained in:
Alexander Solovyov 2010-06-02 14:28:45 +02:00
parent cdb00115fd
commit 06239f590d
3 changed files with 11 additions and 4 deletions

View File

@ -115,7 +115,7 @@ def churn(ui, repo, *pats, **opts):
It is possible to map alternate email addresses to a main address
by providing a file using the following format::
<alias email> <actual email>
<alias email> = <actual email>
Such a file may be specified with the --aliases option, otherwise
a .hgchurn file will be looked for in the working directory root.
@ -129,9 +129,8 @@ def churn(ui, repo, *pats, **opts):
aliases = repo.wjoin('.hgchurn')
if aliases:
for l in open(aliases, "r"):
l = l.strip()
alias, actual = l.split()
amap[alias] = actual
alias, actual = l.split('=' in l and '=' or None, 1)
amap[alias.strip()] = actual.strip()
rate = countrate(ui, repo, amap, *pats, **opts).items()
if not rate:

View File

@ -59,6 +59,12 @@ hg --config extensions.color= churn --config color.mode=ansi \
echo % changeset number churn
hg churn -c
echo 'with space = no-space' >> ../aliases
echo a >> a
hg commit -m a -u 'with space' -d 15:00
echo % churn with space in alias
hg churn --aliases ../aliases -r tip
cd ..
# issue 833: ZeroDivisionError

View File

@ -40,5 +40,7 @@ user2 +2/-0 +++++++++++++++++++++++++++
user1 4 ***************************************************************
user3 3 ***********************************************
user2 2 ********************************
% churn with space in alias
no-space 1 ************************************************************
adding foo
test 0