# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1397502629 14400 # Node ID ff71b83a4bbe245c38069bfda902da776794d5f5 # Parent 06100fbc05e54ed97d34f0df3fe6018826d4e43d 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. diff -r 06100fbc05e5 -r ff71b83a4bbe hgext/evolve.py --- 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()