Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/cmdutil.py @ 3069:bc3fe3b5b785
Never apply string formatting to generated errors with util.Abort.
Otherwise error messages containing % chars yield errors or worse.
Fixed (hopefully) all users of util.Abort.
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 08 Sep 2006 09:36:18 +0200 |
parents | ff3ea21a981a |
children | eeaf9bcdfa25 |
comparison
equal
deleted
inserted
replaced
3068:547d1a4aa105 | 3069:bc3fe3b5b785 |
---|---|
51 c = expander[c]() | 51 c = expander[c]() |
52 newname.append(c) | 52 newname.append(c) |
53 i += 1 | 53 i += 1 |
54 return ''.join(newname) | 54 return ''.join(newname) |
55 except KeyError, inst: | 55 except KeyError, inst: |
56 raise util.Abort(_("invalid format spec '%%%s' in output file name"), | 56 raise util.Abort(_("invalid format spec '%%%s' in output file name") % |
57 inst.args[0]) | 57 inst.args[0]) |
58 | 58 |
59 def make_file(repo, pat, node=None, | 59 def make_file(repo, pat, node=None, |
60 total=None, seqno=None, revwidth=None, mode='wb', pathname=None): | 60 total=None, seqno=None, revwidth=None, mode='wb', pathname=None): |
61 if not pat or pat == '-': | 61 if not pat or pat == '-': |
62 return 'w' in mode and sys.stdout or sys.stdin | 62 return 'w' in mode and sys.stdout or sys.stdin |