mercurial/commands.py
changeset 15221 269374b89b74
parent 15212 fad02a84c4ac
child 15223 fc035e5370ca
equal deleted inserted replaced
15220:f7db54b832af 15221:269374b89b74
  3183 @command('import|patch',
  3183 @command('import|patch',
  3184     [('p', 'strip', 1,
  3184     [('p', 'strip', 1,
  3185      _('directory strip option for patch. This has the same '
  3185      _('directory strip option for patch. This has the same '
  3186        'meaning as the corresponding patch option'), _('NUM')),
  3186        'meaning as the corresponding patch option'), _('NUM')),
  3187     ('b', 'base', '', _('base path (DEPRECATED)'), _('PATH')),
  3187     ('b', 'base', '', _('base path (DEPRECATED)'), _('PATH')),
       
  3188     ('e', 'edit', False, _('invoke editor on commit messages')),
  3188     ('f', 'force', None, _('skip check for outstanding uncommitted changes')),
  3189     ('f', 'force', None, _('skip check for outstanding uncommitted changes')),
  3189     ('', 'no-commit', None,
  3190     ('', 'no-commit', None,
  3190      _("don't commit, just update the working directory")),
  3191      _("don't commit, just update the working directory")),
  3191     ('', 'bypass', None,
  3192     ('', 'bypass', None,
  3192      _("apply patch without touching the working directory")),
  3193      _("apply patch without touching the working directory")),
  3261     patches = (patch1,) + patches
  3262     patches = (patch1,) + patches
  3262 
  3263 
  3263     date = opts.get('date')
  3264     date = opts.get('date')
  3264     if date:
  3265     if date:
  3265         opts['date'] = util.parsedate(date)
  3266         opts['date'] = util.parsedate(date)
       
  3267 
       
  3268     editor = cmdutil.commiteditor
       
  3269     if opts.get('edit'):
       
  3270         editor = cmdutil.commitforceeditor
  3266 
  3271 
  3267     update = not opts.get('bypass')
  3272     update = not opts.get('bypass')
  3268     if not update and opts.get('no_commit'):
  3273     if not update and opts.get('no_commit'):
  3269         raise util.Abort(_('cannot use --no-commit with --bypass'))
  3274         raise util.Abort(_('cannot use --no-commit with --bypass'))
  3270     try:
  3275     try:
  3348                         m = None
  3353                         m = None
  3349                     else:
  3354                     else:
  3350                         m = scmutil.matchfiles(repo, files or [])
  3355                         m = scmutil.matchfiles(repo, files or [])
  3351                     n = repo.commit(message, opts.get('user') or user,
  3356                     n = repo.commit(message, opts.get('user') or user,
  3352                                     opts.get('date') or date, match=m,
  3357                                     opts.get('date') or date, match=m,
  3353                                     editor=cmdutil.commiteditor)
  3358                                     editor=editor)
  3354                     checkexact(repo, n, nodeid)
  3359                     checkexact(repo, n, nodeid)
  3355             else:
  3360             else:
  3356                 if opts.get('exact') or opts.get('import_branch'):
  3361                 if opts.get('exact') or opts.get('import_branch'):
  3357                     branch = branch or 'default'
  3362                     branch = branch or 'default'
  3358                 else:
  3363                 else: