diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -3185,6 +3185,7 @@ def identify(ui, repo, source=None, rev= _('directory strip option for patch. This has the same ' 'meaning as the corresponding patch option'), _('NUM')), ('b', 'base', '', _('base path (DEPRECATED)'), _('PATH')), + ('e', 'edit', False, _('invoke editor on commit messages')), ('f', 'force', None, _('skip check for outstanding uncommitted changes')), ('', 'no-commit', None, _("don't commit, just update the working directory")), @@ -3264,6 +3265,10 @@ def import_(ui, repo, patch1, *patches, if date: opts['date'] = util.parsedate(date) + editor = cmdutil.commiteditor + if opts.get('edit'): + editor = cmdutil.commitforceeditor + update = not opts.get('bypass') if not update and opts.get('no_commit'): raise util.Abort(_('cannot use --no-commit with --bypass')) @@ -3350,7 +3355,7 @@ def import_(ui, repo, patch1, *patches, m = scmutil.matchfiles(repo, files or []) n = repo.commit(message, opts.get('user') or user, opts.get('date') or date, match=m, - editor=cmdutil.commiteditor) + editor=editor) checkexact(repo, n, nodeid) else: if opts.get('exact') or opts.get('import_branch'): diff --git a/tests/test-debugcomplete.t b/tests/test-debugcomplete.t --- a/tests/test-debugcomplete.t +++ b/tests/test-debugcomplete.t @@ -246,7 +246,7 @@ Show all commands + options heads: rev, topo, active, closed, style, template help: extension, command identify: rev, num, id, branch, tags, bookmarks - import: strip, base, force, no-commit, bypass, exact, import-branch, message, logfile, date, user, similarity + import: strip, base, edit, force, no-commit, bypass, exact, import-branch, message, logfile, date, user, similarity incoming: force, newest-first, bundle, rev, bookmarks, branch, patch, git, limit, no-merges, stat, style, template, ssh, remotecmd, insecure, subrepos locate: rev, print0, fullpath, include, exclude manifest: rev, all