rewrite: use cmdutil.logmessage instead of ad-hoc methods
The logic for handling the --message and --logfile options is already
in core hg in the cmdutil.logmessage function. This patch removes this
duplicate logic from Evolve and just calls the core function.
--- a/hgext/evolve.py Fri Apr 11 19:24:29 2014 -0400
+++ b/hgext/evolve.py Mon Apr 14 15:10:29 2014 -0400
@@ -753,14 +753,9 @@
copied=copied.get(path))
return mctx
raise IOError()
- if commitopts.get('message') and commitopts.get('logfile'):
- raise util.Abort(_('options --message and --logfile are mutually'
- ' exclusive'))
- if commitopts.get('logfile'):
- message= open(commitopts['logfile']).read()
- elif commitopts.get('message'):
- message = commitopts['message']
- else:
+
+ message = cmdutil.logmessage(repo.ui, commitopts)
+ if not message:
message = old.description()
user = commitopts.get('user') or old.user()