mercurial/commands.py
changeset 11193 687c7d395f20
parent 11185 6d7cf82453be
child 11211 e43c23d189a5
equal deleted inserted replaced
11192:babf9a5f5528 11193:687c7d395f20
    22 
    22 
    23     Schedule files to be version controlled and added to the
    23     Schedule files to be version controlled and added to the
    24     repository.
    24     repository.
    25 
    25 
    26     The files will be added to the repository at the next commit. To
    26     The files will be added to the repository at the next commit. To
    27     undo an add before that, see hg forget.
    27     undo an add before that, see :hg:`forget`.
    28 
    28 
    29     If no names are given, add all files to the repository.
    29     If no names are given, add all files to the repository.
    30 
    30 
    31     .. container:: verbose
    31     .. container:: verbose
    32 
    32 
   490 def branches(ui, repo, active=False, closed=False):
   490 def branches(ui, repo, active=False, closed=False):
   491     """list repository named branches
   491     """list repository named branches
   492 
   492 
   493     List the repository's named branches, indicating which ones are
   493     List the repository's named branches, indicating which ones are
   494     inactive. If -c/--closed is specified, also list branches which have
   494     inactive. If -c/--closed is specified, also list branches which have
   495     been marked closed (see hg commit --close-branch).
   495     been marked closed (see :hg:`commit --close-branch`).
   496 
   496 
   497     If -a/--active is specified, only show active branches. A branch
   497     If -a/--active is specified, only show active branches. A branch
   498     is considered active if it contains repository heads.
   498     is considered active if it contains repository heads.
   499 
   499 
   500     Use the command :hg:`update` to switch to an existing branch.
   500     Use the command :hg:`update` to switch to an existing branch.
   722 
   722 
   723 def commit(ui, repo, *pats, **opts):
   723 def commit(ui, repo, *pats, **opts):
   724     """commit the specified files or all outstanding changes
   724     """commit the specified files or all outstanding changes
   725 
   725 
   726     Commit changes to the given files into the repository. Unlike a
   726     Commit changes to the given files into the repository. Unlike a
   727     centralized RCS, this operation is a local operation. See hg push
   727     centralized RCS, this operation is a local operation. See
   728     for a way to actively distribute your changes.
   728     :hg:`push` for a way to actively distribute your changes.
   729 
   729 
   730     If a list of files is omitted, all changes reported by :hg:`status`
   730     If a list of files is omitted, all changes reported by :hg:`status`
   731     will be committed.
   731     will be committed.
   732 
   732 
   733     If you are committing the result of a merge, do not provide any
   733     If you are committing the result of a merge, do not provide any
   790     By default, this command copies the contents of files as they
   790     By default, this command copies the contents of files as they
   791     exist in the working directory. If invoked with -A/--after, the
   791     exist in the working directory. If invoked with -A/--after, the
   792     operation is recorded, but no copying is performed.
   792     operation is recorded, but no copying is performed.
   793 
   793 
   794     This command takes effect with the next commit. To undo a copy
   794     This command takes effect with the next commit. To undo a copy
   795     before that, see hg revert.
   795     before that, see :hg:`revert`.
   796 
   796 
   797     Returns 0 on success, 1 if errors are encountered.
   797     Returns 0 on success, 1 if errors are encountered.
   798     """
   798     """
   799     wlock = repo.wlock(False)
   799     wlock = repo.wlock(False)
   800     try:
   800     try:
  1280 
  1280 
  1281     This only removes files from the current branch, not from the
  1281     This only removes files from the current branch, not from the
  1282     entire project history, and it does not delete them from the
  1282     entire project history, and it does not delete them from the
  1283     working directory.
  1283     working directory.
  1284 
  1284 
  1285     To undo a forget before the next commit, see hg add.
  1285     To undo a forget before the next commit, see :hg:`add`.
  1286 
  1286 
  1287     Returns 0 on success.
  1287     Returns 0 on success.
  1288     """
  1288     """
  1289 
  1289 
  1290     if not pats:
  1290     if not pats:
  1505 
  1505 
  1506     If one or more REVs are given, only branch heads on the branches
  1506     If one or more REVs are given, only branch heads on the branches
  1507     associated with the specified changesets are shown.
  1507     associated with the specified changesets are shown.
  1508 
  1508 
  1509     If -c/--closed is specified, also show branch heads marked closed
  1509     If -c/--closed is specified, also show branch heads marked closed
  1510     (see hg commit --close-branch).
  1510     (see :hg:`commit --close-branch`).
  1511 
  1511 
  1512     If STARTREV is specified, only those heads that are descendants of
  1512     If STARTREV is specified, only those heads that are descendants of
  1513     STARTREV will be displayed.
  1513     STARTREV will be displayed.
  1514 
  1514 
  1515     If -t/--topo is specified, named branch mechanics will be ignored and only
  1515     If -t/--topo is specified, named branch mechanics will be ignored and only
  1912     text/plain or text/x-patch). From and Subject headers of email
  1912     text/plain or text/x-patch). From and Subject headers of email
  1913     message are used as default committer and commit message. All
  1913     message are used as default committer and commit message. All
  1914     text/plain body parts before first diff are added to commit
  1914     text/plain body parts before first diff are added to commit
  1915     message.
  1915     message.
  1916 
  1916 
  1917     If the imported patch was generated by hg export, user and
  1917     If the imported patch was generated by :hg:`export`, user and
  1918     description from patch override values from message headers and
  1918     description from patch override values from message headers and
  1919     body. Values given on command line with -m/--message and -u/--user
  1919     body. Values given on command line with -m/--message and -u/--user
  1920     override these.
  1920     override these.
  1921 
  1921 
  1922     If --exact is specified, import will set the working directory to
  1922     If --exact is specified, import will set the working directory to
  2498     This finds all changes from the repository at the specified path
  2498     This finds all changes from the repository at the specified path
  2499     or URL and adds them to a local repository (the current one unless
  2499     or URL and adds them to a local repository (the current one unless
  2500     -R is specified). By default, this does not update the copy of the
  2500     -R is specified). By default, this does not update the copy of the
  2501     project in the working directory.
  2501     project in the working directory.
  2502 
  2502 
  2503     Use hg incoming if you want to see what would have been added by a
  2503     Use :hg:`incoming` if you want to see what would have been added
  2504     pull at the time you issued this command. If you then decide to
  2504     by a pull at the time you issued this command. If you then decide
  2505     add those changes to the repository, you should use pull -r X
  2505     to add those changes to the repository, you should use :hg:`pull
  2506     where X is the last changeset listed by hg incoming.
  2506     -r X` where ``X`` is the last changeset listed by :hg:`incoming`.
  2507 
  2507 
  2508     If SOURCE is omitted, the 'default' path will be used.
  2508     If SOURCE is omitted, the 'default' path will be used.
  2509     See :hg:`help urls` for more information.
  2509     See :hg:`help urls` for more information.
  2510 
  2510 
  2511     Returns 0 on success, 1 if an update had unresolved files.
  2511     Returns 0 on success, 1 if an update had unresolved files.
  2594     revision without deleting them from the working directory.
  2594     revision without deleting them from the working directory.
  2595 
  2595 
  2596     The following table details the behavior of remove for different
  2596     The following table details the behavior of remove for different
  2597     file states (columns) and option combinations (rows). The file
  2597     file states (columns) and option combinations (rows). The file
  2598     states are Added [A], Clean [C], Modified [M] and Missing [!] (as
  2598     states are Added [A], Clean [C], Modified [M] and Missing [!] (as
  2599     reported by hg status). The actions are Warn, Remove (from branch)
  2599     reported by :hg:`status`). The actions are Warn, Remove (from
  2600     and Delete (from disk)::
  2600     branch) and Delete (from disk)::
  2601 
  2601 
  2602              A  C  M  !
  2602              A  C  M  !
  2603       none   W  RD W  R
  2603       none   W  RD W  R
  2604       -f     R  RD RD R
  2604       -f     R  RD RD R
  2605       -A     W  W  W  R
  2605       -A     W  W  W  R
  2606       -Af    R  R  R  R
  2606       -Af    R  R  R  R
  2607 
  2607 
  2608     This command schedules the files to be removed at the next commit.
  2608     This command schedules the files to be removed at the next commit.
  2609     To undo a remove before that, see hg revert.
  2609     To undo a remove before that, see :hg:`revert`.
  2610 
  2610 
  2611     Returns 0 on success, 1 if any warnings encountered.
  2611     Returns 0 on success, 1 if any warnings encountered.
  2612     """
  2612     """
  2613 
  2613 
  2614     ret = 0
  2614     ret = 0
  2659     By default, this command copies the contents of files as they
  2659     By default, this command copies the contents of files as they
  2660     exist in the working directory. If invoked with -A/--after, the
  2660     exist in the working directory. If invoked with -A/--after, the
  2661     operation is recorded, but no copying is performed.
  2661     operation is recorded, but no copying is performed.
  2662 
  2662 
  2663     This command takes effect at the next commit. To undo a rename
  2663     This command takes effect at the next commit. To undo a rename
  2664     before that, see hg revert.
  2664     before that, see :hg:`revert`.
  2665 
  2665 
  2666     Returns 0 on success, 1 if errors are encountered.
  2666     Returns 0 on success, 1 if errors are encountered.
  2667     """
  2667     """
  2668     wlock = repo.wlock(False)
  2668     wlock = repo.wlock(False)
  2669     try:
  2669     try: