Mercurial > hg-stable
comparison hgext/fetch.py @ 21406:288a793c3167
fetch: use "getcommiteditor()" instead of explicit editor choice
This patch also enhances "test-fetch.t", because "hg fetch" hasn't
been explicitly tested around editor invocation and '--edit' option.
author | FUJIWARA Katsunori <foozy@lares.dti.ne.jp> |
---|---|
date | Sun, 11 May 2014 00:49:35 +0900 |
parents | b1e64c6720d8 |
children | 3838b910fa6b |
comparison
equal
deleted
inserted
replaced
21405:dcf20f244c2a | 21406:288a793c3167 |
---|---|
140 if not err: | 140 if not err: |
141 # we don't translate commit messages | 141 # we don't translate commit messages |
142 message = (cmdutil.logmessage(ui, opts) or | 142 message = (cmdutil.logmessage(ui, opts) or |
143 ('Automated merge with %s' % | 143 ('Automated merge with %s' % |
144 util.removeauth(other.url()))) | 144 util.removeauth(other.url()))) |
145 editor = cmdutil.commiteditor | 145 editopt = opts.get('edit') or opts.get('force_editor') |
146 if opts.get('force_editor') or opts.get('edit'): | 146 n = repo.commit(message, opts['user'], opts['date'], |
147 editor = cmdutil.commitforceeditor | 147 editor=cmdutil.getcommiteditor(edit=editopt)) |
148 n = repo.commit(message, opts['user'], opts['date'], editor=editor) | |
149 ui.status(_('new changeset %d:%s merges remote changes ' | 148 ui.status(_('new changeset %d:%s merges remote changes ' |
150 'with local\n') % (repo.changelog.rev(n), | 149 'with local\n') % (repo.changelog.rev(n), |
151 short(n))) | 150 short(n))) |
152 | 151 |
153 return err | 152 return err |