changeset 909:ff71b83a4bbe

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.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 14 Apr 2014 15:10:29 -0400
parents 06100fbc05e5
children ffce88754767
files hgext/evolve.py
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- 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()