Mercurial > public > mercurial-scm > hg-stable
diff mercurial/commands.py @ 8407:223000a687b0
commit: move commit editor to cmdutil, pass as function
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Thu, 14 May 2009 13:20:40 -0500 |
parents | 613ac2856535 |
children | 72538f1909ec |
line wrap: on
line diff
--- a/mercurial/commands.py Thu May 14 13:20:40 2009 -0500 +++ b/mercurial/commands.py Thu May 14 13:20:40 2009 -0500 @@ -642,10 +642,13 @@ extra = {} if opts.get('close_branch'): extra['close'] = 1 + e = cmdutil.commiteditor + if opts.get('force_editor'): + e = cmdutil.commitforceeditor + def commitfunc(ui, repo, message, match, opts): return repo.commit(match.files(), message, opts.get('user'), - opts.get('date'), match, force_editor=opts.get('force_editor'), - extra=extra) + opts.get('date'), match, editor=e, extra=extra) node = cmdutil.commit(ui, repo, commitfunc, pats, opts) if not node: @@ -1741,7 +1744,8 @@ files = patch.updatedir(ui, repo, files, similarity=sim/100.) if not opts.get('no_commit'): n = repo.commit(files, message, opts.get('user') or user, - opts.get('date') or date) + opts.get('date') or date, + editor=cmdutil.commiteditor) if opts.get('exact'): if hex(n) != nodeid: repo.rollback()