mercurial/commands.py
changeset 40295 fa88170c10bb
parent 40293 c303d65d2e34
child 40346 943248e47864
equal deleted inserted replaced
40294:fabbf9310025 40295:fa88170c10bb
   129 subrepoopts = cmdutil.subrepoopts
   129 subrepoopts = cmdutil.subrepoopts
   130 debugrevlogopts = cmdutil.debugrevlogopts
   130 debugrevlogopts = cmdutil.debugrevlogopts
   131 
   131 
   132 # Commands start here, listed alphabetically
   132 # Commands start here, listed alphabetically
   133 
   133 
   134 @command('^add',
   134 @command('add',
   135     walkopts + subrepoopts + dryrunopts,
   135     walkopts + subrepoopts + dryrunopts,
   136     _('[OPTION]... [FILE]...'),
   136     _('[OPTION]... [FILE]...'),
   137     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
   137     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
   138     inferrepo=True)
   138     helpbasic=True, inferrepo=True)
   139 def add(ui, repo, *pats, **opts):
   139 def add(ui, repo, *pats, **opts):
   140     """add the specified files on the next commit
   140     """add the specified files on the next commit
   141 
   141 
   142     Schedule files to be version controlled and added to the
   142     Schedule files to be version controlled and added to the
   143     repository.
   143     repository.
   254     if not opts.get('similarity'):
   254     if not opts.get('similarity'):
   255         opts['similarity'] = '100'
   255         opts['similarity'] = '100'
   256     matcher = scmutil.match(repo[None], pats, opts)
   256     matcher = scmutil.match(repo[None], pats, opts)
   257     return scmutil.addremove(repo, matcher, "", opts)
   257     return scmutil.addremove(repo, matcher, "", opts)
   258 
   258 
   259 @command('^annotate|blame',
   259 @command('annotate|blame',
   260     [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
   260     [('r', 'rev', '', _('annotate the specified revision'), _('REV')),
   261     ('', 'follow', None,
   261     ('', 'follow', None,
   262      _('follow copies/renames and list the filename (DEPRECATED)')),
   262      _('follow copies/renames and list the filename (DEPRECATED)')),
   263     ('', 'no-follow', None, _("don't follow copies and renames")),
   263     ('', 'no-follow', None, _("don't follow copies and renames")),
   264     ('a', 'text', None, _('treat all files as text')),
   264     ('a', 'text', None, _('treat all files as text')),
   270     ('l', 'line-number', None, _('show line number at the first appearance')),
   270     ('l', 'line-number', None, _('show line number at the first appearance')),
   271     ('', 'skip', [], _('revision to not display (EXPERIMENTAL)'), _('REV')),
   271     ('', 'skip', [], _('revision to not display (EXPERIMENTAL)'), _('REV')),
   272     ] + diffwsopts + walkopts + formatteropts,
   272     ] + diffwsopts + walkopts + formatteropts,
   273     _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...'),
   273     _('[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...'),
   274     helpcategory=command.CATEGORY_FILE_CONTENTS,
   274     helpcategory=command.CATEGORY_FILE_CONTENTS,
   275     inferrepo=True)
   275     helpbasic=True, inferrepo=True)
   276 def annotate(ui, repo, *pats, **opts):
   276 def annotate(ui, repo, *pats, **opts):
   277     """show changeset information by line for each file
   277     """show changeset information by line for each file
   278 
   278 
   279     List changes in files, showing the revision id responsible for
   279     List changes in files, showing the revision id responsible for
   280     each line.
   280     each line.
  1397         fm = ui.formatter('cat', opts)
  1397         fm = ui.formatter('cat', opts)
  1398     with fm:
  1398     with fm:
  1399         return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '',
  1399         return cmdutil.cat(ui, repo, ctx, m, fm, fntemplate, '',
  1400                            **pycompat.strkwargs(opts))
  1400                            **pycompat.strkwargs(opts))
  1401 
  1401 
  1402 @command('^clone',
  1402 @command('clone',
  1403     [('U', 'noupdate', None, _('the clone will include an empty working '
  1403     [('U', 'noupdate', None, _('the clone will include an empty working '
  1404                                'directory (only a repository)')),
  1404                                'directory (only a repository)')),
  1405     ('u', 'updaterev', '', _('revision, tag, or branch to check out'),
  1405     ('u', 'updaterev', '', _('revision, tag, or branch to check out'),
  1406         _('REV')),
  1406         _('REV')),
  1407     ('r', 'rev', [], _('do not clone everything, but include this changeset'
  1407     ('r', 'rev', [], _('do not clone everything, but include this changeset'
  1414     ('', 'stream', None,
  1414     ('', 'stream', None,
  1415        _('clone with minimal data processing')),
  1415        _('clone with minimal data processing')),
  1416     ] + remoteopts,
  1416     ] + remoteopts,
  1417     _('[OPTION]... SOURCE [DEST]'),
  1417     _('[OPTION]... SOURCE [DEST]'),
  1418     helpcategory=command.CATEGORY_REPO_CREATION,
  1418     helpcategory=command.CATEGORY_REPO_CREATION,
  1419     norepo=True)
  1419     helpbasic=True, norepo=True)
  1420 def clone(ui, source, dest=None, **opts):
  1420 def clone(ui, source, dest=None, **opts):
  1421     """make a copy of an existing repository
  1421     """make a copy of an existing repository
  1422 
  1422 
  1423     Create a copy of an existing repository in a new directory.
  1423     Create a copy of an existing repository in a new directory.
  1424 
  1424 
  1553                  storeincludepats=includepats,
  1553                  storeincludepats=includepats,
  1554                  storeexcludepats=excludepats)
  1554                  storeexcludepats=excludepats)
  1555 
  1555 
  1556     return r is None
  1556     return r is None
  1557 
  1557 
  1558 @command('^commit|ci',
  1558 @command('commit|ci',
  1559     [('A', 'addremove', None,
  1559     [('A', 'addremove', None,
  1560      _('mark new/missing files as added/removed before committing')),
  1560      _('mark new/missing files as added/removed before committing')),
  1561     ('', 'close-branch', None,
  1561     ('', 'close-branch', None,
  1562      _('mark a branch head as closed')),
  1562      _('mark a branch head as closed')),
  1563     ('', 'amend', None, _('amend the parent of the working directory')),
  1563     ('', 'amend', None, _('amend the parent of the working directory')),
  1564     ('s', 'secret', None, _('use the secret phase for committing')),
  1564     ('s', 'secret', None, _('use the secret phase for committing')),
  1565     ('e', 'edit', None, _('invoke editor on commit messages')),
  1565     ('e', 'edit', None, _('invoke editor on commit messages')),
  1566     ('i', 'interactive', None, _('use interactive mode')),
  1566     ('i', 'interactive', None, _('use interactive mode')),
  1567     ] + walkopts + commitopts + commitopts2 + subrepoopts,
  1567     ] + walkopts + commitopts + commitopts2 + subrepoopts,
  1568     _('[OPTION]... [FILE]...'),
  1568     _('[OPTION]... [FILE]...'),
  1569     helpcategory=command.CATEGORY_COMMITTING,
  1569     helpcategory=command.CATEGORY_COMMITTING, helpbasic=True,
  1570     inferrepo=True)
  1570     inferrepo=True)
  1571 def commit(ui, repo, *pats, **opts):
  1571 def commit(ui, repo, *pats, **opts):
  1572     """commit the specified files or all outstanding changes
  1572     """commit the specified files or all outstanding changes
  1573 
  1573 
  1574     Commit changes to the given files into the repository. Unlike a
  1574     Commit changes to the given files into the repository. Unlike a
  1865     helpcategory=command.CATEGORY_HELP,
  1865     helpcategory=command.CATEGORY_HELP,
  1866     norepo=True)
  1866     norepo=True)
  1867 def debugcommands(ui, cmd='', *args):
  1867 def debugcommands(ui, cmd='', *args):
  1868     """list all available commands and options"""
  1868     """list all available commands and options"""
  1869     for cmd, vals in sorted(table.iteritems()):
  1869     for cmd, vals in sorted(table.iteritems()):
  1870         cmd = cmd.split('|')[0].strip('^')
  1870         cmd = cmd.split('|')[0]
  1871         opts = ', '.join([i[1] for i in vals[1]])
  1871         opts = ', '.join([i[1] for i in vals[1]])
  1872         ui.write('%s: %s\n' % (cmd, opts))
  1872         ui.write('%s: %s\n' % (cmd, opts))
  1873 
  1873 
  1874 @command('debugcomplete',
  1874 @command('debugcomplete',
  1875     [('o', 'options', None, _('show the command options'))],
  1875     [('o', 'options', None, _('show the command options'))],
  1898     cmdlist, unused_allcmds = cmdutil.findpossible(cmd, table)
  1898     cmdlist, unused_allcmds = cmdutil.findpossible(cmd, table)
  1899     if ui.verbose:
  1899     if ui.verbose:
  1900         cmdlist = [' '.join(c[0]) for c in cmdlist.values()]
  1900         cmdlist = [' '.join(c[0]) for c in cmdlist.values()]
  1901     ui.write("%s\n" % "\n".join(sorted(cmdlist)))
  1901     ui.write("%s\n" % "\n".join(sorted(cmdlist)))
  1902 
  1902 
  1903 @command('^diff',
  1903 @command('diff',
  1904     [('r', 'rev', [], _('revision'), _('REV')),
  1904     [('r', 'rev', [], _('revision'), _('REV')),
  1905     ('c', 'change', '', _('change made by revision'), _('REV'))
  1905     ('c', 'change', '', _('change made by revision'), _('REV'))
  1906     ] + diffopts + diffopts2 + walkopts + subrepoopts,
  1906     ] + diffopts + diffopts2 + walkopts + subrepoopts,
  1907     _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'),
  1907     _('[OPTION]... ([-c REV] | [-r REV1 [-r REV2]]) [FILE]...'),
  1908     helpcategory=command.CATEGORY_FILE_CONTENTS,
  1908     helpcategory=command.CATEGORY_FILE_CONTENTS,
  1909     inferrepo=True,
  1909     helpbasic=True, inferrepo=True, intents={INTENT_READONLY})
  1910     intents={INTENT_READONLY})
       
  1911 def diff(ui, repo, *pats, **opts):
  1910 def diff(ui, repo, *pats, **opts):
  1912     """diff repository (or selected files)
  1911     """diff repository (or selected files)
  1913 
  1912 
  1914     Show differences between revisions for the specified files.
  1913     Show differences between revisions for the specified files.
  1915 
  1914 
  1993     ui.pager('diff')
  1992     ui.pager('diff')
  1994     logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
  1993     logcmdutil.diffordiffstat(ui, repo, diffopts, node1, node2, m, stat=stat,
  1995                               listsubrepos=opts.get('subrepos'),
  1994                               listsubrepos=opts.get('subrepos'),
  1996                               root=opts.get('root'))
  1995                               root=opts.get('root'))
  1997 
  1996 
  1998 @command('^export',
  1997 @command('export',
  1999     [('B', 'bookmark', '',
  1998     [('B', 'bookmark', '',
  2000      _('export changes only reachable by given bookmark')),
  1999      _('export changes only reachable by given bookmark')),
  2001     ('o', 'output', '',
  2000     ('o', 'output', '',
  2002      _('print output to file with formatted name'), _('FORMAT')),
  2001      _('print output to file with formatted name'), _('FORMAT')),
  2003     ('', 'switch-parent', None, _('diff against the second parent')),
  2002     ('', 'switch-parent', None, _('diff against the second parent')),
  2004     ('r', 'rev', [], _('revisions to export'), _('REV')),
  2003     ('r', 'rev', [], _('revisions to export'), _('REV')),
  2005     ] + diffopts + formatteropts,
  2004     ] + diffopts + formatteropts,
  2006     _('[OPTION]... [-o OUTFILESPEC] [-r] [REV]...'),
  2005     _('[OPTION]... [-o OUTFILESPEC] [-r] [REV]...'),
  2007     helpcategory=command.CATEGORY_IMPORT_EXPORT,
  2006     helpcategory=command.CATEGORY_IMPORT_EXPORT,
  2008     intents={INTENT_READONLY})
  2007     helpbasic=True, intents={INTENT_READONLY})
  2009 def export(ui, repo, *changesets, **opts):
  2008 def export(ui, repo, *changesets, **opts):
  2010     """dump the header and diffs for one or more changesets
  2009     """dump the header and diffs for one or more changesets
  2011 
  2010 
  2012     Print the changeset header and diffs for one or more revisions.
  2011     Print the changeset header and diffs for one or more revisions.
  2013     If no revision is given, the parent of the working directory is used.
  2012     If no revision is given, the parent of the working directory is used.
  2196     ui.pager('files')
  2195     ui.pager('files')
  2197     with ui.formatter('files', opts) as fm:
  2196     with ui.formatter('files', opts) as fm:
  2198         return cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos'))
  2197         return cmdutil.files(ui, ctx, m, fm, fmt, opts.get('subrepos'))
  2199 
  2198 
  2200 @command(
  2199 @command(
  2201     '^forget',
  2200     'forget',
  2202     [('i', 'interactive', None, _('use interactive mode')),
  2201     [('i', 'interactive', None, _('use interactive mode')),
  2203     ] + walkopts + dryrunopts,
  2202     ] + walkopts + dryrunopts,
  2204     _('[OPTION]... FILE...'),
  2203     _('[OPTION]... FILE...'),
  2205     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  2204     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  2206     inferrepo=True)
  2205     helpbasic=True, inferrepo=True)
  2207 def forget(ui, repo, *pats, **opts):
  2206 def forget(ui, repo, *pats, **opts):
  2208     """forget the specified files on the next commit
  2207     """forget the specified files on the next commit
  2209 
  2208 
  2210     Mark the specified files so they will no longer be tracked
  2209     Mark the specified files so they will no longer be tracked
  2211     after the next commit.
  2210     after the next commit.
  3547         return hg.incoming(ui, repo, source, opts)
  3546         return hg.incoming(ui, repo, source, opts)
  3548     finally:
  3547     finally:
  3549         del repo._subtoppath
  3548         del repo._subtoppath
  3550 
  3549 
  3551 
  3550 
  3552 @command('^init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'),
  3551 @command('init', remoteopts, _('[-e CMD] [--remotecmd CMD] [DEST]'),
  3553         helpcategory=command.CATEGORY_REPO_CREATION,
  3552          helpcategory=command.CATEGORY_REPO_CREATION,
  3554          norepo=True)
  3553          helpbasic=True, norepo=True)
  3555 def init(ui, dest=".", **opts):
  3554 def init(ui, dest=".", **opts):
  3556     """create a new repository in the given directory
  3555     """create a new repository in the given directory
  3557 
  3556 
  3558     Initialize a new repository in the given directory. If the given
  3557     Initialize a new repository in the given directory. If the given
  3559     directory does not exist, it will be created.
  3558     directory does not exist, it will be created.
  3622             ui.write(((pats and m.rel(abs)) or abs), end)
  3621             ui.write(((pats and m.rel(abs)) or abs), end)
  3623         ret = 0
  3622         ret = 0
  3624 
  3623 
  3625     return ret
  3624     return ret
  3626 
  3625 
  3627 @command('^log|history',
  3626 @command('log|history',
  3628     [('f', 'follow', None,
  3627     [('f', 'follow', None,
  3629      _('follow changeset history, or file history across copies and renames')),
  3628      _('follow changeset history, or file history across copies and renames')),
  3630     ('', 'follow-first', None,
  3629     ('', 'follow-first', None,
  3631      _('only follow the first parent of merge changesets (DEPRECATED)')),
  3630      _('only follow the first parent of merge changesets (DEPRECATED)')),
  3632     ('d', 'date', '', _('show revisions matching date spec'), _('DATE')),
  3631     ('d', 'date', '', _('show revisions matching date spec'), _('DATE')),
  3648     ('P', 'prune', [],
  3647     ('P', 'prune', [],
  3649      _('do not display revision or any of its ancestors'), _('REV')),
  3648      _('do not display revision or any of its ancestors'), _('REV')),
  3650     ] + logopts + walkopts,
  3649     ] + logopts + walkopts,
  3651     _('[OPTION]... [FILE]'),
  3650     _('[OPTION]... [FILE]'),
  3652     helpcategory=command.CATEGORY_CHANGE_NAVIGATION,
  3651     helpcategory=command.CATEGORY_CHANGE_NAVIGATION,
  3653     inferrepo=True,
  3652     helpbasic=True, inferrepo=True,
  3654     intents={INTENT_READONLY})
  3653     intents={INTENT_READONLY})
  3655 def log(ui, repo, *pats, **opts):
  3654 def log(ui, repo, *pats, **opts):
  3656     """show revision history of entire repository or files
  3655     """show revision history of entire repository or files
  3657 
  3656 
  3658     Print the revision history of the specified files or the entire
  3657     Print the revision history of the specified files or the entire
  3876         fm.condwrite(ui.debugflag, 'hash', '%s ', hex(mf[f]))
  3875         fm.condwrite(ui.debugflag, 'hash', '%s ', hex(mf[f]))
  3877         fm.condwrite(ui.verbose, 'mode type', '%s %1s ', mode[fl], char[fl])
  3876         fm.condwrite(ui.verbose, 'mode type', '%s %1s ', mode[fl], char[fl])
  3878         fm.write('path', '%s\n', f)
  3877         fm.write('path', '%s\n', f)
  3879     fm.end()
  3878     fm.end()
  3880 
  3879 
  3881 @command('^merge',
  3880 @command('merge',
  3882     [('f', 'force', None,
  3881     [('f', 'force', None,
  3883       _('force a merge including outstanding changes (DEPRECATED)')),
  3882       _('force a merge including outstanding changes (DEPRECATED)')),
  3884     ('r', 'rev', '', _('revision to merge'), _('REV')),
  3883     ('r', 'rev', '', _('revision to merge'), _('REV')),
  3885     ('P', 'preview', None,
  3884     ('P', 'preview', None,
  3886      _('review revisions to merge (no merge is performed)')),
  3885      _('review revisions to merge (no merge is performed)')),
  3887     ('', 'abort', None, _('abort the ongoing merge')),
  3886     ('', 'abort', None, _('abort the ongoing merge')),
  3888      ] + mergetoolopts,
  3887      ] + mergetoolopts,
  3889     _('[-P] [[-r] REV]'),
  3888     _('[-P] [[-r] REV]'),
  3890     helpcategory=command.CATEGORY_CHANGE_MANAGEMENT)
  3889     helpcategory=command.CATEGORY_CHANGE_MANAGEMENT, helpbasic=True)
  3891 def merge(ui, repo, node=None, **opts):
  3890 def merge(ui, repo, node=None, **opts):
  3892     """merge another revision into working directory
  3891     """merge another revision into working directory
  3893 
  3892 
  3894     The current working directory is updated with all changes made in
  3893     The current working directory is updated with all changes made in
  3895     the requested revision since the last common predecessor revision.
  3894     the requested revision since the last common predecessor revision.
  4303         else:
  4302         else:
  4304             ui.status(_("(run 'hg heads' to see heads)\n"))
  4303             ui.status(_("(run 'hg heads' to see heads)\n"))
  4305     elif not ui.configbool('commands', 'update.requiredest'):
  4304     elif not ui.configbool('commands', 'update.requiredest'):
  4306         ui.status(_("(run 'hg update' to get a working copy)\n"))
  4305         ui.status(_("(run 'hg update' to get a working copy)\n"))
  4307 
  4306 
  4308 @command('^pull',
  4307 @command('pull',
  4309     [('u', 'update', None,
  4308     [('u', 'update', None,
  4310      _('update to new branch head if new descendants were pulled')),
  4309      _('update to new branch head if new descendants were pulled')),
  4311     ('f', 'force', None, _('run even when remote repository is unrelated')),
  4310     ('f', 'force', None, _('run even when remote repository is unrelated')),
  4312     ('r', 'rev', [], _('a remote changeset intended to be added'), _('REV')),
  4311     ('r', 'rev', [], _('a remote changeset intended to be added'), _('REV')),
  4313     ('B', 'bookmark', [], _("bookmark to pull"), _('BOOKMARK')),
  4312     ('B', 'bookmark', [], _("bookmark to pull"), _('BOOKMARK')),
  4314     ('b', 'branch', [], _('a specific branch you would like to pull'),
  4313     ('b', 'branch', [], _('a specific branch you would like to pull'),
  4315      _('BRANCH')),
  4314      _('BRANCH')),
  4316     ] + remoteopts,
  4315     ] + remoteopts,
  4317     _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]'),
  4316     _('[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]'),
  4318     helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT)
  4317     helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
       
  4318     helpbasic=True)
  4319 def pull(ui, repo, source="default", **opts):
  4319 def pull(ui, repo, source="default", **opts):
  4320     """pull changes from the specified source
  4320     """pull changes from the specified source
  4321 
  4321 
  4322     Pull changes from a remote repository to a local one.
  4322     Pull changes from a remote repository to a local one.
  4323 
  4323 
  4433 
  4433 
  4434     finally:
  4434     finally:
  4435         other.close()
  4435         other.close()
  4436     return ret
  4436     return ret
  4437 
  4437 
  4438 @command('^push',
  4438 @command('push',
  4439     [('f', 'force', None, _('force push')),
  4439     [('f', 'force', None, _('force push')),
  4440     ('r', 'rev', [],
  4440     ('r', 'rev', [],
  4441      _('a changeset intended to be included in the destination'),
  4441      _('a changeset intended to be included in the destination'),
  4442      _('REV')),
  4442      _('REV')),
  4443     ('B', 'bookmark', [], _("bookmark to push"), _('BOOKMARK')),
  4443     ('B', 'bookmark', [], _("bookmark to push"), _('BOOKMARK')),
  4445      _('a specific branch you would like to push'), _('BRANCH')),
  4445      _('a specific branch you would like to push'), _('BRANCH')),
  4446     ('', 'new-branch', False, _('allow pushing a new branch')),
  4446     ('', 'new-branch', False, _('allow pushing a new branch')),
  4447     ('', 'pushvars', [], _('variables that can be sent to server (ADVANCED)')),
  4447     ('', 'pushvars', [], _('variables that can be sent to server (ADVANCED)')),
  4448     ] + remoteopts,
  4448     ] + remoteopts,
  4449     _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'),
  4449     _('[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]'),
  4450     helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT)
  4450     helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
       
  4451     helpbasic=True)
  4451 def push(ui, repo, dest=None, **opts):
  4452 def push(ui, repo, dest=None, **opts):
  4452     """push changes to the specified destination
  4453     """push changes to the specified destination
  4453 
  4454 
  4454     Push changesets from the local repository to the specified
  4455     Push changesets from the local repository to the specified
  4455     destination.
  4456     destination.
  4587     """
  4588     """
  4588     if repo.recover():
  4589     if repo.recover():
  4589         return hg.verify(repo)
  4590         return hg.verify(repo)
  4590     return 1
  4591     return 1
  4591 
  4592 
  4592 @command('^remove|rm',
  4593 @command('remove|rm',
  4593     [('A', 'after', None, _('record delete for missing files')),
  4594     [('A', 'after', None, _('record delete for missing files')),
  4594     ('f', 'force', None,
  4595     ('f', 'force', None,
  4595      _('forget added files, delete modified files')),
  4596      _('forget added files, delete modified files')),
  4596     ] + subrepoopts + walkopts + dryrunopts,
  4597     ] + subrepoopts + walkopts + dryrunopts,
  4597     _('[OPTION]... FILE...'),
  4598     _('[OPTION]... FILE...'),
  4598     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  4599     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  4599     inferrepo=True)
  4600     helpbasic=True, inferrepo=True)
  4600 def remove(ui, repo, *pats, **opts):
  4601 def remove(ui, repo, *pats, **opts):
  4601     """remove the specified files on the next commit
  4602     """remove the specified files on the next commit
  4602 
  4603 
  4603     Schedule the indicated files for removal from the current branch.
  4604     Schedule the indicated files for removal from the current branch.
  4604 
  4605 
  5130 
  5131 
  5131     Returns 0 on success.
  5132     Returns 0 on success.
  5132     """
  5133     """
  5133     ui.write(repo.root + "\n")
  5134     ui.write(repo.root + "\n")
  5134 
  5135 
  5135 @command('^serve',
  5136 @command('serve',
  5136     [('A', 'accesslog', '', _('name of access log file to write to'),
  5137     [('A', 'accesslog', '', _('name of access log file to write to'),
  5137      _('FILE')),
  5138      _('FILE')),
  5138     ('d', 'daemon', None, _('run server in background')),
  5139     ('d', 'daemon', None, _('run server in background')),
  5139     ('', 'daemon-postexec', [], _('used internally by daemon mode')),
  5140     ('', 'daemon-postexec', [], _('used internally by daemon mode')),
  5140     ('E', 'errorlog', '', _('name of error log file to write to'), _('FILE')),
  5141     ('E', 'errorlog', '', _('name of error log file to write to'), _('FILE')),
  5159     ('', 'certificate', '', _('SSL certificate file'), _('FILE')),
  5160     ('', 'certificate', '', _('SSL certificate file'), _('FILE')),
  5160     ('', 'print-url', None, _('start and print only the URL'))]
  5161     ('', 'print-url', None, _('start and print only the URL'))]
  5161      + subrepoopts,
  5162      + subrepoopts,
  5162     _('[OPTION]...'),
  5163     _('[OPTION]...'),
  5163     helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
  5164     helpcategory=command.CATEGORY_REMOTE_REPO_MANAGEMENT,
  5164     optionalrepo=True)
  5165     helpbasic=True, optionalrepo=True)
  5165 def serve(ui, repo, **opts):
  5166 def serve(ui, repo, **opts):
  5166     """start stand-alone webserver
  5167     """start stand-alone webserver
  5167 
  5168 
  5168     Start a local HTTP repository browser and pull server. You can use
  5169     Start a local HTTP repository browser and pull server. You can use
  5169     this for ad-hoc sharing and browsing of repositories. It is
  5170     this for ad-hoc sharing and browsing of repositories. It is
  5203     service = server.createservice(ui, repo, opts)
  5204     service = server.createservice(ui, repo, opts)
  5204     return server.runservice(opts, initfn=service.init, runfn=service.run)
  5205     return server.runservice(opts, initfn=service.init, runfn=service.run)
  5205 
  5206 
  5206 _NOTTERSE = 'nothing'
  5207 _NOTTERSE = 'nothing'
  5207 
  5208 
  5208 @command('^status|st',
  5209 @command('status|st',
  5209     [('A', 'all', None, _('show status of all files')),
  5210     [('A', 'all', None, _('show status of all files')),
  5210     ('m', 'modified', None, _('show only modified files')),
  5211     ('m', 'modified', None, _('show only modified files')),
  5211     ('a', 'added', None, _('show only added files')),
  5212     ('a', 'added', None, _('show only added files')),
  5212     ('r', 'removed', None, _('show only removed files')),
  5213     ('r', 'removed', None, _('show only removed files')),
  5213     ('d', 'deleted', None, _('show only deleted (but tracked) files')),
  5214     ('d', 'deleted', None, _('show only deleted (but tracked) files')),
  5221     ('', 'rev', [], _('show difference from revision'), _('REV')),
  5222     ('', 'rev', [], _('show difference from revision'), _('REV')),
  5222     ('', 'change', '', _('list the changed files of a revision'), _('REV')),
  5223     ('', 'change', '', _('list the changed files of a revision'), _('REV')),
  5223     ] + walkopts + subrepoopts + formatteropts,
  5224     ] + walkopts + subrepoopts + formatteropts,
  5224     _('[OPTION]... [FILE]...'),
  5225     _('[OPTION]... [FILE]...'),
  5225     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  5226     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  5226     inferrepo=True,
  5227     helpbasic=True, inferrepo=True,
  5227     intents={INTENT_READONLY})
  5228     intents={INTENT_READONLY})
  5228 def status(ui, repo, *pats, **opts):
  5229 def status(ui, repo, *pats, **opts):
  5229     """show changed files in the working directory
  5230     """show changed files in the working directory
  5230 
  5231 
  5231     Show status of files in the repository. If names are given, only
  5232     Show status of files in the repository. If names are given, only
  5407     if ((ui.verbose or ui.configbool('commands', 'status.verbose'))
  5408     if ((ui.verbose or ui.configbool('commands', 'status.verbose'))
  5408         and not ui.plain()):
  5409         and not ui.plain()):
  5409         cmdutil.morestatus(repo, fm)
  5410         cmdutil.morestatus(repo, fm)
  5410     fm.end()
  5411     fm.end()
  5411 
  5412 
  5412 @command('^summary|sum',
  5413 @command('summary|sum',
  5413     [('', 'remote', None, _('check for push and pull'))],
  5414     [('', 'remote', None, _('check for push and pull'))],
  5414     '[--remote]',
  5415     '[--remote]',
  5415     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
  5416     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
       
  5417     helpbasic=True,
  5416     intents={INTENT_READONLY})
  5418     intents={INTENT_READONLY})
  5417 def summary(ui, repo, **opts):
  5419 def summary(ui, repo, **opts):
  5418     """summarize working directory state
  5420     """summarize working directory state
  5419 
  5421 
  5420     This generates a brief summary of the working directory state,
  5422     This generates a brief summary of the working directory state,
  5925                            "information"))
  5927                            "information"))
  5926             modheads = bundle2.combinechangegroupresults(op)
  5928             modheads = bundle2.combinechangegroupresults(op)
  5927 
  5929 
  5928     return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
  5930     return postincoming(ui, repo, modheads, opts.get(r'update'), None, None)
  5929 
  5931 
  5930 @command('^update|up|checkout|co',
  5932 @command('update|up|checkout|co',
  5931     [('C', 'clean', None, _('discard uncommitted changes (no backup)')),
  5933     [('C', 'clean', None, _('discard uncommitted changes (no backup)')),
  5932     ('c', 'check', None, _('require clean working directory')),
  5934     ('c', 'check', None, _('require clean working directory')),
  5933     ('m', 'merge', None, _('merge uncommitted changes')),
  5935     ('m', 'merge', None, _('merge uncommitted changes')),
  5934     ('d', 'date', '', _('tipmost revision matching date'), _('DATE')),
  5936     ('d', 'date', '', _('tipmost revision matching date'), _('DATE')),
  5935     ('r', 'rev', '', _('revision'), _('REV'))
  5937     ('r', 'rev', '', _('revision'), _('REV'))
  5936      ] + mergetoolopts,
  5938      ] + mergetoolopts,
  5937     _('[-C|-c|-m] [-d DATE] [[-r] REV]'),
  5939     _('[-C|-c|-m] [-d DATE] [[-r] REV]'),
  5938     helpcategory=command.CATEGORY_WORKING_DIRECTORY)
  5940     helpcategory=command.CATEGORY_WORKING_DIRECTORY,
       
  5941     helpbasic=True)
  5939 def update(ui, repo, node=None, **opts):
  5942 def update(ui, repo, node=None, **opts):
  5940     """update working directory (or switch revisions)
  5943     """update working directory (or switch revisions)
  5941 
  5944 
  5942     Update the repository's working directory to the specified
  5945     Update the repository's working directory to the specified
  5943     changeset. If no changeset is specified, update to the tip of the
  5946     changeset. If no changeset is specified, update to the tip of the