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.
--- 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)