Mercurial > hg-stable
diff hgext/churn.py @ 12069:7c3c44413bc1 stable
churn: do not crash on malformed lines in alias file
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Sun, 29 Aug 2010 22:46:00 +0200 |
parents | 2e7647d25458 |
children | fddacca3202e |
line wrap: on
line diff
--- a/hgext/churn.py Sun Aug 29 10:54:22 2010 +0200 +++ b/hgext/churn.py Sun Aug 29 22:46:00 2010 +0200 @@ -129,10 +129,14 @@ aliases = repo.wjoin('.hgchurn') if aliases: for l in open(aliases, "r"): - if not l.strip(): + try: + alias, actual = l.split('=' in l and '=' or None, 1) + amap[alias.strip()] = actual.strip() + except ValueError: + l = l.strip() + if l: + ui.warn(_("skipping malformed alias: %s\n" % l)) continue - 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: