mercurial/commands.py
changeset 24278 0b94b68aace9
parent 24275 e1cb460a3524
child 24306 6ddc86eedc3b
equal deleted inserted replaced
24277:22d560fe1516 24278:0b94b68aace9
  1381     ('', 'close-branch', None,
  1381     ('', 'close-branch', None,
  1382      _('mark a branch as closed, hiding it from the branch list')),
  1382      _('mark a branch as closed, hiding it from the branch list')),
  1383     ('', 'amend', None, _('amend the parent of the working dir')),
  1383     ('', 'amend', None, _('amend the parent of the working dir')),
  1384     ('s', 'secret', None, _('use the secret phase for committing')),
  1384     ('s', 'secret', None, _('use the secret phase for committing')),
  1385     ('e', 'edit', None, _('invoke editor on commit messages')),
  1385     ('e', 'edit', None, _('invoke editor on commit messages')),
       
  1386     ('i', 'interactive', None, _('use interactive mode')),
  1386     ] + walkopts + commitopts + commitopts2 + subrepoopts,
  1387     ] + walkopts + commitopts + commitopts2 + subrepoopts,
  1387     _('[OPTION]... [FILE]...'),
  1388     _('[OPTION]... [FILE]...'),
  1388     inferrepo=True)
  1389     inferrepo=True)
  1389 def commit(ui, repo, *pats, **opts):
  1390 def commit(ui, repo, *pats, **opts):
  1390     """commit the specified files or all outstanding changes
  1391     """commit the specified files or all outstanding changes
  1420 
  1421 
  1421     See :hg:`help dates` for a list of formats valid for -d/--date.
  1422     See :hg:`help dates` for a list of formats valid for -d/--date.
  1422 
  1423 
  1423     Returns 0 on success, 1 if nothing changed.
  1424     Returns 0 on success, 1 if nothing changed.
  1424     """
  1425     """
       
  1426     if opts.get('interactive'):
       
  1427         opts.pop('interactive')
       
  1428         cmdutil.dorecord(ui, repo, commit, 'commit', False, *pats, **opts)
       
  1429         return
       
  1430 
  1425     if opts.get('subrepos'):
  1431     if opts.get('subrepos'):
  1426         if opts.get('amend'):
  1432         if opts.get('amend'):
  1427             raise util.Abort(_('cannot amend with --subrepos'))
  1433             raise util.Abort(_('cannot amend with --subrepos'))
  1428         # Let --subrepos on the command line override config setting.
  1434         # Let --subrepos on the command line override config setting.
  1429         ui.setconfig('ui', 'commitsubrepos', True, 'commit')
  1435         ui.setconfig('ui', 'commitsubrepos', True, 'commit')