Mercurial > hg
changeset 1319:5a15df632e6a
Fix behaviour of commit.
It's now a fatal error if the option to --logfile isn't readable.
Ditto if both --message and --logfile are specified.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 22 Sep 2005 21:42:33 -0700 |
parents | 3f4f76012bc9 |
children | 5f277e73778f |
files | mercurial/commands.py |
diffstat | 1 files changed, 7 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/commands.py Thu Sep 22 21:29:02 2005 -0700 +++ b/mercurial/commands.py Thu Sep 22 21:42:33 2005 -0700 @@ -682,14 +682,19 @@ " please use -m or --message instead.\n") message = opts['message'] or opts['text'] logfile = opts['logfile'] + + if message and logfile: + raise util.Abort('options --message and --logfile are mutually ' + 'exclusive') if not message and logfile: try: if logfile == '-': message = sys.stdin.read() else: message = open(logfile).read() - except IOError, why: - ui.warn("Can't read commit message %s: %s\n" % (logfile, why)) + except IOError, inst: + raise util.Abort("can't read commit message '%s': %s" % + (logfile, inst.strerror)) if opts['addremove']: addremove(ui, repo, *pats, **opts)