propertly handle -m and -l option
diff --git a/hgext/evolution.py b/hgext/evolution.py --- a/hgext/evolution.py +++ b/hgext/evolution.py @@ -78,9 +78,19 @@ def rewrite(repo, old, updates, head, ne if path in headmf: return head.filectx(path) 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 = old.description() + new = context.memctx(repo, parents=newbases, - text=commitopts.get('message') or old.description(), + text=message, files=files, filectxfn=filectxfn, user=commitopts.get('user') or None, @@ -257,6 +267,8 @@ def amend(ui, repo, *pats, **opts): # commit current changes as update # code copied from commands.commit to avoid noisy messages ciopts = dict(opts) + ciopts.pop('message', None) + ciopts.pop('logfile', None) ciopts['message'] = opts.get('note') or ('amends %s' % old.hex()) e = cmdutil.commiteditor if ciopts.get('force_editor'): @@ -272,7 +284,7 @@ def amend(ui, repo, *pats, **opts): updatenodes = set(cl.nodesbetween(roots=[old.node()], heads=[head.node()])[0]) updatenodes.remove(old.node()) - if not updatenodes: + if not updatenodes and not (opts.get('message') or opts.get('logfile')): raise error.Abort(_('no updates found')) updates = [repo[n] for n in updatenodes]