# HG changeset patch # User Pierre-Yves David # Date 1325124561 -3600 # Node ID 06fe05256a796299d955348198480a9f59fbc493 # Parent 438fe133b06833740c1d274b2dcb0c6201ff429a edit option \o/ diff -r 438fe133b068 -r 06fe05256a79 hgext/evolution.py --- a/hgext/evolution.py Wed Dec 28 13:10:24 2011 +0100 +++ b/hgext/evolution.py Thu Dec 29 03:09:21 2011 +0100 @@ -90,6 +90,8 @@ else: message = old.description() + + new = context.memctx(repo, parents=newbases, text=message, @@ -98,6 +100,9 @@ user=commitopts.get('user') or None, date=commitopts.get('date') or None, extra=commitopts.get('extra') or None) + + if commitopts.get('edit'): + new._text = cmdutil.commitforceeditor(repo, new, []) newid = repo.commitctx(new) new = repo[newid] @@ -276,8 +281,6 @@ ciopts.pop('logfile', None) ciopts['message'] = opts.get('note') or ('amends %s' % old.hex()) e = cmdutil.commiteditor - if ciopts.get('edit'): - e = cmdutil.commitforceeditor def commitfunc(ui, repo, message, match, opts): return repo.commit(message, opts.get('user'), opts.get('date'), match, editor=e) @@ -289,11 +292,13 @@ updatenodes = set(cl.nodesbetween(roots=[old.node()], heads=[head.node()])[0]) updatenodes.remove(old.node()) - if not updatenodes and not (opts.get('message') or opts.get('logfile')): + if not updatenodes and not (opts.get('message') or opts.get('logfile') or opts.get('edit')): raise error.Abort(_('no updates found')) updates = [repo[n] for n in updatenodes] # perform amend + if opts.get('edit'): + opts['force_editor'] = True newid = rewrite(repo, old, updates, head, [old.p1().node(), old.p2().node()], opts)