403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib64/python3.9/site-packages/mercurial/__pycache__/commands.cpython-39.pyc
a

�+�b	�@s�"ddlmZddlZddlZddlZddlZddlmZddlm	Z	m
Z
mZmZddl
mZddlmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z$m%Z%m&Z&m'Z'm(Z(m)Z*m+Z,m-Z-m.Z.m/Z/m0Z0m1Z1m
Z
m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z:m;Z<m=Z=m>Z?m@ZAmBZBmCZDmEZFmGZGddlHmIZImJZJmKZKiZLeL�MejNjO�e3�NeL�ZNe3jPZPd	d
ded�ed
�fddded�ed�fddded�fddded�fddded�fddded�ed�fddged�ed�fdd ded!�fdd"ded#�fdd$ejed%�ed&�fdd'ejQed(�ed)�fdd*ded+�fdd,ded-�fdd.ded/�fdd0ded1�fd2d3ded4�fdd5d6ed7�fdd8d9ed:�ed�fgZRejSZSejTZTejUZUejVZVejWZWejXZXejYZYejZZZej[Z[ej\Z\ej]Z]ej^Z^ej_Z_ej`Z`ejaZaejbZbeNd;eSeNjcd<d=�d>d?��ZdeNd@eUeaeSedA�eNjed<d<dB�dCdD��ZfeNdEe`eaeUeSedA�eNjed<dF�dGdH��ZgeNdIdJdKdedL�edM�fddNdedO�fddPdedQ�fdRdSdedT�fdUdVdedW�fdXdYdedZ�fd[d\ded]�fd^d_ded`�fdadbdedc�fdddededf�fddggedh�edM�fge]eUeYedi�eNjhd<d<dB�djdk��ZieNdlddmdedn�fdodpdedq�edr�fdJdKdeds�edM�fdtdudedv�ed�fgeaeUedw�eNjjdx�dydz��ZkeNd{dd|ded}�fdd~ded�fdd�ded��fdd�ded��edM�fdJdKded��edM�fd�d�d6ed��fge_eUeVeWed��eNjcdx��dd�d���Zl�dd�d��ZmeNd�dJd�d6ed��fd�d�d6ed��fd�d�d6ed��fd�dgd6ed��fd�d�d6ed��fdad�ded��ed��fd�d�d6ed��fged��eNjndx��dd�d���ZoeNd�dXd�d6ed��fdJdKded��edM�fd[d�d6ed��fd�d�ded��ed��fd�d�d6ed��fddd�d6ed��fgeYed��eNjpdx�d�d���ZqeNd�dXd�ded��fd�d�ded��fdJdKged��fged��eNjpdx��d	d�d���ZreNd�dRd�d6ed��fdad�d6ed��fdJdKgedƒfgeYedÃeNjpePhdč�d
d�dƄ�ZseNd�dXd�dedȃfdJdKgedɃedM�fd�d�gedʃed˃fdd�ged̓edM�fdRd�dedσfdtdud�edуed�fgeTed҃eNjjdx�d�dԄ�ZteNd�d�d�ded؃edكfdJdKdedڃedM�fdd�ded܃fgeUeYed݃eNjhd<ePhdލd�d��ZueNd�d�d�ded�fdUd�ded�edM�fdJdKged�edM�fd�d�ged�ed˃fdd�ded�fdd�ded�fdd�ded�fgeTed�eNjvd<d<d��dd�d��ZweNd�d�dEded�fdd�ded��fdd�ded��fd�d�ded��fd�d�ded��fdd�ded��fd�d�ded��fgeUeVeWeaedA�eNjxd<d<dB�d�d���Zy�d�d�ZzeN�ddU�dde�d�fd�dde�d�fd�d�de�d�fdd�dde�d	�fd�d
de�d�fd�dde�d
�fd�dde�d�fd��dde�d�fgeYe�d�eNj{d<ePh�d��d�d��Z|eN�deSeNjcd<d=��d�d��Z}eN�dd�dde�d�fd�dde�d�fd�dde�d�edM�fdXd�de�d �fgeUeSe�d!�eNjhdx��d"�d#��Z~eN�d$ge�d%�eNj{d<�d&��d�d'�d(��ZeN�d)d֐d*de�d+�fge�d,�eNj{d<�d&��d
�d-�d.��ZeN�d/dJdKge�d0�edM�fd�d1de�d2�e�d3�fd�d4de�d5�e�d6�fda�d7de�d8�edM�fge\e^eUeae�d9�eNjhd<d<ePh�d:��d;�d<��Z�eN�d=�d>�d?de�d@�e�dA�fd�d�ded؃edكfd�dBde�dC�fdJdKge�dD�edM�fge\eYe�dE�eNjjd<ePh�dF��dG�dH��Z�eN�dIdJdKde�dJ�edM�f�dK�dLde�dM�fgeUeYeaedA�eNjeePhdč�dN�dO��Z�eN�dd�d�ded��fgeUeSed݃eNjed<d<dB��dP�dQ��Z�eN�dRdJdKge�dS�edM�fdd�de�dT�edM�fda�dd6e�dU�fd�dVd6e�dW�fdd;d6e�dX�fd�d�d6ed��fd�dYde�dZ�fdd�de�d[�fdXd�d6e�d\�f�d]�d^d6e�d_�fd��d`d6e�da�fgeWe_eSe�db�eNjcdx��dc�dd��Z��de�df�Z��dg�dh�Z�e<j��dR�did<d<d<ej�e�dj��dk�eN�dl�dK�dLde�dm�fdd�de�dn�fd�d/de�do�fdRdSdedT�fdXdNde�dp�fd��dqde�dr�fdd�dsde�dt�fd^dede�du�fdJdKge�dv�edM�fd�dwde�dx�fdUdVdedW�fd[d\ded]�fgeYeUe�dy�eNjhd<ePhdލ�dz�d{��Z#eN�d|dJdKde�d}�e�d~�fdt�dd6e�d��fdRd�d6e�d��fdad�d6e�d��fgeZe�d��eNjnePhdč�d��d���Z�eNd3d��d�de�d��fdad�de�d��f�d��d�de�d��fd��d�ge�d��e�d��fge�d��eNj{d<ePh�d���d�d��d���Z�eN�d�dJdKde�d��edM�fd^�d�de�d��fd��d�de�d��fd�d�de�d��fdt�d�de�d��f�d>�d�de�d��fgeTeYe�d��eNjnd<ePh�d��d�d��d���Z�eN�d�do�d�de�d��e�d��fd�d�de�d��e�d��fdd�ded��fd�d�d6ed��fdXd�de�d��fdd�de�d��fd�d�de�d��fd�d�de�d��fd�d�de�d��fddpde�d��ed�fd�d�de�d��fgeVeWe`e�d��eNjjdx��d�d��d���Z�eN�d�dXd�de�d��fd^�d�de�d��fdd�de�d��e�d��fdJdKge�d��edM�f�d>�d�d6e�d��fd�d�ge�d��ed˃fge[eTeae�d��eNj�dx��d�d��d���Z�eN�d�eTe�dÃeNjvd<d<d��d�dŐdƄ�Z�eN�d�dJdKde�dJ�edM�f�dK�dLde�dM�fdX�d�de�dɃfgeUe�dʃeNjedx��dːd̄�Z�eN�d�dXdNde�dp�fd�d�de�dσfd[d\de�dЃe�dуfd��d�de�dӃf�d��d�ge�dԃe�dՃfdJdKge�dփedM�f�dאd�ge�dكe�dڃfd�d�de�d܃fd��d�de�dރfdUdVge�d߃e�d�fd�d�ge�d�ed˃fd�d�ge�d�ed˃f�d>�d?ge�d�e�dA�f�d�d�ge�d�edM�fge[eUe�d�eNjnd<d<ePh�d:��d�d��Z�eN�d�dJdKde�d�edM�fdd�d6e�d�fgeYe�d�eNj�ePhdč�d�d�d��Z�eNd|dXd�de�d�fdJdKde�d�edM�f�d�d�de�d�fdd;de�d��fge_e�d��eNjcd<d=��d�d��d���Z)e<j�d|dd<d<e�d��e'j�e�d��e�d���d��eN�d�dXd�dedȃfdJdKge�d��edM�fd^�d�de�d��f�d>�d�d6e�d��fd�d�ge�d��ed˃fge[eTeae�d�eNj�dx��d�d��Z�eN�ddJdKde�d�edM�fgeZe�d�eNjnd<dF��d�d�d��Z�eN�deYe�d	�eNj�d<ePh�d��d�d
�d��Z�eN�ddo�d
d6e�d�fd[�dd6e�d�fd�d�d6e�d�fdXd�d6e�d�fdJdKge�d�edM�fge�d�eNjpdx��d�d��Z��d�d�Z�eNd�dU�dde�d�fdXd�de�d�fd�dde�d�fdJdKge�d��edM�f�d>�d?ge�d�e�dA�fd�d�ge�d��ed˃fgeTe�d�eNj�d<d=��d �d!��Z�eN�d"dR�d#de�d$�fdd�de�d%�fd��d&de�d'�fd�d(de�d)�fd�dIde�d*�fdo�d+de�d,�f�dK�dLde�d-�fd�dde�d.�fgejUe�d/�eNjedx��d0�d1��Z�eN�d2dXd�de�d3�fdJdKge�d��edM�f�d>�d?ge�d4�e�dA�fd�d5de�d6�fd�d�ge�d��ed˃fd�d7d6e�d8�fd�d9ge�d:�fd�d;d6e�d<�fgeTe�d=�eNj�d<d=��d>�d?��Z�eN�d@�dAgeNj�dx��dB�dC��Z�eN�dDd�dde�dE�fdXd�de�dF�fgeaeUeSed݃eNjed<d<dB��dG�dH��Z�eN�dId�dde�dJ�fd�dde�dK�fd�dde�dL�edM�fdXd�de�dM�fgeUeSe�dN�eNjedx��dO�dP��Z�eN�dQdRd�de�dR�fddd�de�dS�fd��dTde�dU�fdU�dVde�dW�fd^�dXde�dY�fd�dZde�d[�fge_eUeYedA�eNjed<dF��d\�d]��Z�eN�d^dRd�de�d_�fd[d\de�d`�e�dуfdJdKde�da�edM�fd��dbde�dc�fd�d�de�dd�fgeUeSe�de�eNjedx��df�dg��Z�eN�dheSdXd�d6e�di�fgeNj�dx��dj�dk��Z�eN�dlgeYePheNje�dm��dn�do��Z�eN�dpd�dqde�dr�e�d��fd[�dsde�dt�fd�duge�dv�f�dw�dxde�dy�e�d��fdo�dzde�d{�e�d|�fdR�d}de�d~�e�d�fddpde�d��edr�fd^�d�de�d��e�d��fd�d�de�d��e�d��fd�d�de�d��e�d��fd�d�de�d��e�d��fd�d�de�d��fd�d�de�d��ed)�fdt�d�de�d��e�d��fd�d�de�d��e�d��f�d��d�de�d��fd�d�de�d��e�d��fd�d�de�d��fgeae�d��eNj�d<d<�d���d��d���Z�eN�d�d�dEde�d��fdU�d�de�d��fd�d�de�d��fdd\de�d��e�dуfd[d�de�d��fd�d�d6ed��f�d��d�d6e�d��fddd�de�d��fd��d�de�d��e�dՃfd^�d�de�d��e�d��fdo�d�de�d��fd�d�de�d��fd�d�de�d��fg
ejUe�d��eNjedx��d��d���Z9�d�Z�eN�d�d�d�de�d��fd��d�de�d��fdR�d�de�d��fdJ�d�de�d��fd[�d�de�d��fdad�de�d��fdU�d�de�d��fd��d&de�d��fd^�dXde�dY�fdt�d�e�e�dƒfd��d�de�dÃf�dK�dLde�dM�fddKge�dăedM�fd�d7de�dŃedM�fgeUeaeYedA�eNjed<d<ePh�d:��dƐdDŽ�Z�eN�d�d�d�de�dʃfg�d�eNjed<ePh�dF��d̐d̈́�Z�eN�d�dXd�de�dσfdd�dde�dЃfdJdKde�dуedM�fd�d�de�dӃfd�d�ded��fd��d�de�dԃe�dՃfgeWe�dՃeNjpdx��d֐dׄ�Z�eN�d�eYdeNjpePhdč�dؐdل�Z>eN�d�do�d�de�dۃfd��d�de�d݃fgeZe�dރeNjndx��dߐd��Z�eN�d�dU�dde�d�fge�d�eNjjdx��d�d��Z�eN�d�dRd;de�d�fda�dde�d�fd�d�de�d�f�d��d�de�d�fd^�d�de�d�e�d��fdt�d�de�d�fdd\de�d�e�dуfge�d�eNjedx��d�d��Z�e<j��d�d�d<e:j�e:j�e�d��d�eN�d�d�d�de�d��fda�d�de�d��fd�d|de�d��fd[d\de�d`�e�dуfdJdKde�d��edM�fge_e�d��eNjed<d=��d�d��d���ZMeN�d��d�geNj�dx��d�d��ZCeNd0geYeNj{d<ePh�d���d�d��Z��d�d�Z�dS(�)�absolute_importN�)�_)�hex�nullrev�short�wdirrev)�open)/�archival�	bookmarks�bundle2�bundlecaches�changegroup�cmdutil�copies�
debugcommands�destutil�
dirstateguard�	discovery�encoding�error�exchange�
extensions�	filemerge�	formatter�graphmod�grep�hbisect�help�hg�
logcmdutil�merge�
mergestate�
narrowspec�obsolete�obsutil�patch�phases�pycompat�rcutil�	registrar�requirements�
revsetlang�rewriteutil�scmutil�server�shelve�state�streamclone�tags�ui�util�verify�vfs�wireprotoserver)�dateutil�
stringutil�urlutil�Rs
repository�s8repository root directory or name of overlay bundle filesREPOscwdschange working directorysDIR�ysnoninteractivesBdo not prompt, automatically pick the first choice for all prompts�qsquietssuppress output�v�verbosesenable additional outputscolors9when to colorize (boolean, always, auto, never, or debug)sTYPE�configs5set/override config option (use 'section.name=value')sCONFIGsdebugsenable debugging outputsdebuggersstart debuggersencodingsset the charset encodingsENCODEsencodingmodesset the charset encoding modesMODEs	tracebacks%always print a traceback on exceptionstimestime how long the command takessprofilesprint command execution profile�versions#output version information and exit�h�helpsdisplay help and exitshiddenFsconsider hidden changesetsspagersautos2when to paginate (boolean, always, auto, or never)�abortT)�helpcategory�	helpbasiccKsp|�d�}t�|�}|s&t�td���|jsHtjtd�|j|�	�d��|rd|�
td�|j�dS|�||�S)z�abort an unfinished operation (EXPERIMENTAL)

    Aborts a multistep operation like graft, histedit, rebase, merge,
    and unshelve if they are in an unfinished state.

    use --dry-run/-n to dry run the command.
    �dry_run�no operation in progresss.%s in progress but does not support 'hg abort'��hints %s in progress, will be aborted
N)�getr�getunfinishedstater�
StateErrorr�	abortfunc�
InputError�_opnamerL�status)r4�repo�opts�dryrunZ
abortstate�rW�8/usr/lib64/python3.9/site-packages/mercurial/commands.py�abort�s"

���rY�adds[OPTION]... [FILE]...)rGrH�	inferrepocOsNt�|d|t�|��}tj|dd�}tj|||d|dfi|��}|rJdpLdS)a�add the specified files on the next commit

    Schedule files to be version controlled and added to the
    repository.

    The files will be added to the repository at the next commit. To
    undo an add before that, see :hg:`forget`.

    If no names are given, add all files to the repository (except
    files matching ``.hgignore``).

    .. container:: verbose

       Examples:

         - New (unknown) files are added
           automatically by :hg:`add`::

             $ ls
             foo.c
             $ hg status
             ? foo.c
             $ hg add
             adding foo.c
             $ hg status
             A foo.c

         - Specific files to be added can be specified::

             $ ls
             bar.c  foo.c
             $ hg status
             ? bar.c
             ? foo.c
             $ hg add bar.c
             $ hg status
             A bar.c
             ? foo.c

    Returns 0 if all files are successfully added.
    NT��legacyrelativevaluer=Frr)r.�matchr(�byteskwargs�getuipathfnr�add)r4rT�patsrU�m�uipathfn�rejectedrWrWrXra�s3ra�	addremove)rGr[cOsZt�|�}|�d�sd|d<t�|d||�}t�||�}tj||d�}t�||d||�S)a�add all new files, delete all missing files

    Add all new files and remove all missing files from the
    repository.

    Unless names are given, new files are ignored if they match any of
    the patterns in ``.hgignore``. As with add, these changes take
    effect at the next commit.

    Use the -s/--similarity option to detect renamed files. This
    option takes a percentage between 0 (disabled) and 100 (files must
    be identical) as its parameter. With a parameter greater than 0,
    this compares every removed file with every added file and records
    those similar enough as renames. Detecting renamed files this way
    can be expensive. After using this option, :hg:`status -C` can be
    used to check which files were identified as moved or renamed. If
    not specified, -s/--similarity defaults to 100 and only renames of
    identical files are detected.

    .. container:: verbose

       Examples:

         - A number of files (bar.c and foo.c) are new,
           while foobar.c has been removed (without using :hg:`remove`)
           from the repository::

             $ ls
             bar.c foo.c
             $ hg status
             ! foobar.c
             ? bar.c
             ? foo.c
             $ hg addremove
             adding bar.c
             adding foo.c
             removing foobar.c
             $ hg status
             A bar.c
             A foo.c
             R foobar.c

         - A file foobar.c was moved to foo.c without using :hg:`rename`.
           Afterwards, it was edited slightly::

             $ ls
             foo.c
             $ hg status
             ! foobar.c
             ? foo.c
             $ hg addremove --similarity 90
             removing foobar.c
             adding foo.c
             recording removal of foobar.c as rename to foo.c (94% similar)
             $ hg status -C
             A foo.c
               foobar.c
             R foobar.c

    Returns 0 if all files are successfully added.
    �
similaritys100Nr\r=)r(r_rMr.r^�anypatsr`�	addremove)r4rTrbrU�matcher�relativerdrWrWrXrisE

risannotate|blame�r�revsannotate the specified revisionsREV�follows8follow copies/renames and list the filename (DEPRECATED)s	no-followsdon't follow copies and renames�a�textstreat all files as text�u�userslist the author (long with -v)�f�fileslist the filename�d�dateslist the date (short with -q)�n�numbers"list the revision number (default)�c�	changesetslist the changeset�lsline-numbers(show line number at the first appearance�skips$revset to not display (EXPERIMENTAL)s3[-r REV] [-f] [-a] [-u] [-d] [-n] [-c] [-l] FILE...c	sDt����|st�td�����d�r.d�d<��d�s^��d�s^��d�s^��d�s^d�d<��d	�d
u}|r���d�s���d�s�t�td�����d�}|r�t��|gd
��t�	�|��|�
d�|�d��}|jr�tj
�	ndd��	|jr�tj}ntj}���d
u�rB��d��r$�fdd�}n�fdd�}���	fdd�}	n
dj}�	}	dddd�|jfdddd�|fdddd�|	fdddd�t�|�fdddd�tjfd d!d"d�tjfg}
dddd	d#��|���r�d$d%��nd&d%��|�������fd'd(�|
D�}|d)d)d*f|d)<d����fd+d,�|
D��}d-d.�}
tj�|�|
d/�}��d0�}tj|�ddd1�}��d2�}|�r~t��|�}tj�dd3�}�� |�D�]�}�|}|�!�|j"|d4���d5��s�|�#��r�|�$td6�||���q�|j%d7d8d9�}|j&|||d:�}|�s|�'��q�g}g}|D]v\���fd;d(�|D�}|���rzd<d(�|D�}t(|��|�)��fd=d(�|D��n|�)d>gt*|��|�)|��q$t+t+|�t+|�|�D]^\�}}|�!�|j,|j-d?�|j.|d*���g|�R�|j/�r�d@}ndA}|�.dB||j0��q�|dCj0�1dD��s,|�$dD�|�'��q�|�'�d
S)Eashow changeset information by line for each file

    List changes in files, showing the revision id responsible for
    each line.

    This command is useful for discovering when a change was made and
    by whom.

    If you include --file, --user, or --date, the revision number is
    suppressed unless you also include --number.

    Without the -a/--text option, annotate will avoid processing files
    it detects as binary. With -a, annotate will annotate the file
    anyway, although the results will probably be neither useful
    nor desirable.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :lines:   List of lines with annotation data.
      :path:    String. Repository-absolute path of the specified file.

      And each entry of ``{lines}`` provides the following sub-keywords in
      addition to ``{date}``, ``{node}``, ``{rev}``, ``{user}``, etc.

      :line:    String. Line content.
      :lineno:  Integer. Line number at that revision.
      :path:    String. Repository-absolute path of the file at that revision.

      See :hg:`help templates.operators` for the list expansion syntax.

    Returns 0 on success.
    s,at least one filename or pattern is requiredrnTrtrrrzrvrx�line_numberNs(at least one of -n/-c is required for -lrm�nowarnsannotatecSs|dd�S)N�rW��hrWrWrX�shorthex�szannotate.<locals>.shorthexcs$|tkrd�����Sd|SdS)N�%d�r�p1�rev�r���ctxrWrX�	formatrev�szannotate.<locals>.formatrevcs$|tkrd�����Sd|SdS)Ns%d+s%d r�r�r�rWrXr��scs4|�jjkr$d�t�������Sd�|�SdS)Ns%s+�%s )Z
nodeconstantsZwdirhexrr��noder�)r�rTr�rWrX�	formathex�szannotate.<locals>.formathexr�� cSs
|j��S�N)�fctx�user��xrWrWrX�<lambda>�r=zannotate.<locals>.<lambda>cSst�|j�Sr�)r.�intrevr�r�rWrWrXr��r=�nodecSstt�|j��Sr�)rr.�binnoder�r�rWrWrXr��r=cSs
|j��Sr�)r��dater�rWrWrXr��r=�pathcSs
|j��Sr�)r��pathr�rWrWrXr��r=�lineno�:cSs|jSr�)�linenor�rWrWrXr��r=)rmr�r�r�cs��fdd�S)Ncs��|��Sr�rWr���fmtrMrWrXr��r=z,annotate.<locals>.makefunc.<locals>.<lambda>rW�rMr�rWr�rX�makefunc�szannotate.<locals>.makefunccSs|Sr�rWr�rWrWrXr�scs<g|]4\}}}}����||��s*|�vr�||�|f�qSrW�rM��.0�fn�seprMr�)�datahintr��	opnamemaprUrWrX�
<listcomp>s
�zannotate.<locals>.<listcomp>rr=c3s4|],\}}}}����||��s(|�vr|VqdSr�r�r�)r�r�rUrWrX�	<genexpr>
s
�zannotate.<locals>.<genexpr>cSst�d||f��dS)Ns%s: %s)rrQ�r��yrWrWrX�badszannotate.<locals>.bad)�badfns	no_follow)�sectionZ
whitespacer|r\�r�rps%s: binary file
sliness
{rev}: {line}�Ztmpl)�follow�skiprevs�diffoptscsg|]}�|��qSrWrW�r��n)�frWrXr�1r=cSsg|]}t�|��qSrW)r�colwidth�r�r�rWrWrXr�3r=cs g|]}�d�|d�qS)r��%srW)r��w)�mlr�rWrXr�5r=r�)r�s* %ss: %ssline����
)2r(r_rrQrrMr.�unhidehashlikerevsr �	revsingle�pagerr�	debugflag�identity�quietr9Z	shortdateZdatestrr��__mod__�	shortuserr5�	cachefunc�bytestr�isplainr��joinr^r&Zdifffeatureopts�revranger`�walk�	startitem�data�isbinary�plain�nested�annotate�end�max�append�len�zip�contextr��write�skip�text�endswith)r4rTrbrUZ
linenumberr�ZrootfmZdatefuncr�r�ZopmapZfuncmap�fieldsr�rcr�r�r�rd�absr��fm�lines�formats�pieces�lZsizes�pr�r�rW)
r�r�r�r�r�r�rUrTr�r�rXr�Us�M
�
�������

�	�

���
�

r�sarchives	no-decodes"do not pass files through decoders�p�prefixs%directory prefix for files in archivesPREFIXsrevision to distribute�t�typestype of distribution to creates[OPTION]... DEST)rGc
Ks"t�|�}|�d�}|r(t�||gd�}t�||�}|sFt�t	d���|�
�}t�||�}t
j�|�|jkrzt�t	d���|�d�p�t�|�p�d}|�d�}|dkr�|dkr�t�t	d	���t�||�}|s�t
j�|j�d
}t�||�}t�|g|�}	tj|||||�d�|	||�d�d
�dS)a	create an unversioned archive of a repository revision

    By default, the revision used is the parent of the working
    directory; use -r/--rev to specify a different revision.

    The archive type is automatically detected based on file
    extension (to override, use -t/--type).

    .. container:: verbose

      Examples:

      - create a zip file containing the 1.0 release::

          hg archive -r 1.0 project-1.0.zip

      - create a tarball excluding .hg files::

          hg archive project.tar.gz -X ".hg*"

    Valid types are:

    :``files``: a directory full of files (default)
    :``tar``:   tar archive, uncompressed
    :``tbz2``:  tar archive, compressed using bzip2
    :``tgz``:   tar archive, compressed using gzip
    :``txz``:   tar archive, compressed using lzma (only in Python 3)
    :``uzip``:  zip archive, uncompressed
    :``zip``:   zip archive, compressed using deflate

    The exact name of the destination archive or directory is given
    using a format string; see :hg:`help export` for details.

    Each member added to an archive file has a directory prefix
    prepended. Use -p/--prefix to specify a format string for the
    prefix. The default is the basename of the archive, with suffixes
    removed.

    Returns 0 on success.
    rmr~s/no working directory: please specify a revisions%repository root cannot be destinationr��filesr��-s$cannot archive plain files to stdouts-%hs	no_decode�subrepos)�subreposN)r(r_rMr.r�r r�rrQrr�rZmakefilename�osr��realpath�rootr
Z	guesskindZmakefileobj�basenamer^�archive)
r4rT�destrUr�r�r��kind�prefixr^rWrWrXr�KsB=

�

�r��backout�merges,merge with old dirstate parent after backout�commits4commit if no conflicts were encountered (DEPRECATED)s	no-commits
do not commit�parents4parent to choose when backing out merge (DEPRECATED)srevision to backout�e�edits invoke editor on commit messagess[OPTION]... [-r] REVc	Ksx|���\|���4t||||fi|��Wd�Wd�S1sL0YWd�n1sj0YdS)axreverse effect of earlier changeset

    Prepare a new changeset with the effect of REV undone in the
    current working directory. If no conflicts were encountered,
    it will be committed immediately.

    If REV is the parent of the working directory, then this new changeset
    is committed automatically (unless --no-commit is specified).

    .. note::

       :hg:`backout` cannot be used to fix either an unwanted or
       incorrect merge.

    .. container:: verbose

      Examples:

      - Reverse the effect of the parent of the working directory.
        This backout will be committed immediately::

          hg backout -r .

      - Reverse the effect of previous bad revision 23::

          hg backout -r 23

      - Reverse the effect of previous bad revision 23 and
        leave changes uncommitted::

          hg backout -r 23 --no-commit
          hg commit -m "Backout revision 23"

      By default, the pending changeset will have one parent,
      maintaining a linear history. With --merge, the pending
      changeset will instead have two parents: the old parent of the
      working directory and a new child of REV that simply undoes REV.

      Before version 1.7, the behavior without --merge was equivalent
      to specifying --merge followed by :hg:`update --clean .` to
      cancel the merge and leave the child of REV as a head to be
      merged separately.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    See :hg:`help revert` for a way to restore files to the state
    of another revision.

    Returns 0 on success, 1 if nothing to backout or there are unresolved
    files.
    N)�wlock�lock�
_dobackout)r4rTr�r�rUrWrWrX�backout�sUr�c	s�t�|dddg�t�|�}|r2�r2t�td���|s:�}|sLt�td���|�d�}|rht�	|�|d<t�
��t���t�
�|�}|����j��\}}�j��|�s�t�td����j���\}	}
|	�jkr�t�td���|
�jk�rH|�d	��st�td
�����|d	�}||	|
fv�rBt�td�t|�t��f��|}n|�d	��rbt�td���|	}�j��}
��|
�}t�
�t|��}|�d
��sT|�k�rTt��d��ld|�dd�i}|�|d��"tj|�|d�}Wd�n1�s�0Y��||�Wd�n1�s 0Yt� �|�|j!�r~�j"�#td��dSn*tj$��dd��j�%|
�t�&|�|�|�d��r�td�}|�#|t���dS�fdd�}�j�'�}t�(|�|g|�}|�s�|�#td��dSt�)�||
||��fdd�}|�#td�||�|��f�|�d
��r�|�k�r�tj$�|dd�|�#td �||��d|�dd�i}|�|d��t�*�d!�Wd�S1�s�0YdS)"N�	no_commit�commitr!� please specify just one revisions$please specify a revision to backoutrvs-cannot backout change that is not an ancestors'cannot backout a change with no parentsr�s cannot backout a merge changesets%s is not a parent of %ss*cannot use --parent on non-merge changesetr�r���uis
forcemerge�toolr=)�parents1use 'hg resolve' to retry unresolved file merges
rF��
show_stats�	no_commits1changeset %s backed out, don't forget to commit.
rcs\d}tjfd|it�|���}|s<dt��}tjd|d�}|j||�d�|�d�||d�S)	Nr��editformsBacked out changeset %sT)�editr	rrrv��editor)r�getcommiteditorr(�	strkwargsrrrM)r4rT�messager^rUr	�e�r�rWrX�
commitfuncPs���z_dobackout.<locals>.commitfunc�nothing changed
csd�j�|�t|�fS)Ns%d:%s)�	changelogr�rr�rTrWrX�nicefsz_dobackout.<locals>.nices$changeset %s backs out changeset %s
smerging with changeset %s
�tip)+r�check_incompatible_argumentsr(r_rrQrrMr9�	parsedate�checkunfinished�
bailifchangedr r�r��dirstate�parentsrZ
isancestor�nullid�lookupr�branch�branchheadsr.rr�configoverride�mergemodZback_outZ
setparentsrZ
_showstats�unresolvedcountr4rS�clean�	setbranch�revert�tipr�commitstatusr!)r4rTr�r�rUr�r�Zop1Zop2r��p2r�rr �bheadsZrctx�	overrides�stats�msgrr(ZnewnoderrW)r�rTrXr�s�



�
��

2,�
��.r��bisect�resetsreset bisect state�g�goodsmark changeset good�b�badsmark changeset bad�ssskip testing changesetsextendsextend the bisect rangescommands$use command to check changeset statesCMD�U�noupdatesdo not update to targets[-gbsr] [-U] [-c CMD] [REV]cs�g}|dvrJ|�td��|}|�|�|dkr6d}qp|dkrDd}qpd}n&|r^t�td���n|durp|�|�|t|�|	|||d���fd	d
��D�}
t|
�dkr�t�td�tt|
�d
d����|r�t	�
��dSt	���}|�r�fdd
�t�
�|�D�}n��d�g}|�s"|�s"|�r�|�r:|d|7<n.|�rR|d|7<n|�rh|d|7<t	��|�|d�r�|d�s�dSd(�fdd�	}t�|�i�}|�r�d}��r�z|dd
}Wn"t�y�t�td���Yn0n(�j��\}}|�jk�rt�td���|�r@|�s0t�td����|d��}t	��||���|�rV|g|d<t	��|�|j|dt|�idd�}|dk�r�d}nP|d
k�r�d}n@|dk�r�t�td�|��n"|d
k�r�t�td�|��nd}||�|��|}t�||d �}|�td!�||f�t	�|�t	��|�\}}}|d
}|�|d"d#��qRWd�n1�sl0Yt	� |�||||�dSt	�|�t	��|�\}}}|	�r"|�st	�!�|||�}|du�r|�"td$�t�||d ��|��g|d<t	��|�|�|���St�td%���|d
k�rBt	� |�||||�n�t|�dk�sTJ�|d
}d&\}}||k�r�|d|d}}�qd�j#�$|�}t�|�|d �}|�"td'�|||f�|g|d<t	��|�|�|�SdS))a�
subdivision search of changesets

    This command helps to find changesets which introduce problems. To
    use, mark the earliest changeset you know exhibits the problem as
    bad, then mark the latest changeset which is free from the problem
    as good. Bisect will update your working directory to a revision
    for testing (unless the -U/--noupdate option is specified). Once
    you have performed tests, mark the working directory as good or
    bad, and bisect will either update to another candidate changeset
    or announce that it has found the bad revision.

    As a shortcut, you can also use the revision argument to mark a
    revision as good or bad without checking it out first.

    If you supply a command, it will be used for automatic bisection.
    The environment variable HG_NODE will contain the ID of the
    changeset being tested. The exit status of the command will be
    used to mark revisions as good or bad: status 0 means good, 125
    means to skip the revision, 127 (command not found) will abort the
    bisection, and any other non-zero exit status means the revision
    is bad.

    .. container:: verbose

      Some examples:

      - start a bisection with known bad revision 34, and good revision 12::

          hg bisect --bad 34
          hg bisect --good 12

      - advance the current bisection by marking current revision as good or
        bad::

          hg bisect --good
          hg bisect --bad

      - mark the current revision, or a known revision, to be skipped (e.g. if
        that revision is not usable because of another issue)::

          hg bisect --skip
          hg bisect --skip 23

      - skip all revisions that do not touch directories ``foo`` or ``bar``::

          hg bisect --skip "!( file('path:foo') & file('path:bar') )"

      - forget the current bisection::

          hg bisect --reset

      - use 'make && make tests' to automatically find the first broken
        revision::

          hg bisect --reset
          hg bisect --bad 34
          hg bisect --good 12
          hg bisect --command "make && make tests"

      - see all changesets whose states are already known in the current
        bisection::

          hg log -r "bisect(pruned)"

      - see the changeset currently being bisected (especially useful
        if running with -U/--noupdate)::

          hg log -r "bisect(current)"

      - see all changesets that took part in the current bisection::

          hg log -r "bisect(range)"

      - you can even get a nice graph::

          hg log --graph -r "bisect(range)"

      See :hg:`help revisions.bisect` for more about the `bisect()` predicate.

    Returns 0 on success.
    )r2r4r0�inits)(use of 'hg bisect <cmd>' is deprecated)
r2Tr4sincompatible argumentsN)s--bads	--commands--extends--goods--resets--skipcsg|]}�|r|�qSrWrWr�)�
incompatiblesrWrXr�r=zbisect.<locals>.<listcomp>rs%s and %s are incompatibler�csg|]}�|���qSrWr�r��irrWrXr�r=�.r|cs,�rdSt�|�t�|�tj|||d�S)zcommon used update sequenceNr)rrrrr%)rTr�r)�noupdaterWrX�	mayupdate s


zbisect.<locals>.mayupdatescurrents>current bisect revision is unknown - start a new bisect to fixs"current bisect revision is a merge�empty revision setr�sHG_NODEsbisect_check)�environ�
blockedtag�}�sfailed to execute %ss	%s killedr/schangeset %s: %s
Frs!Extending search to changeset %s
snothing to extend)rr:s:Testing changeset %s (%d changesets remaining, ~%d tests)
)T)%�warnrr�rrQ�boolr��tuple�sortedrZ
resetstateZ
load_stater r�rZ
save_state�changesetdisplayer�LookupErrorrOrrrr�Z
restore_state�systemr�AbortrZformat_changeset_summaryrSZ
checkstate�bisectZprintresultZextendranger�rr�)r4rTZpositional_1Zpositional_2�command�resetZgoodr�r��extendr>r��cmdZenabledr1�nodesr?�	displayer�
changesetsr�r*rSZ
transitionr��summaryZbgoodZ	extendctxZtests�sizerW)r9r>rTrXrMvs�r

�	�

��

�




2

��

���
rMsbookmarks|bookmark�forcesrevision for bookmark action�deletesdelete a given bookmark�m�renamesrename a given bookmarksOLD�i�inactivesmark a bookmark inactive�listslist existing bookmarkss#hg bookmarks [OPTIONS]... [NAME]...cOs�t�|�}|�d�}|�d�}|�d�}t�|ddd�}|rNt�||dg�n|sV|r\d}n|rfd}nd}t�|dddg�|s�|dvr�t�td	���|d
v�r"|�	���d|�
���8|�d���
}|dkr�t�|j
j|�}t�|||�n�|dk�rT|�st�td���nt|�d
k�r*t�td���|j
�|d�}	t�|||	|d||�nl|dk�rtt�||||||�nL|dk�r�t|j
�dk�r�|�td��n"|j�s�|�td��n
t�|�Wd�n1�s�0YWd�n1�s�0YWd�n1�s0Ynh|dk�r|t�|j
j|�}|�d|�� }
t�|||
|�Wd�n1�sp0Ynt�d|��dS)axcreate a new bookmark or list existing bookmarks

    Bookmarks are labels on changesets to help track lines of development.
    Bookmarks are unversioned and can be moved, renamed and deleted.
    Deleting or moving a bookmark has no effect on the associated changesets.

    Creating or updating to a bookmark causes it to be marked as 'active'.
    The active bookmark is indicated with a '*'.
    When a commit is made, the active bookmark will advance to the new commit.
    A plain :hg:`update` will also advance an active bookmark, if possible.
    Updating away from a bookmark will cause it to be deactivated.

    Bookmarks can be pushed and pulled between repositories (see
    :hg:`help push` and :hg:`help pull`). If a shared bookmark has
    diverged, a new 'divergent bookmark' of the form 'name@path' will
    be created. Using :hg:`merge` will resolve the divergence.

    Specifying bookmark as '.' to -m/-d/-l options is equivalent to specifying
    the active bookmark's name.

    A bookmark named '@' has the special property that :hg:`clone` will
    check it out by default if it exists.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions such as ``{bookmark}``. See also
      :hg:`help templates`.

      :active:  Boolean. True if the bookmark is active.

      Examples:

      - create an active bookmark for a new line of development::

          hg book new-feature

      - create an inactive bookmark as a place marker::

          hg book -i reviewed

      - create an inactive bookmark on another changeset::

          hg book -r .^ tested

      - rename bookmark turkey to dinner::

          hg book -m turkey dinner

      - move the '@' bookmark from another branch::

          hg book -f @

      - print only the active bookmark name::

          hg book -ql .
    rWrmr\rXrZr]rZ>rZrXsbookmark name required>rZrXrZr\�bookmarksnew bookmark name requiredrs"only one new bookmark name allowedrsno bookmarks set
sno active bookmark
N�	bookmarkssinvalid action: %s)r(r_rMr�check_at_most_one_argrrrQrr�r��transaction�maplist�
_bookmarks�
expandnamer�deleter��renameZaddbookmarksrS�_activebookmarkZ
deactivaterZprintbookmarks�ProgrammingError)r4rT�namesrU�forcer�Zinactive�action�trZoldnamer�rWrWrX�bookmark�sXJ




�
&
�

l
2rm�branchs5set branch name even if it shadows an existing branch�C�cleans'reset branch name to parent branch names0change branches of the given revs (EXPERIMENTAL)s[-fC] [NAME]c	Ks�t�|�}|�d�}|r |��}|�d�sX|sX|r@t�td���|�d|j�	��dS|�
���4|�d�r�|d�	�}|j�|�|�td�|�n�|�r�t
�||d�|r�t�|||||�Wd�S|�d	��s||��v�r|d
d�|d��D�v�rtjtd�td
�d��|j�|�|�td�|�|����D]0\}}}}|dk�rH|�sHWd�dS�qH|�td��Wd�n1�s�0YdS)aset or show the current branch name

    .. note::

       Branch names are permanent and global. Use :hg:`bookmark` to create a
       light-weight bookmark instead. See :hg:`help glossary` for more
       information about named branches and bookmarks.

    With no argument, show the current branch name. With one argument,
    set the working directory branch name (the branch will not exist
    in the repository until the next commit). Standard practice
    recommends that primary development take place on the 'default'
    branch.

    Unless -f/--force is specified, branch will not let you set a
    branch name that already exists.

    Use -C/--clean to reset the working directory branch to that of
    the parent of the working directory, negating a previous branch
    change.

    Use the command :hg:`update` to switch to an existing branch. Use
    :hg:`commit --close-branch` to mark this branch head as closed.
    When all heads of a branch are closed, the branch will be
    considered closed.

    Returns 0 on success.
    rmrps*no branch name specified for the revisions�%s
Nr=s%reset working directory to branch %s
rnrWcSsg|]}|���qSrW�r �r�r�rWrWrXr�Pr=zbranch.<locals>.<listcomp>s(a branch of the same name already existssuse 'hg update' to switch to itrKs&marked working directory as branch %s
�defaultrs>(branches are permanent and global, did you want a bookmark?)
)r(r_rM�striprrQrr�rr r�r&rSr.�
checknewlabelrZchangebranch�	branchmapr�iterbranches)	r4rT�labelrU�revsr�r��t�crWrWrXr sH1

�
 ���r �branches�actives8show only branches that have unmerged heads (DEPRECATED)�closedsshow normal and closed branchess$show branch name(s) of the given revs[-c])rG�intentsc
st�|�}|�d�}d}|rDt�||�}|��j��fdd�|D�}|�d�|�d|�}|j	}t
|���}	g}
|���
�D]\\}}}
}|dur�||vr�q|d}|s�t
|���|��}t||	@�}|
�|||
||f�q||
jdd�d	d
�|
D�]\}}}}|�r|�sq�|�rd}d}n(|�s8|�s*q�d
}td�}nd}td�}||j��k}|�r\d}|��|jdd||d�|��}tdtd|�t�|�d�}d|d}|j|jd||||���d|��d�|j |d�|j!|||d�|j�s|�"|�|�"d�q�|�#�dS)a�list repository named branches

    List the repository's named branches, indicating which ones are
    inactive. If -c/--closed is specified, also list branches which have
    been marked closed (see :hg:`commit --close-branch`).

    Use the command :hg:`update` to switch to an existing branch.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions such as ``{branch}``. See also
      :hg:`help templates`.

      :active:  Boolean. True if the branch is active.
      :closed:  Boolean. True if the branch is closed.
      :current: Boolean. True if it is the current branch.

    Returns 0.
    rmNcsh|]}�|�d�qS)rrW�r��r�ZgetbirWrX�	<setcomp>�r=zbranches.<locals>.<setcomp>r}FcSs |d|d��|d|dfS)Nr:rr�r�)r<rWrWrXr��r=zbranches.<locals>.<lambda>T)�key�reversesbranches.activer=sbranches.closeds	 (closed)sbranches.inactives (inactive)sbranches.currentrnr��ry�r�rr�s %d:%s�rev nodeslog.changeset changeset.%sr�)�active�closed�currentr�)$r(r_rMr r�ZrevbranchcacheZ
branchinfor�r�hexfunc�set�headsrwrxZiteropenrFr��sortrrr r�r�r�r�r�rr��	condwriter�r��phasestrr�r�r�r�)r4rTr�r�rUrzZselectedbranchesr�r�Zallheads�branches�tagr�r(ZisclosedZisactiveZ	openheadsr�ZisopenryZnoticer�r�Zpadsizer�rWr�rXr�fsp)




 

�
r��bundles*run even when the destination is unrelateds3a changeset intended to be added to the destinations*a specific branch you would like to bundlesBRANCH�bases;a base changeset assumed to be available at the destination�alls'bundle all changesets in the repository�bzip2sbundle compression type to usesD[-f] [-t BUNDLESPEC] [-a] [-r REV]... [--base REV]... FILE [DEST]...cs�t�|�}d}d|vr@|d}t��|�}|r@|s@t�td���|�dd���}zt	j
�|dd�}Wn>tjy�}	z$tjt�|	�td�d	��WYd}	~	n
d}	~	00|j
d
}
|
dkr�tjtd�td
�d	��|�d��r|r�t�td���|�d��r|�td��tg}nt��|�d��}|
t���v�r@t�td�|
��|�r�|�rZt�td����fdd�|D�}|�r��fdd�|D�nd}
t��||
�}|j}|j}n�t�}t�}t��||�D]�}t��||j�}|du�r�fdd�|D�}nd}|jgf}t���||�\}}|�r(t��j |��p*|}
tj!�||
|�d�dd�}|�"|j�|�"|j��q�|�s�t#�$|�|�oz|�dS|
�r�tj�||
d�}ntj�|d�}t%|�|_|
dk�r�d|j&}d}n$|
d v�r�d!}|j&}nt�'d"|
��i}|�(d#d$|j)�}|du�r|�(d#d%�}|du�r.||d&<|�(d#d'|j)�}|du�rV|�(d#d(�}|du�rh||d)<|j*}|d#d*�|d#d+�|d#d,�d-�}|j
�"|�t+j,|�d.||||j
||d/�	dS)0a�create a bundle file

    Generate a bundle file containing data to be transferred to another
    repository.

    To create a bundle containing all changesets, use -a/--all
    (or --base null). Otherwise, hg assumes the destination will have
    all the nodes you specify with --base parameters. Otherwise, hg
    will assume the repository has all the nodes in destination, or
    default-push/default if no destination is specified, where destination
    is the repositories you provide through DEST option.

    You can change bundle format with the -t/--type option. See
    :hg:`help bundlespec` for documentation on this format. By default,
    the most appropriate format is used and compression defaults to
    bzip2.

    The bundle file can then be transferred using conventional means
    and applied to another repository with the unbundle or pull
    command. This is useful when direct push and pull are not
    available or when exporting an entire repository is undesirable.

    Applying bundles preserves all changeset contents including
    permissions, copy/rename information, and revision history.

    Returns 0 on success, 1 if no changes found.
    Nrmsno commits to bundler�r�F)�stricts8see 'hg help bundlespec' for supported values for --typerKs
cg.versionss1s0packed bundles cannot be produced by "hg bundle"s%use 'hg debugcreatestreamclonebundle'r�s2--all is incompatible with specifying destinationsr�s,ignoring --base because --all was specified
s-repository does not support bundle version %ss3--base is incompatible with specifying destinationscsg|]}�|���qSrWr�r�r�rrWrXr�Dr=zbundle.<locals>.<listcomp>csg|]}�|���qSrWrr�rrWrXr�Er=csg|]}�|���qSrW�rr�rrWrXr�Or=rWT)�	onlyheadsrjZportabler)�missingrootsZancestorsof)r�s01sHG10)s02s03sHG20s)bundle: unexpected changegroup version %ssexperimentalsbundlecomplevel.sbundlecomplevelslevelsbundlecompthreads.sbundlecompthreadssthreadssevolution.bundle-obsmarkers$evolution.bundle-obsmarker:mandatorys
bundle-phases)sobsolescencesobsolescence-mandatory�phasesr�)�compression�compopts)-r(r_r r�rrQrrM�lowerr
ZparsebundlespecZUnsupportedBundleSpecificationr��contentoptsrErrZsupportedoutgoingversionsrLr�outgoing�missing�excludedr�r;�get_push_pathsr�peer�rawlocr �
addbranchrevsrbr�findcommonoutgoing�updater.ZnochangesfoundrHZwirecompressionrhZ	configintr��
configboolrZwritenewbundle)r4rT�fname�destsrUrzZ
revstringsZ
bundletypeZ
bundlespecrZ	cgversion�base�commonr�r�r�r�r��otherZhex_revsr�Z	head_revs�checkoutZbversionZbcompressionr�Z	complevelZcompthreadsZcfgr�rWrrX�bundle�s�G
�
�
��
��

�����



�
�


�

���r��cat�o�outputs(print output to file with formatted namesFORMATsprint the given revisionsdecodes apply any matching decode filters[OPTION]... FILE...)rGr[r�c
	Os�t�|�}|�d�}|r(t�||gd�}t�||�}t�||f||�}|�dd�}t	�
|�rbd}|rvt�|d|�}	n|�
d�|�d|�}	|	�4t	j|||||	|dfit�|���Wd�S1s�0YdS)a�output the current or given revision of files

    Print the specified files as they were at the given revision. If
    no revision is given, the parent of the working directory is used.

    Output may be to a file, in which case the name of the file is
    given using a template string. See :hg:`help templates`. In addition
    to the common template keywords, the following formatting rules are
    supported:

    :``%%``: literal "%" character
    :``%s``: basename of file being printed
    :``%d``: dirname of file being printed, or '.' if in repository root
    :``%p``: root-relative path name of file being printed
    :``%H``: changeset hash (40 hexadecimal digits)
    :``%R``: changeset revision number
    :``%h``: short-form changeset hash (12 hexadecimal digits)
    :``%r``: zero-padded changeset revision number
    :``%b``: basename of the exporting repository
    :``\``: literal "\" character

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :data:    String. File content.
      :path:    String. Repository-absolute path of the file.

    Returns 0 on success.
    rmr~r�r=r�N)r(r_rMr.r�r r�r^�popr�isstdiofilenamer�
nullformatterr��catr)
r4rTZfile1rbrUr�r�rc�
fntemplater�rWrWrXr��s&6



��r�sclonesEthe clone will include an empty working directory (only a repository)�	updaterevs%revision, tag, or branch to check outsEdo not clone everything, but include this changeset and its ancestorssQdo not clone everything, but include this branch's changesets and their ancestors�pulls"use pull protocol to copy metadata�uncompresseds!an alias to --stream (DEPRECATED)�streams"clone with minimal data processings[OPTION]... SOURCE [DEST])rGrH�norepocKs�t�|�}t�|dd�d\}}|�d�rjt�}t�}|�d�rPt�|�d��}|�d�rjt�|�d��}tj	|||||�d�|�d�p�|�d	�|�d
�|�d�p�|�d�|�d�|�d�|||�d
�p�dd�
}|duS)a�make a copy of an existing repository

    Create a copy of an existing repository in a new directory.

    If no destination directory name is specified, it defaults to the
    basename of the source.

    The location of the source is added to the new repository's
    ``.hg/hgrc`` file, as the default to be used for future pulls.

    Only local paths and ``ssh://`` URLs are supported as
    destinations. For ``ssh://`` destinations, no working directory or
    ``.hg/hgrc`` will be created on the remote side.

    If the source repository has a bookmark called '@' set, that
    revision will be checked out in the new repository by default.

    To check out a particular version, use -u/--update, or
    -U/--noupdate to create a clone with no working directory.

    To pull only a subset of changesets, specify one or more revisions
    identifiers with -r/--rev or branches with -b/--branch. The
    resulting clone will contain only the specified changesets and
    their ancestors. These options (or 'clone src#rev dest') imply
    --pull, even for local source repositories.

    In normal clone mode, the remote normalizes repository data into a common
    exchange format and the receiving end translates this data into its local
    storage format. --stream activates a different clone mode that essentially
    copies repository files from the remote with minimal data processing. This
    significantly reduces the CPU cost of a clone both remotely and locally.
    However, it often increases the transferred data size by 30-40%. This can
    result in substantially faster clones where I/O throughput is plentiful,
    especially for larger repositories. A side-effect of --stream clones is
    that storage settings and requirements on the remote are applied locally:
    a modern client may inherit legacy or inefficient storage used by the
    remote or a legacy Mercurial client may not be able to clone from a
    modern Mercurial remote.

    .. note::

       Specifying a tag will include the tagged changeset but not the
       changeset containing the tag.

    .. container:: verbose

      For efficiency, hardlinks are used for cloning whenever the
      source and destination are on the same filesystem (note this
      applies only to the repository data, not to the working
      directory). Some filesystems, such as AFS, implement hardlinking
      incorrectly, but do not report errors. In these cases, use the
      --pull option to avoid hardlinking.

      Mercurial will update the working directory to the first applicable
      revision from this list:

      a) null if -U or the source repository has no changesets
      b) if -u . and the source repository is local, the first parent of
         the source repository's working directory
      c) the changeset specified with -u (if a branch name, this means the
         latest head of that branch)
      d) the changeset specified with -r
      e) the tipmost head specified with -b
      f) the tipmost head specified with the url#branch source syntax
      g) the revision marked with the '@' bookmark, if present
      h) the tipmost head of the default branch
      i) tip

      When cloning from servers that support it, Mercurial may fetch
      pre-generated data from a server-advertised URL or inline from the
      same stream. When this is done, hooks operating on incoming changesets
      and changegroups may fire more than once, once for each pre-generated
      bundle and as well as for any additional remaining data. In addition,
      if an error occurs, the repository may be rolled back to a partial
      clone. This behavior may change in future releases.
      See :hg:`help -e clonebundles` for more.

      Examples:

      - clone a remote repository to a new directory named hg/::

          hg clone https://www.mercurial-scm.org/repo/hg/

      - create a lightweight local clone::

          hg clone project/ project-feature/

      - clone from an absolute path on an ssh server (note double-slash)::

          hg clone ssh://user@server//home/projects/alpha/

      - do a streaming clone while checking out a specified version::

          hg clone --stream http://server/repo -u 1.5

      - create a repository without changesets after a particular revision::

          hg clone -r 04e544 experimental/ good/

      - clone (and track) a particular named branch::

          hg clone https://www.mercurial-scm.org/repo/hg/#stable

    See :hg:`help urls` for details on specifying URLs.

    Returns 0 on success.
    r7r�)NNsnarrow�include�excluder�r�r�rmrns	shareoptssdepthN)	�pull�streamrzr�r Z	shareoptsZstoreincludepatsZstoreexcludepats�depth)
r(r_rr`rMr�r#Z
parsepatternsr�clone)r4�sourcer�rUZincludepatsZexcludepatsr�rWrWrXr��s6



�r�s	commit|ci�As9mark new/missing files as added/removed before committingsclose-branchsmark a branch head as closed�amends)amend the parent of the working directory�secrets#use the secret phase for committingsforce-close-branchs:forcibly close branch from a non-head changeset (ADVANCED)�interactivesuse interactive modec	Osz|���^|���6t||g|�Ri|��Wd�Wd�S1sN0YWd�n1sl0YdS)a�commit the specified files or all outstanding changes

    Commit changes to the given files into the repository. Unlike a
    centralized SCM, this operation is a local operation. See
    :hg:`push` for a way to actively distribute your changes.

    If a list of files is omitted, all changes reported by :hg:`status`
    will be committed.

    If you are committing the result of a merge, do not provide any
    filenames or -I/-X filters.

    If no commit message is specified, Mercurial starts your
    configured editor where you can enter a message. In case your
    commit fails, you will find a backup of your message in
    ``.hg/last-message.txt``.

    The --close-branch flag can be used to mark the current branch
    head closed. When all heads of a branch are closed, the branch
    will be considered closed and no longer listed.

    The --amend flag can be used to amend the parent of the
    working directory with a new commit that contains the changes
    in the parent in addition to those currently reported by :hg:`status`,
    if there are any. The old commit is stored in a backup bundle in
    ``.hg/strip-backup`` (see :hg:`help bundle` and :hg:`help unbundle`
    on how to restore it).

    Message, user and date are taken from the amended commit unless
    specified. When a message isn't specified on the command line,
    the editor will open with the message of the amended commit.

    It is not possible to amend public changesets (see :hg:`help phases`)
    or changesets that have children.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    Returns 0 on success, 1 if nothing changed.

    .. container:: verbose

      Examples:

      - commit all files ending in .py::

          hg commit --include "set:**.py"

      - commit all non-binary files::

          hg commit --exclude "set:binary()"

      - amend the current commit and set the date to now::

          hg commit --amend --date now
    N)r�r��	_docommit�r4rTrbrUrWrWrXr�sVrcs.|�d�rH|�d�tj||tddtjg|�Ri|��}|dkrDdS|S|�d�rrt�|ddg�|�ddd	d
�tj|d	d�|d�	�}|�
|�}|j��}i�|�d�s�|�d
��r�d�d<|d�
��r(t�|d||�}|j|d�}	|	j�s|	j�s|	j�r|j
|d	d�}ntd�}
t�|
��|�sBt�td�|��n�||d�	�k�r�|d��|v�r�|�d
��s�td�}tjtd�|d��nF|�d��r�|d���	�|k�r�|d���	�|k�r�t�td���|�d��rr|�dd��r�t�td���|d}t�||��gd�t�|tj ��s2t�|�t�!|||�||�}
t"�#|�}|
|��k�r�|�td��dSnp�fdd�}t"�#|�}t�|||||�}
|
�s�t�$|||�}|j%�r�|�td�t&|j%��n|�td��dSt�'||
||||�|j(�s*|�dd��r*t||d	d	d	d	d	|�d �d!�dS)"N�interactiveFrrr��amendrscommitsubreposTr�)rZclose_branchZforce_close_branch�1scloser=)r^�r�s1current revision is already a branch closing heads!branch "%s" has no heads to closesBuse --force-close-branch to close branch from a non-head changesetscan only close branch headsrKs+cannot amend with ui.commitsubrepos enabledr�rc	
s�i}|�d�rd|d<|j}|�|d���|�|d��jt�|dd�}tjfd|it�|���}|j||�d�|�d�||�d�Wd�Wd�S1s�0YWd�n1s�0YdS)	Nr�)r�s
new-commitr�s
commit.normalr	rrrv)r�extra)	rM�baseuir"rZ
mergeeditformr
r(rr)	r4rTrr^rUr,r�r	r�r�rWrXrbs,
����z_docommit.<locals>.commitfuncs4nothing changed (%d missing files, see 'hg status')
�commandsscommit.post-statusr�)�modified�added�removed�deleted�unknownr�))rMr�rZdorecordrZrecordfilterr�	setconfigrr r!rr(�closesbranchr.r^rSr�r�r�rrrQr�r�r*r�r-Zprecheckr�r$�	isenabled�createmarkersoptr�r(r_Zpostcommitstatusr�r�r)r�)r4rTrbrU�retr r+r(rj�sr.rL�oldr�r�statrWr�rXr�s�

���




��������


����r�sconfig|showconfig|debugconfig�	untrusteds$show untrusted configuration optionss
exp-all-knowns+show all known config option (EXPERIMENTAL)sedit user config�localsedit repository config�sources"show source of configuration value�shareds3edit shared source repository config (EXPERIMENTAL)s
non-shareds%edit non shared config (EXPERIMENTAL)�globalsedit global configs[-u] [NAME]...)rG�optionalrepor�cs�t����d}t�fdd�|D���r�tj�g|dd��R���d�rl|s\t�td���|j	�
d�g}n���d	�r�t��}nr��d
�r�|�
�s�t�td���tj|jvr�t�td���t�	|j��
d�g}n"��d
�r�|j	�
d�g}nt��}|D]}tj�|�r��qrq���d	��r&tjd	}n"��d��r>tjd}n
tjd}|d}t|d�}|�t�|��|��|��}	|jd|	|ftjtd�dd�dS|�d�|� d��}
t�!�D]d\}}|dk�r�|�"d|�n@|dk�r|�"d|d|df�n|dk�rnt�#d|���q�t$��d��}g}
}|�rZdd�|D�}
d d�|D�}t%|�dk�ol|
}t&|
�}
t&|�}d!}�d"}|j'�p���d#�}|j(||d$�}|D�]\}}}|�)|||�}t�*|�}|�+||�}|
�,��r�|�p�d%}|�-d&d'�}|d(|}|�r(||
v�s(||v�s(�q�|
�.�|
�/|d#d)|�|�rb|
j0|d*�|
�d+d,|�n|
�d-d.||�t �1|��r�|
j0|d/�n6t2|t3��r�t4d0d�|D���r�|
j0|
j5|d+d*�d/�d1}�q�|
�6�|�r�dSdS)2a2show combined config settings from all hgrc files

    With no arguments, print names and values of all config items.

    With one argument of the form section.name, print just the value
    of that config item.

    With multiple arguments, print names and values of all config
    items with matching section names or section.names.

    With --edit, start an editor on the user-level config file. With
    --global, edit the system-wide config file. With --local, edit the
    repository-level config file.

    With --source, the source (filename and line number) is printed
    for each config item.

    See :hg:`help config` for more information about config files.

    .. container:: verbose

      --non-shared flag is used to edit `.hg/hgrc-not-shared` config file.
      This file is not shared across shares when in share-safe mode.

      Template:

      The following keywords are supported. See also :hg:`help templates`.

      :name:    String. Config name.
      :source:  String. Filename and line number where the item is defined.
      :value:   String. Config value.

      The --shared flag can be used to edit the config file of shared source
      repository. It only works when you have shared using the experimental
      share safe feature.

    Returns 0 on success, 1 if NAME does not exist.

    )r�r�r�r��
non_sharedc3s|]}��|�VqdSr�r��r��o�rUrWrXr��r=zconfig.<locals>.<genexpr>rNr�s&can't use --local outside a repositoryshgrcr�r�s,repository is not shared; can't use --sharedsNshare safe feature not enabled; unable to edit shared source repository configr�shgrc-not-sharedrrrswbs%s "%s"sedit failedsconfig_edit)ZonerrZ	errprefixrBrBr�sread config from: %s
sresources!read config from: resource:%s.%s
sitemssunknown rctype: %sr�cSsg|]}d|vr|�qS�r=rW�r��vrWrWrXr�-	r=zconfig.<locals>.<listcomp>cSsg|]}d|vr|�qSr�rWr�rWrWrXr�.	r=Fs
exp_all_knownr�)�	untrusted�	all_known�noner�s\nr=s%s: ��namesvaluerqs
name values%s=%s
)�defaultvaluecss|]}t�|�VqdSr�)r�isprintable)r�rrWrWrXr�J	sT)7r(r_�anyrr`rMrrQrr7r�r)ZsystemrcpathZsharedr+ZSHARESAFE_REQUIREMENT�vfsmodZ
sharedpathZ
userrcpathr�r��exists�uimodZsamplehgrcsr	r�r5Ztonativeeol�closeZ	geteditorrKr�rZrccomponents�debugrhrFr�r�r�Z
walkconfigZconfigsourcer�Z
configdefaultr��replacer�r�r�r��
isinstance�list�all�
formatlistr�)r4rT�valuesrUZeditopts�pathsr�Z
samplehgrc�fprr�r{r�ZselsectionsZ
selentriesZ	uniquesel�matchedr�Zshow_source�entriesr�r��valuer�r�Z	entrynamerWr�rX�config�s�N

�


���



�






�
r	scontinuecKsp|�d�}t�|�}|s&t�td���|jsHtjtd�|j|��d��|rd|�	td�|j�dS|�||�S)z�resumes an interrupted operation (EXPERIMENTAL)

    Finishes a multistep operation like graft, histedit, rebase, merge,
    and unshelve if they are in an interrupted state.

    use --dry-run/-n to dry run the command.
    rIrJs1%s in progress but does not support 'hg continue'rKs %s in progress, will be resumed
N)
rMrrNrrOr�continuefuncrRZcontinuemsgrS)r4rTrUrVZ	contstaterWrWrX�continuecmdV	s

��rscopy|cpsforgets#unmark a destination file as copied�afters'record a copy that has already occurredsat-revs4(un)mark copies in the given revision (EXPERIMENTAL)s+forcibly copy over an existing managed files/[OPTION]... (SOURCE... DEST | --forget DEST...)cOsFt�|�}|��� t�||||�Wd�S1s80YdS)a0mark files as copied for the next commit

    Mark dest as having copies of source files. If dest is a
    directory, copies are put in that directory. If dest is a file,
    the source must be a single file.

    By default, this command copies the contents of files as they
    exist in the working directory. If invoked with -A/--after, the
    operation is recorded, but no copying is performed.

    To undo marking a destination file as copied, use --forget. With that
    option, all given (positional) arguments are unmarked as copies. The
    destination file(s) will be left in place (still tracked). Note that
    :hg:`copy --forget` behaves the same way as :hg:`rename --forget`.

    This command takes effect with the next commit by default.

    Returns 0 on success, 1 if errors are encountered.
    N�r(r_r�r�copyr�rWrWrXrv	s,

rs
debugcommandss	[COMMAND])rGr�cGsTtt�t��D]@\}}|�d�d}d�dd�|dD��}|�d||f�qdS)	z'list all available commands and options�|r�, cSsg|]}|d�qS)rrWr;rWrWrXr��	r=z!debugcommands.<locals>.<listcomp>rs%s: %s
N)rHr(�	iteritems�table�splitr�r�)r4rQ�argsZvalsrUrWrWrXr�	s	rs
debugcompletesoptionssshow the command optionss[-o] CMDcKs�|�d�r�g}tg}|r8t�|td�\}}|�|d�|D]H}|D]>}d|dvrVqD|drp|�d|d�|�d|d�qDq<|�d	d
�|��dSt�|t�\}	}
|j	r�dd
�|	�
�D�}	|�d	d
�t|	���dS)z=returns the completion list associated with the given command�optionsFrs(DEPRECATED)r�rs-%ss--%srqr�NcSsg|]}d�|d��qS)r�r)r��r�r|rWrWrXr��	r=z!debugcomplete.<locals>.<listcomp>)rM�
globaloptsrZfindcmdrr�r�r�Zfindpossible�verboserrH)r4rQrUrZotables�aliases�entryr{r�ZcmdlistZunused_allcmdsrWrWrX�
debugcomplete�	s&

r�diffsrevision (DEPRECATED)�fromsrevision to diff fromsREV1�tosrevision to diff tosREV2�changeschange made by revisions<[OPTION]... ([-c REV] | [--from REV1] [--to REV2]) [FILE]...)rGrHr[r�cOsrt�|dd�t�|�}|�d�}|�d�}|�d�}|�d�}|�d�}|�d�}	t�|dddg�t�|dddg�|r�t�||gd	�}t�	||d
�}
t�
|
�}nZ|s�|r�t�||g|gd	�}t�	||d
�}t�	||d
�}
nt�||d	�}t�||�\}}
|	�r|
}|}
n|}|
}
t�
||�}t�|
||�}|�|�}|�d�tj|||||
|||�d�|�d
�d�	d
S)a�diff repository (or selected files)

    Show differences between revisions for the specified files.

    Differences between files are shown using the unified diff format.

    .. note::

       :hg:`diff` may generate unexpected results for merges, as it will
       default to comparing against the working directory's first
       parent changeset if no revisions are specified.

    By default, the working directory files are compared to its first parent. To
    see the differences from another revision, use --from. To see the difference
    to another revision, use --to. For example, :hg:`diff --from .^` will show
    the differences from the working copy's grandparent to the working copy,
    :hg:`diff --to .` will show the diff from the working copy to its parent
    (i.e. the reverse of the default), and :hg:`diff --from 1.0 --to 1.2` will
    show the diff between those two revisions.

    Alternatively you can specify -c/--change with a revision to see the changes
    in that changeset relative to its first parent (i.e. :hg:`diff -c 42` is
    equivalent to :hg:`diff --from 42^ --to 42`)

    Without the -a/--text option, diff will avoid generating diffs of
    files it detects as binary. With -a, diff will generate a diff
    anyway, probably with undesirable results.

    Use the -g/--git option to generate diffs in the git extended diff
    format. For more information, read :hg:`help diffs`.

    .. container:: verbose

      Examples:

      - compare a file in the current working directory to its parent::

          hg diff foo.c

      - compare two historical versions of a directory, with rename info::

          hg diff --git --from 1.0 --to 1.2 lib/

      - get change stats relative to the last change on some date::

          hg diff --stat --from "date('may 2')"

      - diff all newly-added files that contain a keyword::

          hg diff "set:added() and grep(GNU)"

      - compare a revision and its parents::

          hg diff -c 9353                  # compare against first parent
          hg diff --from 9353^ --to 9353   # same using revset syntax
          hg diff --from 9353^2 --to 9353  # compare against the second parent

    Returns 0 on success.
    r��changermrrr�statsreverser~Nrr��root)r��listsubreposr�)rr`r(r_rMrr.r�r r�Zdiff_parent�revpairr&�diffalloptsr^Znarrowmatchr�Zdiffordiffstat)r4rTrbrUrzr Zfrom_revZto_revr�r��ctx2�ctx1ZctxleftZctxrightr�rcrWrWrX�diff�	sTO






�

�r(�export�Br^s/export changes only reachable by given bookmarksBOOKMARKs
switch-parentsdiff against the second parentsrevisions to exports*[OPTION]... [-o OUTFILESPEC] [-r] [REV]...)rGrHr�cOsTt�|�}|�d�}|t|�dg��7}t�|dd�|rd||jvrVt�t	d�|��t
�||�}n$|sndg}t
�||d�}t
�||�}|s�t�t	d���t|�dkr�|�t	d��n|�t	d	��|�d
�}t�|�r�d}|r�t�|d|�}n|�d�|�d|�}|�4tj|||||�d
�t�||�d�Wd�n1�sF0YdS)a�	dump the header and diffs for one or more changesets

    Print the changeset header and diffs for one or more revisions.
    If no revision is given, the parent of the working directory is used.

    The information shown in the changeset header is: author, date,
    branch name (if non-default), changeset hash, parent(s) and commit
    comment.

    .. note::

       :hg:`export` may generate unexpected diff output for merge
       changesets, as it will compare the merge changeset against its
       first parent only.

    Output may be to a file, in which case the name of the file is
    given using a template string. See :hg:`help templates`. In addition
    to the common template keywords, the following formatting rules are
    supported:

    :``%%``: literal "%" character
    :``%H``: changeset hash (40 hexadecimal digits)
    :``%N``: number of patches being generated
    :``%R``: changeset revision number
    :``%b``: basename of the exporting repository
    :``%h``: short-form changeset hash (12 hexadecimal digits)
    :``%m``: first line of the commit message (only alphanumeric characters)
    :``%n``: zero-padded sequence number, starting at 1
    :``%r``: zero-padded changeset revision number
    :``\``: literal "\" character

    Without the -a/--text option, export will avoid generating diffs
    of files it detects as binary. With -a, export will generate a
    diff anyway, probably with undesirable results.

    With -B/--bookmark changesets reachable by the given bookmark are
    selected.

    Use the -g/--git option to generate diffs in the git extended diff
    format. See :hg:`help diffs` for more information.

    With the --switch-parent option, the diff will be against the
    second parent. It can be useful to review a merge.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :diff:    String. Diff content.
      :parents: List of strings. Parent nodes of the changeset.

      Examples:

      - use export and import to transplant a bugfix to the current
        branch::

          hg export -r 9353 | hg import -

      - export all the changesets between two revisions to a file with
        rename information::

          hg export --git -r 123:150 > changes.txt

      - split outgoing changes into a series of patches with
        descriptive names::

          hg export -r "outgoing()" -o "%n-%m.patch"

    Returns 0 on success.
    r^rmsbookmark '%s' not foundr=r~s&export requires at least one changesetrsexporting patches:
sexporting patch:
r�r=r)s
switch_parent)r�Z
switch_parentrUN)r(r_rMrGrr`rcrrQrr.Zbookmarkrevsr�r r�r��noter�rr�r��exportr&r%)r4rTrTrUrmrzr�r�rWrWrXr,V
sBe






�r,r�s%search the repository as it is in REV�0�print0s*end filenames with NUL, for use with xargscOs�t�|�}|�d�}|r(t�||gd�}t�||d�}d}|�d�rHd}d|}t�|||�}|�d�tj	|�
�d	d
�}	|�d|��,}
t�
||||	|
||�d��Wd�S1s�0YdS)aVlist tracked files

    Print files under Mercurial control in the working directory or
    specified revision for given files (excluding removed files).
    Files can be specified as filenames or filesets.

    If no files are given to match, this command prints the names
    of all files under Mercurial control.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :flags:   String. Character denoting file's symlink and executable bits.
      :path:    String. Repository-absolute path of the file.
      :size:    Integer. Size of the file in bytes.

      Examples:

      - list all files under the current directory::

          hg files .

      - shows sizes and flags for current revision::

          hg files -vr .

      - list all files named README::

          hg files -I "**/README"

      - list all binary files::

          hg files "set:binary()"

      - find files containing a regular expression::

          hg files "set:grep('bob')"

      - search tracked file contents with xargs and grep::

          hg files -0 | xargs -0 grep foo

    See :hg:`help patterns` and :hg:`help filesets` for more information
    on specifying file patterns.

    Returns 0 if a match is found, 1 otherwise.

    rmr~Nr�r.�r�r�Tr\r�)r(r_rMr.r�r r�r^r�r`rTrr�files)r4rTrbrUr�r�r�r�rcrdr�rWrWrXr0�
s N



�r0c	
Os|t�|�}|st�td���t�|d||�}|�d�|�d�}}tj|dd�}t	j
|||d|d||d	�d
}|rxdpzd
S)a�forget the specified files on the next commit

    Mark the specified files so they will no longer be tracked
    after the next commit.

    This only removes files from the current branch, not from the
    entire project history, and it does not delete them from the
    working directory.

    To delete the file from the working directory, see :hg:`remove`.

    To undo a forget before the next commit, see :hg:`add`.

    .. container:: verbose

      Examples:

      - forget newly-added binary files::

          hg forget "set:added() and binary()"

      - forget files that would be excluded by .hgignore::

          hg forget "set:hgignore()"

    Returns 0 on success.
    �no files specifiedN�dry_runr�Tr\r=F)r�rdZexplicitonlyrVr�rr)r(r_rrQrr.r^rMr`r�forget)	r4rTrbrUrcrVr�rdrerWrWrXr3Js&)
�	�
r3�graftsrevisions to grafts3base revision when doing the graft merge (ADVANCED)sresume interrupted graftsstopsstop interrupted graftsabort interrupted graft�logs append graft info to log messages9don't commit, just apply the changes in working directorysforce graft�Dscurrentdates&record the current date as commit datescurrentusers$record the current user as committers[OPTION]... [-r REV]... REV...cOsD|���(t||g|�Ri|��Wd�S1s60YdS)a�copy changes from other branches onto the current branch

    This command uses Mercurial's merge logic to copy individual
    changes from other branches without merging branches in the
    history graph. This is sometimes known as 'backporting' or
    'cherry-picking'. By default, graft will copy user, date, and
    description from the source changesets.

    Changesets that are ancestors of the current revision, that have
    already been grafted, or that are merges will be skipped.

    If --log is specified, log messages will have a comment appended
    of the form::

      (grafted from CHANGESETHASH)

    If --force is specified, revisions will be grafted even if they
    are already ancestors of, or have been grafted to, the destination.
    This is useful when the revisions have since been backed out.

    If a graft merge results in conflicts, the graft process is
    interrupted so that the current merge can be manually resolved.
    Once all conflicts are addressed, the graft process can be
    continued with the -c/--continue option.

    The -c/--continue option reapplies all the earlier options.

    .. container:: verbose

      The --base option exposes more of how graft internally uses merge with a
      custom base revision. --base can be used to specify another ancestor than
      the first and only parent.

      The command::

        hg graft -r 345 --base 234

      is thus pretty much the same as::

        hg diff --from 234 --to 345 | hg import

      but using merge to resolve conflicts and track moved files.

      The result of a merge can thus be backported as a single commit by
      specifying one of the merge parents as base, and thus effectively
      grafting the changes from the other side.

      It is also possible to collapse multiple changesets and clean up history
      by specifying another ancestor as base, much like rebase --collapse
      --keep.

      The commit message can be tweaked after the fact using commit --amend .

      For using non-ancestors as the base to backout changes, see the backout
      command and the hidden --parent option.

    .. container:: verbose

      Examples:

      - copy a single change to the stable branch and edit its description::

          hg update stable
          hg graft --edit 9393

      - graft a range of changesets with one exception, updating dates::

          hg graft -D "2085::2093 and not 2091"

      - continue a graft after resolving conflicts::

          hg graft -c

      - show the source of a grafted changeset::

          hg log --debug -r .

      - show revisions sorted by date::

          hg log -r "sort(all(), date)"

      - backport the result of a merge as a single commit::

          hg graft -r 123 --base 123^

      - land a feature branch as one changeset::

          hg up -cr default
          hg graft -r featureX --base "ancestor('featureX', 'default')"

    See :hg:`help revisions` for more about specifying revisions.

    Returns 0 on successful completion, 1 if there are unresolved files.
    N)r��_dograft)r4rTrzrUrWrWrX�graft�s

r8cs�|r|�d�r|�td��t|�}|�|�d��i}g|d<t�||�tjfddi|��}t�|ddd�d	}|�d
�r�t�	|d
gd��t
��d�}|�d�r�t�	|dgd
��t|�|�S|�d�r�t�	|dgd
��t�
|�|�S|�d��r�d}|�rt�td���|���r�t��|�}|�d��r@|d|d<|�d��rX|d|d<|�d��rld|d<|�d��r�|�d�|d
<|�d��r�|�d�|d<|d}�fdd�|D�}nt��td��n4|�s�t�td���t���t���t��|�}t��d}	|�d��r*t��|dd�}	|	du�rd��d|�D]"}
|�td�|
���|
��q@�fdd�|D�}|�s�d S|	du�r�t|�d!k�r�t�td"���|�s�|�d#��s�|	du�r��d$|���D] }
|�td%�|
�|
f��q҇fd&d�|D�}|�sd Si}��d'|�D]6}|��||��<|���d(�}
|
�r |��||
<�q |�d)���d*�d+��|�D�]^}
�|
}|���d(�}
|
|v�r�z�|
��}Wntj �y�d}Yn0||v�r�|�td,�|�||
|f�|�!|�n�||
|v�r�|du�rH|�td-�||
�||
|
||
dd.�f�n2|�td/�||
�||
|
|||
dd.�f�|�!||
�nL|��|v�rx||��}||v�rx|�td0�|�||
|f�|�!|��qx|�s�d S|�d
��r�d|d<|�d��r|d|d<t"��d'|��D�]|\}}d1|��||�#��$d2d!�d3f}��%|�&����'|�&��}|�r�|d4d5�(|�7}|�)td6�|�|�d7��r��q |���d(�}i}|�r�||d(<|��|d8<n|��|d(<|�*�}|�d��r|d}||d<|�+�}|�d��r$|d}||d<|�#�}|�d��rP|d9|��7}d|d<|�s d:|�d;d<�i}|	du�rx|�,�n|	}|�-|d��$t.�/�||gd=��}Wd�n1�s�0Y|j0d3k�r$�fd>d�||d�D�}||d<d!}|�1||�|�td?��|�td@��d!Snd	}|�d
��s �j2|||||dA�}|du�rj|�tdB�|��|f�n2|�d�du�r |d}t3|t��s�J�|�4|��q |�d7��s�|�5�d3S)CNr�sLwarning: inconsistent use of --rev might give unexpected revision ordering!
snewnodesr	r4rY�stop�continueFr�)r
�currentuser�currentdate�log�
graftstate)r
r=r�r�r<r;r�Ts&can't specify --continue and revisionsrvr�rrr�r5r=rr�r�snodescsg|]}�|���qSrWr�)r�r�rrWrXr�dr=z_dograft.<locals>.<listcomp>sno revisions specifieds%ld and merge()s'skipping ungraftable merge revision %d
csg|]}|�vr|�qSrWrWr�)�skippedrWrXr�wr=r�rs&only one revision allowed with --base rjs%ld & (::.)s!skipping ancestor revision %d:%s
csg|]}|�vr|�qSrWrWr�)�	ancestorsrWrXr��r=s%ldr�sscanning for duplicate grafts
sonly(%d,ancestor(%ld))r=s3skipping revision %d:%s (already grafted to %d:%s)
sKskipping already grafted revision %d:%s (%d:%s also has unknown origin %s)
rsFskipping already grafted revision %d:%s (%d:%s also has origin %d:%s)
sAskipping already grafted revision %d:%s (was grafted from %d:%s)
s
%d:%s "%s"r�r� (%s)r�sgrafting %s
rIsintermediate-sources
(grafted from %s)r�toolr=)r�r4sparent of graftcsg|]}�|���qSrWr�r�rrWrXr��r=s,abort: unresolved conflicts, can't continue
s-(use 'hg resolve' and 'hg graft --continue')
)r�r�r�r�rs2note: graft of %d:%s created no changes to commit
)6rMrErrrPrZresolve_commit_optionsr
r`r�statemodZcmdstate�
_stopgraftZ
abortgraftrrQr�Zreadgraftstate�wrongtooltocontinuerrr r�r�r�rzrar�r�rr�r�ZRepoLookupError�remove�	enumerate�descriptionrZnodetagsr�Z
nodebookmarksr�rSr�r�r�r"r#r8r$Zsaverr�r�re)r4rTrzrUZ	statedatarZcont�
graftstaterRZbasectxr�Zidsr�r�r��posZdescrir�r�r�r�rr,r�r-Zstateversionr��nnrW)r@rTr?rXr7s���
�
�

�








���
� ���"��
�����$
�

��r7cCs`|��st�td���|d}t�|�|��|�td��|�td�|��dd��dS)zstop the interrupted graftsno interrupted graft foundr=sstopped the interrupted graft
sworking directory is now at %s
Nrr)	r�rrOrr#Zclean_updatererSr)r4rTrI�pctxrWrWrXrD
s
rDr>s6use 'hg graft --continue' or 'hg graft --stop' to stop)r��	clearableZstopflag�continueflagrP�cmdhint�grepsend fields with NULsan alias to --diff (DEPRECATED)sEsearch revision differences for when the pattern was added or removedsCfollow changeset history, or file history across copies and renamessignore-casesignore case when matchingsfiles-with-matchess-print only filenames and revisions that matchsprint matching line numberss*search files changed within revision ranges	all-filess>include all files in the changeset while grepping (DEPRECATED)s&[--diff] [OPTION]... PATTERN [FILE]...c
s t��dddg�t������d�p.��d����d�}��d�durT�sTd	�d<��d�ot��d
�ot��d����d�}�r�dg�d
<tj}��d�r�|tjO}ztj�	||��WnBtj
�y�}z&��td
�t
�|��WYd}~dSd}~00d\����d��rd��tj�|�|�|d�}	|	j�t�|��	���������	f	dd�}
�fdd��d}tj|��d
�d�d|||d�}t�||�\}
}��d���d��}|	�|
|�D]J\}}}}|
|||||�}|�p�|}|�rƈ�s�|�s�|	�||����q�|��|S)a�search for a pattern in specified files

    Search the working directory or revision history for a regular
    expression in the specified files for the entire repository.

    By default, grep searches the repository files in the working
    directory and prints the files where it finds a match. To specify
    historical revisions instead of the working directory, use the
    --rev flag.

    To search instead historical revision differences that contains a
    change in match status ("-" for a match that becomes a non-match,
    or "+" for a non-match that becomes a match), use the --diff flag.

    PATTERN can be any Python (roughly Perl-compatible) regular
    expression.

    If no FILEs are specified and the --rev flag isn't supplied, all
    files in the working directory are searched. When using the --rev
    flag and specifying FILEs, use the --follow argument to also
    follow the specified FILEs across renames and copies.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :change:  String. Character denoting insertion ``+`` or removal ``-``.
                Available if ``--diff`` is specified.
      :lineno:  Integer. Line number of the match.
      :path:    String. Repository-absolute path of the file.
      :texts:   List of text chunks.

      And each entry of ``{texts}`` provides the following sub-keywords.

      :matched: Boolean. True if the chunk matches the specified pattern.
      :text:    String. Chunk content.

      See :hg:`help templates.operators` for the list expansion syntax.

    Returns 0 if a match is found, 1 otherwise.

    �	all_filesrr(r�rrns	all_filesNTrmswdir()signore_cases grep: invalid match pattern: %s
r)r�r�r.r/)rQr(r�c
st���}|��r�	j}ntj}�	jr,d}nd}d}tj���fdd��}	ddi}
�rdt	�
||�}ndd	�|D�}|D�]�\}}
|��|j�d
�|j
|�t�����d�|j�
��dd
�dd|�dfdd|
j��d�dfg}��r|�dd|d|dk�rdndf�|�dd|������d�dfdd|����|���d�dfg�|D]P\}}}}}|�rv|j�dd
�|
�||�}|d|}|j|||||d
��qT��d��s�|j�dd
���d��s�|	��r�|�td��n�|jdd d!�|
�|���d}��d�rv�qqv|S)"Ns%Y-%m-%ds%a %b %d %H:%M:%S %Y %1%2FcsF���}zt�|�������WStjy@����YS0dSr�)r:�binary�read�filenoderZWdirUnsupportedr�)Zflog)r�r��getfilerWrXrR�
s
z%grep.<locals>.display.<locals>.binarys
linenumberr�cSsg|]}d|f�qS)r=rW)r�r�rWrWrXr��
r=z)grep.<locals>.display.<locals>.<listcomp>r�)r�r�s
grep.filenamer�rmr�r=r}rr�T�+sgrep.inserted s
grep.deleted rrrvsgrep.sepsgrep.%ssfiles_with_matchesrps Binary file matchesstextss{text}r�)r.r�r�r�r(r�r�r5r��grepmodZdifflinestatesr�r�r�r�r�r�ZlinenumrMr�rPr�Z
formatdater�r�rr�)r�r�r��pstates�statesr�Z
formatuserZdatefmt�foundrRZfieldnamemap�iterr r�Zcolsr�r�r�ZcondZextra_labelZfieldry)	r(�displaymatches�eolrUrU�	plaingrepr�r4rd)r�r�rX�display�
s�
��
���
����

zgrep.<locals>.displaycs�d}|���D]p\}}||krJ|��|�dd|j||��|jdd�|��|jdd|j||�dd�|jdd�|}q|t|j�kr�|��|�dd|j|d��|jdd�|��dS)	Nrrpr�F)rs
grep.matchr�T)Zfindposr�r��liner�r�r�)r�r�r�r�r)�regexprWrXr\szgrep.<locals>.displaymatchesFr�r�)rbrUZrevspecZinclude_patsZexclude_patsr�Zforce_changelog_traversalZfilter_revisions_by_patsrP)rrr(r_rM�re�M�Ir5�compilerrErr:�forcebytestrrWZgrepsearcherZ_getfiler.r`r �walkoptsZ
makewalkerr�rZsearchfilesZskipfiler�r�)r4rT�patternrbrUr�rQZreflags�instZsearcherr_rZZwoptsrzZmakefilematcherr�r�r�rXrYr�rW)
r(r\r]rUrUr^rar�r4rdrXr5
srg



�
�



���
Y�


r�headss1show only heads which are descendants of STARTREVsSTARTREV�toposshow topological heads onlys)show active branchheads only (DEPRECATED)s#show normal and closed branch headss[-ct] [-r STARTREV] [REV]...c
	s�t�|�}d}|�d�}|r>t��|gd��t��|d���}|�d�rb�fdd���|�D�}n<g}��	�D]}|��
|||�d��7}qn�fdd�|D�}|r·fd	d
�t��|�D���fdd�|D�}|�d�r�|r���|���fd
d�|D�}|�rhdd
�|D�}�|�rhd�dd��|D��}	t
d�}
|�d��rV|
t
d�|d7}
|�|
d|	�|�srdS|�d�t|dd�d�}t�|�|�}|D]}|�|��q�|��dS)a�show branch heads

    With no arguments, show all open branch heads in the repository.
    Branch heads are changesets that have no descendants on the
    same branch. They are where development generally takes place and
    are the usual targets for update and merge operations.

    If one or more REVs are given, only open branch heads on the
    branches associated with the specified changesets are shown. This
    means that you can use :hg:`heads .` to see the heads on the
    currently checked-out branch.

    If -c/--closed is specified, also show branch heads marked closed
    (see :hg:`commit --close-branch`).

    If STARTREV is specified, only those heads that are descendants of
    STARTREV will be displayed.

    If -t/--topo is specified, named branch mechanics will be ignored and only
    topological heads (changesets with no children) will be shown.

    Returns 0 if matching heads are found, 1 if not.
    Nrmr~rkcsg|]}�|�qSrWrW�r�r�rrWrXr�r=zheads.<locals>.<listcomp>rcsg|]}�|�qSrWrWrlrrWrXr��r=csh|]}�|���qSrWrrr�rrWrXr��szheads.<locals>.<setcomp>csg|]}|���vr|�qSrWrrrl)r�rWrXr��r=r~csg|]}|���vr|�qSrWrrl)�dagheadsrWrXr��r=cSsh|]}|���qSrWrrrlrWrWrXr��r=rcss|]
}|VqdSr�rW)r��brWrWrXr��r=zheads.<locals>.<genexpr>s)no open branch heads found on branches %ss (started at %s)r�rrjcSs
|��Sr�r�r�rWrWrXr��r=zheads.<locals>.<lambda>)r�)r(r_rMr.r�r r�r�r�rwr!r�r�rrEr�rHrI�showr�)
r4rTZ
branchrevsrU�startr�r�r Z	haveheadsZheadlessr.rSr�rW)r�rmrTrXr�FsH1




�


r�s	extensionsshow only help for extensionssshow only help for commands�kskeywordsshow topics matching keywordssystems"show help for specific platform(s)sPLATFORMs[-eck] [-s PLATFORM] [TOPIC])rGr�r�cKs�|�d�pg}t|�dkrxtj�d�r2|�d�nFtjdkrH|�d�n0tjdkr^|�d�n|�d�|�tj���|jr�|�d	�tj	t
}tj|||fd
|i|��}|�
d�|�|�dS)
z�show help for a given topic or a help overview

    With no arguments, print a list of commands with short help messages.

    Given a topic, extension, or command name, print help for that
    topic.

    Returns 0 if successful.
    rKrswinswindowssOpenVMSsvmssplan9sunixrA�keeprEN)rMr�r(Zsysplatform�
startswithr�r�r�sys�modules�__name__rZ
formattedhelpr�r�)r4r�rUrrZcommands�	formattedrWrWrX�help_�s 





rxsidentify|idsidentify the specified revisionsnumsshow local revision numbersidsshow global revision idsshow branch�tagss	show tagsr_sshow bookmarkss[-nibtB] [-r REV] [SOURCE]c	sVt�|	�}	|s |s t�td���|p2|p2|p2|p2|}
g}g}d��z�|r�t�d|||�\}}
t�|ph||	|����	�}t�
|�|
d�\}}|�d|	�����|�s�|s�|s�|r�t�td���|s�|r�|d}|s�d}��
|������}|
s�|r�|g}�j|d�tj��fdd	��}����rd|�r8|�|��n*|
�r�|j�s�d
�|��}|�r�|�|�n<�jt��d�|�s�d���v�r�j�j|�d
d�d��np|�r�t�||gd�}t�||d�}|��du�r�|d}|��}g}|D]}|�|� ���q�d}|j!dddd��rd}�j|d��fdd�|D�}|
�sH|�r\dd�|�|fg}�jdd�|�|fd�|�r�dd�|D�}|�dd�|�|f��j�j�fdd�|D�dd�d�nN��|�"��}|
�s�|�r�|g}�j|d�|�r|�t�#|����|� �}|
�r~|j�s~|�$�}|dk�rD|�d|�d
�|�}|�r^|�|�d
�|�%��}|�r�|�|�n8|�r�|�|�$��|�r�|�|�|�r�|�|�%���j|��d��j|�$�d ��j�j|d!d"d#�d$��j�j|�%�d
d�d��j&|d%���'d&d'�|����(�W��rR��)�n��rP��)�0dS)(a#identify the working directory or specified revision

    Print a summary identifying the repository state at REV using one or
    two parent hash identifiers, followed by a "+" if the working
    directory has uncommitted changes, the branch name (if not default),
    a list of tags, and a list of bookmarks.

    When REV is not given, print a summary of the current state of the
    repository including the working directory. Specify -r. to get information
    of the working directory parent without scanning uncommitted changes.

    Specifying a path to a repository root or Mercurial bundle will
    cause lookup to operate on that repository/bundle.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :dirty:   String. Character ``+`` denoting if the working directory has
                uncommitted changes.
      :id:      String. One or two nodes, optionally followed by ``+``.
      :parents: List of strings. Parent nodes of the changeset.

      Examples:

      - generate a build identifier for the working directory::

          hg id --id > build-id.dat

      - find the revision corresponding to a tag::

          hg id -n -r 1.3

      - check the most recent revision of a remote repository::

          hg id -r tip https://www.mercurial-scm.org/repo/hg/

    See :hg:`log` for generating more information about specific revisions,
    including full hash identifiers.

    Returns 0 if successful.
    �5there is no Mercurial repository here (.hg not found)Nsidentifys3can't query remote revision number, branch, or tagsrr)�idcs@g}d��d�vr8t����fdd�t���d��D�}t|�S)Nr_�
namespacescsg|]\}}|�kr|�qSrWrW)r��bmZbmr�ZhexremoterevrWrXr�Os�z,identify.<locals>.getbms.<locals>.<listcomp>)�listkeysrr(rrH)Zbms)r��	remoterevr~rX�getbmsIs
��zidentify.<locals>.getbms�/rr_r^r�)rr~r=TF)r�r!r rV)�dirtycsg|]}��|����qSrW�r�r�rs�r�rWrXr�vr=zidentify.<locals>.<listcomp>�%s%scSsg|]}d|���qS)r�r�rsrWrWrXr�|r=csg|]}��|����qSrWr�rsr�rWrXr��r=r�)rrts(%s)rr�tagr�)r�r�)r3r�rqr�)*r(r_rrQrr;�get_unique_pull_pathrr��localr�rr�rr�r�r5r�r�rPr�r�r�rr�rr.r�r r�r�rr3r�r�r�r rr�r�r�r�)r4rTr�r�Znumr{r r3rrU�default�outputrzr�r�Zhexrevr�r}r�rZtaglistr�r�Z	hexoutputZ	numoutputrnr{rW)r�r�r�rX�identify�s�K
���


��





�r�simport|patchsstrips]directory strip option for patch. This has the same meaning as the corresponding patch optionsNUMsbase path (DEPRECATED)sPATHs;skip check for outstanding uncommitted changes (DEPRECATED)s/don't commit, just update the working directory�bypasss2apply patch without touching the working directoryspartialscommit even if some hunks fail�exacts"abort if patch would apply lossilysapply patch to subdirectorys
import-branchs8use any branch information in patch (implied by --exact)s[OPTION]... PATCH...cszt�|dddg�t�|dddg�t�|�}|s@t�td���|f|}|�d�}|rft�	|�|d<|�d	�}|�d
�}zt
|�d�p�d�}Wn ty�t�td
���Yn0|dks�|dkr�t�td���|r�|s�t�td���|d}	g}
d}�����b|�r0t�
��|�s&|�d��s0t���|�d��sV�j}�fdd�}
tj}ntj}tj}
�fdd�}|����|
����|���v�d��}|D�]<}|dk�r�|�td��|j}d}n0tj�|	|�}|�td�|�tj||dd�}d}t�|�D]�}t�||��.}t�|�||||
tj�\}}}Wd�n1�sJ0Y|�rld}|�|d�|�sx|�r��d��}n
�|g}|�r|� td ��|� td!��d"}�q��q|�s�t�td#�|���q�|
�r��!d$�|
��Wd�n1�s0YWd�n1�s(0YWd�n1�sH0Y|Wd�S1�sl0YdS)%atimport an ordered set of patches

    Import a list of patches and commit them individually (unless
    --no-commit is specified).

    To read a patch from standard input (stdin), use "-" as the patch
    name. If a URL is specified, the patch will be downloaded from
    there.

    Import first applies changes to the working directory (unless
    --bypass is specified), import will abort if there are outstanding
    changes.

    Use --bypass to apply and commit patches directly to the
    repository, without affecting the working directory. Without
    --exact, patches will be applied on top of the working directory
    parent revision.

    You can import a patch straight from a mail message. Even patches
    as attachments work (to use the body part, it must have type
    text/plain or text/x-patch). From and Subject headers of email
    message are used as default committer and commit message. All
    text/plain body parts before first diff are added to the commit
    message.

    If the imported patch was generated by :hg:`export`, user and
    description from patch override values from message headers and
    body. Values given on command line with -m/--message and -u/--user
    override these.

    If --exact is specified, import will set the working directory to
    the parent of each patch before applying it, and will abort if the
    resulting changeset has a different ID than the one recorded in
    the patch. This will guard against various ways that portable
    patch formats and mail systems might fail to transfer Mercurial
    data or metadata. See :hg:`bundle` for lossless transmission.

    Use --partial to ensure a changeset will be created from the patch
    even if some hunks fail to apply. Hunks that fail to apply will be
    written to a <target-file>.rej file. Conflicts can then be resolved
    by hand before :hg:`commit --amend` is run to update the created
    changeset. This flag exists to let people import patches that
    partially apply without losing the associated metadata (author,
    date, description, ...).

    .. note::

       When no hunks apply cleanly, :hg:`import --partial` will create
       an empty changeset, importing only the patch metadata.

    With -s/--similarity, hg will attempt to discover renames and
    copies in the patch in the same way as :hg:`addremove`.

    It is possible to use external patch programs to perform the patch
    by setting the ``ui.patch`` configuration option. For the default
    internal tool, the fuzz can also be configured via ``patch.fuzz``.
    See :hg:`help config` for more information about configuration
    files and how to use these options.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    .. container:: verbose

      Examples:

      - import a traditional patch from a website and detect renames::

          hg import -s 80 http://example.com/bugfix.patch

      - import a changeset from an hgweb server::

          hg import https://www.mercurial-scm.org/repo/hg/rev/5ca8c111e9aa

      - import all the patches in an Unix-style mbox::

          hg import incoming-patches.mbox

      - import patches from stdin::

          hg import -

      - attempt to exactly restore an exported changeset (not always
        possible)::

          hg import --exact proposed-fix.patch

      - use an external tool to apply a patch which is too fuzzy for
        the default internal tool.

          hg import --config ui.patch="patch --merge" fuzzy.patch

      - change the default fuzzing from 2 to a less strict 7

          hg import --config ui.fuzz=7 fuzz.patch

    Returns 0 on success, 1 on partial success (see --partial).
    r�Zbypass�secret�exactr
r�s!need at least one patch to importrvr�r�rgrssimilarity must be a number�ds$similarity must be between 0 and 100s%cannot use --similarity with --bypassr�rWrcs
��d�S�Nsimport)rarWrrWrXr�mr=zimport_.<locals>.<lambda>cst��d�Sr�)rrWrrWrXr�rr=Nr�sapplying patch from stdin
sstdinsapplying %s
F)Z
sendacceptTr�spatch applied partially
s1(fix the .rej files and run `hg commit --amend`)
rs%s: no diffs founds
* * *
)"rrr(r_rrQrrMr9r�float�
ValueErrorr�rrr�r5�nullcontextmanagerrrSZfinr�r�r�r�openpathr&r�extractZtryimportoner%r+Z	write_errZsavecommitmessage)r4rTZpatch1ZpatchesrUr�r�r�Zsimr�Zmsgsr�r�rlZdsguardrZpatchurlZ	patchfileZhaspatchZhunkZ	patchdatar.r�ZrejrWrrX�import_�s�
�







�*
��
pr�sincoming|ins*run even if remote repository is unrelatedsnewest-firstsshow newest record firstsfile to store the bundles intosFILEs'a remote changeset intended to be addedscompare bookmarkss(a specific branch you would like to pulls<[-p] [-n] [-M] [-f] [-r REV]... [--bundle FILENAME] [SOURCE]rtc		s8t������d�rPt�g�����fdd�}tj|dd���|�dd�dSt��d	d
g���d��r(t	�
��|g�}|D]�}t	�|j��d��\}}t�
��|�}zpd|�d
�vr؈�td��W|��dS��d���td�t	�|��tj��||jd�W|��S|��0q�t���|��S)a�show new changesets found in source

    Show new changesets found in the specified path/URL or the default
    pull location. These are the changesets that would have been pulled
    by :hg:`pull` at the time you issued this command.

    See pull for valid source format details.

    .. container:: verbose

      With -B/--bookmarks, the result of bookmark comparison between
      local and remote repositories is displayed. With -v/--verbose,
      status is also displayed for each bookmark like below::

        BM1               01234567890a added
        BM2               1234567890ab advanced
        BM3               234567890abc diverged
        BM4               34567890abcd changed

      The action taken locally when pulling depends on the
      status of each bookmark:

      :``added``: pull will create it
      :``advanced``: pull will update it
      :``diverged``: pull will create a divergent bookmark
      :``changed``: result depends on remote changesets

      From the point of view of pulling behavior, bookmark
      existing only in the remote repository are treated as ``added``,
      even if it is in fact locally deleted.

    .. container:: verbose

      For remote repository, using --bundle avoids downloading the
      changesets twice if the incoming is followed by a pull.

      Examples:

      - show incoming changes with patches and full description::

          hg incoming -vp

      - show incoming changes excluding merges, store a bundle::

          hg in -vpM --bundle incoming.hg
          hg pull incoming.hg

      - briefly list changes inside a bundle::

          hg in changes.hg -T "{desc|firstline}\n"

    Returns 0 if there are incoming changes, 1 otherwise.
    �graphcs&t�||��}t���||tj�dSr�)r Z	graphrevsZdisplaygraphrZ
asciiedges)r�ZchlistrSZrevdag�rUrTr4rWrXr_�s�zincoming.<locals>.displaycSsdS)NrrWrWrWrWrXr�r=zincoming.<locals>.<lambda>T�Zbufferedrr�r�r_rnr|�!remote doesn't support bookmarks
sincoming�comparing with %s
)�mode)r(r_rMr ZcheckunsupportedgraphflagsrZ	_incomingrrr;�get_pull_paths�parseurlr�r�rrErr�r�rS�hidepasswordr�incomingZbookmarks_mode)	r4rTr�rUr_Zsrcsr�r�r�rWr�rXr��s>W

�	�
�
��r�r8s![-e CMD] [--remotecmd CMD] [DEST]r=cKs8t�|�}t�||�d}tj|||dd�}|��dS)awcreate a new repository in the given directory

    Initialize a new repository in the given directory. If the given
    directory does not exist, it will be created.

    If no directory is given, the current directory is used.

    It is possible to specify an ``ssh://`` URL as the destination.
    See :hg:`help urls` for more information.

    Returns 0 on success.
    rT)ZcreateN)r(r_r;Zget_clone_pathrr�r�)r4r�rUr�r�rWrWrX�inits
r��locate�fullpaths-print complete paths from the filesystem roots[OPTION]... [PATTERN]...cOs�t�|�}|�d�rd}nd}t�||�d�d�}d}tj|||ddd	�d
�}|�d�|��durvt	|j
�|��}n
|�|�}tj|t
|�d�}	|D]6}
|�d
�r�|�|�|
�|�n|�|	|
�|�d}q�|S)a>locate files matching specific patterns (DEPRECATED)

    Print files under Mercurial control in the working directory whose
    names match the given patterns.

    By default, this command searches all directories in the working
    directory. To search just the current directory and its
    subdirectories, use "--include .".

    If no patterns are given to match, this command prints the names
    of all files under Mercurial control in the working directory.

    If you want to feed the output of this command into the "xargs"
    command, use the -0 option to both this command and "xargs". This
    will avoid the problem of "xargs" treating single filenames that
    contain whitespace as multiple filenames.

    See :hg:`help files` for a more versatile command.

    Returns 0 if a match is found, 1 otherwise.
    r.r/r�rmNrsrelglobcSsdS)NFrWr�rWrWrXr�rr=zlocate.<locals>.<lambda>)r�r�r�r\r�r)r(r_rMr r�r.r^r�r�rHr�matchesr`rFr��wjoin)r4rTrbrUr�r�r�rcZfilesgenrdr�rWrWrX�locate8s(1

�


r�slog|historysfollow-firsts=only follow the first parent of merge changesets (DEPRECATED)s!show revisions matching date specsDATE�copiessshow copied filess+do case-insensitive search for a given textsTEXTs"revisions to select or follow from�Ls
line-ranges2follow line range of specified file (EXPERIMENTAL)s
FILE,RANGEsremoveds*include revisions where files were removedsonly-mergess8show only merges (DEPRECATED) (use -r "merge()" instead)srevisions committed by usersUSERsonly-branchs?show only changesets within the given named branch (DEPRECATED)s-show changesets within the given named branchs)show changesets within the given bookmark�Psprunes/do not display revision or any of its ancestorss[OPTION]... [FILE]cOst�|�}|�d�}|r0|�d�s0t�td���|rF|rFt�td���t�||�d�d�}t�	|||�}t�
||�\}}|r�t�|||�\}}d}|�d�r�d}	|r�|��d	}	tj
||	d
�}|�d�tj||||dd
�}
|�d�r�tj}ntj}|||||
|�dS)a�show revision history of entire repository or files

    Print the revision history of the specified files or the entire
    project.

    If no revision range is specified, the default is ``tip:0`` unless
    --follow is set.

    File history is shown without following rename or copy history of
    files. Use -f/--follow with a filename to follow history across
    renames and copies. --follow without a filename will only show
    ancestors of the starting revisions. The starting revisions can be
    specified by -r/--rev, which default to the working directory parent.

    By default this command prints revision number and changeset id,
    tags, non-trivial parents, user, date and time, and a summary for
    each commit. When the -v/--verbose switch is used, the list of
    changed files and full commit message are shown.

    With --graph the revisions are shown as an ASCII art DAG with the most
    recent changeset at the top.
    'o' is a changeset, '@' is a working directory parent, '%' is a changeset
    involved in an unresolved merge conflict, '_' closes a branch,
    'x' is obsolete, '*' is unstable, and '+' represents a fork where the
    changeset from the lines below is a parent of the 'o' merge on the same
    line.
    Paths in the DAG are represented with '|', '/' and so forth. ':' in place
    of a '|' indicates one or more revisions in a path are omitted.

    .. container:: verbose

       Use -L/--line-range FILE,M:N options to follow the history of lines
       from M to N in FILE. With -p/--patch only diff hunks affecting
       specified line range will be shown. This option requires --follow;
       it can be specified multiple times. Currently, this option is not
       compatible with --graph. This option is experimental.

    .. note::

       :hg:`log --patch` may generate unexpected diff output for merge
       changesets, as it will only compare the merge changeset against
       its first parent. Also, only files different from BOTH parents
       will appear in files:.

    .. note::

       For performance reasons, :hg:`log FILE` may omit duplicate changes
       made on branches and will not show removals or mode changes. To
       see all such changes, use the --removed switch.

    .. container:: verbose

       .. note::

          The history resulting from -L/--line-range options depends on diff
          options; for instance if white-spaces are ignored, respective changes
          with only white-spaces in specified line range will not be listed.

    .. container:: verbose

      Some examples:

      - changesets with full descriptions and file lists::

          hg log -v

      - changesets ancestral to the working directory::

          hg log -f

      - last 10 commits on the current branch::

          hg log -l 10 -b .

      - changesets showing all modifications of a file, including removals::

          hg log --removed file.c

      - all changesets that touch a directory, with diffs, excluding merges::

          hg log -Mp lib/

      - all revision numbers that match a keyword::

          hg log -k bug --template "{rev}\n"

      - the full hash identifier of the working directory parent::

          hg log -r . --template "{node}\n"

      - list available log templates::

          hg log -T list

      - check if a given changeset is included in a tagged release::

          hg log -r "a21ccf and ancestor(1.9)"

      - find all changesets by some user in a date range::

          hg log -k alice -d "may 2008 to jul 2008"

      - summary of all changesets after the last tag::

          hg log -r "last(tagged())::" --template "{desc|firstline}\n"

      - changesets touching lines 13 to 23 for file.c::

          hg log -L file.c,13:23

      - changesets touching lines 13 to 23 for file.c and lines 2 to 6 of
        main.c with patch::

          hg log -L file.c,13:23 -L main.c,2:6 -p

    See :hg:`help dates` for a list of formats valid for -d/--date.

    See :hg:`help revisions` for more about specifying and ordering
    revisions.

    See :hg:`help templates` for more about pre-packaged styles and
    specifying custom templates. The default template used by the log
    command can be customized via the ``command-templates.log`` configuration
    setting.

    Returns 0 on success.

    s
line_rangerns--line-range requires --follows:FILE arguments are not compatible with --line-range optionrmr~Nr�r)�endrevr5Tr�r�)r(r_rMrrQrr.r�r Z	parseoptsZgetrevsZgetlinerangerevsr�Zgetcopiesfnr�rIZdisplaygraphrevsZdisplayrevs)r4rTrbrUZ	linerangeZ	walk_optsrzZdifferZ	getcopiesr�rSZ	displayfnrWrWrXr=�s8d

�


�
r=�manifestsrevision to displayslist files from all revisionss[-r REV]c
	Ks�t�|�}|�d|�}|�d�r�|s(|r6t�td���t�}|D]}||}|t|���O}q@|�	d�t
|�D]}|��|�dd|�qp|�
�dS|r�|r�t�td���|s�|}dd	d
dd�}	d
dd
dd�}
|r�t�||gd�}t�||�}|��}|�	d�|D]j}|��|j|d�||��}|�|jddt||��|�|jdd|
||	|�|�dd|��q|�
�dS)a output the current or given revision of the project manifest

    Print a list of version controlled files for the given revision.
    If no revision is given, the first parent of the working directory
    is used, or the null revision if no revision is checked out.

    With -v, print file permissions, symlink and executable bits.
    With --debug, print file revision hashes.

    If option --all is specified, the list of all files from all revisions
    is printed. This includes deleted and renamed files.

    Returns 0 on success.
    r�r�s#can't specify a revision with --allr�rqNr�@�*r=ru)r{�xr=r�s644s755r~r�shashr�s	mode types%s %1s )r(r_rrMrrQrr�r0r�rHr�r�r�r.r�r r��manifestr��flagsr�r�rr)
r4rTr�r�rUr��resr�r��charr�ZmfZflrWrWrXr��sD



r�s8force a merge including outstanding changes (DEPRECATED)srevision to merge�previews1review revisions to merge (no merge is performed)sabort the ongoing merges[-P] [[-r] REV]cKs�t�|�}|�d�}|r8|j��|jkr8t�|td��t�	|dddg�|r�t�
|�}|r�|jdkr�tj
td�|j|��d��|r�t�td���t�|j|�S|�d�r�|r�t�td���|s�|�d�}|r�t�||�}n(|�d	d
�r�t�td���|t�|�}|��du�r"t�td
���|�d��r�|d��}|��}|jj|g|gd�}	t�|||�}
|	D]}|
�||��qh|
��dSd|�dd�i}|�|d��2|�d�}gd�}
tj|||
d�Wd�S1�s�0YdS)a�merge another revision into working directory

    The current working directory is updated with all changes made in
    the requested revision since the last common predecessor revision.

    Files that changed between either parent are marked as changed for
    the next commit and a commit must be performed before any further
    updates to the repository are allowed. The next commit will have
    two parents.

    ``--tool`` can be used to specify the merge tool used for file
    merges. It overrides the HGMERGE environment variable and your
    configuration files. See :hg:`help merge-tools` for options.

    If no revision is specified, the working directory's parent is a
    head revision, and the current branch contains exactly one other
    head, the other head is merged with by default. Otherwise, an
    explicit revision with which to merge must be provided.

    See :hg:`help resolve` for information on handling file conflicts.

    To undo an uncommitted merge, use :hg:`merge --abort` which
    will check out a clean copy of the original merge parent, losing
    all changes.

    Returns 0 on success, 1 if there are unresolved files.
    rFr�rmr�s&cannot abort merge with %s in progressrKs"cannot specify a node with --abortrr�smerge.require-revs8configuration requires specifying revision to merge withNs+merging with the working copy has no effectr=)r�r�rrrr=rW)sworking copys	merge revscommon ancestor)rj�labels) r(r_rMrr*rrrErrrNrRrrOrLrQr�
abortmerger4r r�r�rZ	destmerger�r�findmissingrIror�r"r!)r4rTr�rUrYr1r�r�r*rRrSr,rjr�rWrWrXr!�s\4


�
���
r!soutstanding uncommitted merges:To continue:    hg commit
To abort:       hg merge --aborts%use 'hg commit' or 'hg merge --abort')r�rMZallowcommit�cmdmsgrPZ
statushintrOsoutgoing|outs6a changeset intended to be included in the destinations(a specific branch you would like to pushs)[-M] [-p] [-n] [-f] [-r REV]... [DEST]...c	Os�t�|�}|�d�r�t�|||�D]�}|jp0|j}t�|||�}zjd|�	d�vrn|�
td��W|��dS|�
td�t�|��|�d�t�|||�W|��S|��0q"t�||||�S)a'show changesets not found in the destination

    Show changesets not found in the specified destination repository
    or the default push location. These are the changesets that would
    be pushed if a push was requested.

    See pull for details of valid destination formats.

    .. container:: verbose

      With -B/--bookmarks, the result of bookmark comparison between
      local and remote repositories is displayed. With -v/--verbose,
      status is also displayed for each bookmark like below::

        BM1               01234567890a added
        BM2                            deleted
        BM3               234567890abc advanced
        BM4               34567890abcd diverged
        BM5               4567890abcde changed

      The action taken when pushing depends on the
      status of each bookmark:

      :``added``: push with ``-B`` will create it
      :``deleted``: push with ``-B`` will delete it
      :``advanced``: push will update it
      :``diverged``: push with ``-B`` will update it
      :``changed``: push with ``-B`` will update it

      From the point of view of pushing behavior, bookmarks
      existing only in the remote repository are treated as
      ``deleted``, even if it is in fact added remotely.

    Returns 0 if there are outgoing changes, 1 otherwise.
    r_r|r�rr�soutgoing)r(r_rMr;r��pushloc�locrr�rrErr�rSr�r�rr�)r4rTr�rUr�r�r�rWrWrXr�Ps(D

��
�r�sparentss&show parents of the specified revisions[-r REV] [FILE]c	KsTt�|�}|�d�}|r(t�||gd�}t�||d�}|�rt�||f|�}|��sdt	|�
��dkrrt�t
d���|�
�d}g}|��D]4}|s�q�z|�|�|��Wq�tjy�Yq�0q�|s�t�t
d�|��g}	|D] }
|j||
d�}|	�|���q�nd	d
�|��D�}	t�|||�}|	D] }
|
|jk�r&|�||
��q&|��dS)a�show the parents of the working directory or revision (DEPRECATED)

    Print the working directory's parent revisions. If a revision is
    given via -r/--rev, the parent of that revision will be printed.
    If a file argument is given, the revision in which the file was
    last changed (before the working directory revision or the
    argument to --rev if given) is printed.

    This command is equivalent to::

        hg log -r "p1()+p2()" or
        hg log -r "p1(REV)+p2(REV)" or
        hg log -r "max(::p1() and file(FILE))+max(::p2() and file(FILE))" or
        hg log -r "max(::p1(REV) and file(FILE))+max(::p2(REV) and file(FILE))"

    See :hg:`summary` and :hg:`help revsets` for related information.

    Returns 0 on success.
    rmr~Nrs%can only specify an explicit filenamers'%s' not found in manifest)ZfileidcSsg|]}|���qSrWr)r��cprWrWrXr��r=zparents.<locals>.<listcomp>)r(r_rMr.r�r r�r^rhr�r0rrQrrr�rTrJZfilectxr�rIrror�)r4rTZfile_rUr�r�rcZ	filenodesr�r�r�r�rSr�rWrWrXr�s<%

r�pathss[NAME]c
Ks8t�|�}t�||�}|�d�|�d|�}|��r<tj}nt}|j	rLd}nd}|o\|j	}|D]�\}	}
|�
�|�|d||	�|�|j	dd||
j��t
|
j���D]R\}}|dvs�J�|r�|�d|	|f�t|t�r�|r�d}nd	}|�||d|�q�qb|��|�r0|�s0|j	�s,|�td
��dSdSd
S)a�show aliases for remote repositories

    Show definition of symbolic path name NAME. If no name is given,
    show definition of all available names.

    Option -q/--quiet suppresses all output when searching for NAME
    and shows only the path names when listing all definitions.

    Path names are defined in the [paths] section of your
    configuration file and in ``/etc/mercurial/hgrc``. If run inside a
    repository, ``.hg/hgrc`` is used, too.

    The path names ``default`` and ``default-push`` have a special
    meaning.  When performing a push or pull operation, they are used
    as fallbacks if no location is specified on the command-line.
    When ``default-push`` is set, it will be used for push and
    ``default`` will be used for pull; otherwise ``default`` is used
    as the fallback for both.  When cloning a repository, the clone
    source is written as ``default`` in ``.hg/hgrc``.

    .. note::

       ``default`` and ``default-push`` apply to all inbound (e.g.
       :hg:`incoming`) and outbound (e.g. :hg:`outgoing`, :hg:`email`
       and :hg:`bundle`) operations.

    See :hg:`help urls` for more information.

    .. container:: verbose

      Template:

      The following keywords are supported. See also :hg:`help templates`.

      :name:    String. Symbolic name of the path alias.
      :pushurl: String. URL for push operations.
      :url:     String. URL or directory path for the other operations.

    Returns 0 on success.
    r�rqs%s = �name�url)r�r�s%s:%s = syessnosnot found!
rrN)r(r_r;Z
list_pathsr�rr�r��bytesr�r�r�r�rHZ
suboptions�itemsr�r�rFr�rEr)
r4rT�searchrUZ	pathitemsr�r��namefmtZshowsuboptsr�r�ZsuboptrrWrWrXr�s<2


r�phasespublicsset changeset phase to publicsdraftsset changeset phase to draftsset changeset phase to secretsallow to move boundary backwardstarget revisions[-p|-d|-s] [-f] [-r] [REV...]c	s8t�|�}d�ttj�D]*\}}||r�dur>t�td���|�qt|�}|�	|d�|rlt
��|�}ndd��d��D�}d}�dur�|D]&}�|}|�
d|��|��f�q��nv�������d���}	|s�t�td	����fd
d�|D�}
�����jj���fdd��D��t��|	�|
�|d�rFt��|	�|
�Wd�n1�s\0YWd�n1�s|0Y�jj���fd
d��D��t��fdd��D��}�j����fdd�|
D�}|�r�|�td�t|��d}|�r&td�|}
|�r|�|
�n
|�|
�n|�td��|S)aset or show the current phase name

    With no argument, show the phase name of the current revision(s).

    With one of -p/--public, -d/--draft or -s/--secret, change the
    phase value of the specified revisions.

    Unless -f/--force is specified, :hg:`phase` won't move changesets from a
    lower phase to a higher phase. Phases are ordered as follows::

        public < draft < secret

    Returns 0 on success, 1 if some phases could not be changed.

    (For more information about the phases concept, see :hg:`help phases`.)
    Nsonly one phase can be specifiedrmcSsg|]}|���qSrWr�rrWrWrXr�yr=zphase.<locals>.<listcomp>rs%i: %s
r�r@csg|]}�|���qSrWrr�rrWrXr��r=csg|]}��|��qSrWrWr���getphase�unfirWrXr��r=rWcsg|]}��|��qSrWrWr�r�rWrXr��r=c3s|]}�|�|kVqdSr�rWr�)�newdata�olddatarWrXr��r=zphase.<locals>.<genexpr>cs"g|]}���|��kr|�qSrWr�r�)�clr��targetphaserWrXr��r=s9cannot move %i changesets to a higher phase, use --force
rs phase changed for %i changesets
sno phases changed
)r(r_rGr'Z
cmdphasenamesrrQrrrPr r�rr�r�r�r�ra�
unfilteredZ_phasecache�phaseZadvanceboundaryZretractboundary�sumrrEr�rSr+)r4rTrzrU�idxr�r�r�r�rlrRZchangesrer.rW)r�r�r�r�rTr�r�rXr�Ks`
 
P���r�c

Cs�|dkrdS|rpzt�||||�WStjyn}z2td�t�|�}|j}tj||d��WYd}~n
d}~00|dur�|dkr�t|�	��}	|	|kr�|�
td��q�|	dkr�|�
td��q�|�
td	��n|�d
d�s�|�
td��dS)
a�Run after a changegroup has been added via pull/unbundle

    This takes arguments below:

    :modheads: change of heads by pull/unbundle
    :optupdate: updating working directory is needed or not
    :checkout: update destination revision (or None to default destination)
    :brev: a name, which might be a bookmark to be activated after updating

    return True if update raise any conflict, False otherwise.
    rFsnot updating: %srKNrs3(run 'hg heads' to see heads, 'hg merge' to merge)
s5(run 'hg heads .' to see heads, 'hg merge' to merge)
s(run 'hg heads' to see heads)
r��update.requiredests((run 'hg update' to get a working copy)
)r�
updatetotallyrZUpdateAbortrr:rfrLr�r!rSr�)
r4rT�modheadsZ	optupdater��brevrir.rLZcurrentbranchheadsrWrWrX�postincoming�s.$��r��updates8update to new branch head if new descendants were pulleds,run even when remote repository is unrelated�confirms$confirm pull before applying changessbookmark to pulls<[-u] [-f] [-r REV]... [-e CMD] [--remotecmd CMD] [SOURCE]...c
Os�t�|�}|�dd�r>|�d�r>td�}td�}tj||d��t�|||�D�]2}t�	|j
|�d��\}}|�td�t�|��|�
�t�|||�}	d	}
�z�t�||	||�d
��\}}i}
d	}|�d�s�|�r�g}g}|p�g}|�r|	�d��std
�}t�|��|	���B}|�dddi�}|D]}|�|�dd|i���q$Wd	�n1�sX0Y|��}t�|�}||
d<|�dg�D]<}|j�|�}||v�r�t�td�|��|�||��q�t|�D].\}}||��}|�|�||k�r�|}�q�t��}|�d��r|��}|��.|
�|�di��t j!||	|||�d�|�dd�|
|�d�d�j"}d	}|�r�|�#�j$�%|�}|�d
��r�|d
d}n"|�d��r�|dd}n|d}||_&zxzt'||||�d�||�}
WnRtj(�y0}z6td�|j)d}|f|j)dd	�|_)�WYd	}~n
d	}~00W|`&n|`&0Wd	�n1�sV0YW|	�*�n
|	�*�0|
rL�q�qL|
�r�dSdSd	S)a�pull changes from the specified source

    Pull changes from a remote repository to a local one.

    This finds all changes from the repository at the specified path
    or URL and adds them to a local repository (the current one unless
    -R is specified). By default, this does not update the copy of the
    project in the working directory.

    When cloning from servers that support it, Mercurial may fetch
    pre-generated data. When this is done, hooks operating on incoming
    changesets and changegroups may fire more than once, once for each
    pre-generated bundle and as well as for any additional remaining
    data. See :hg:`help -e clonebundles` for more.

    Use :hg:`incoming` if you want to see what would have been added
    by a pull at the time you issued this command. If you then decide
    to add those changes to the repository, you should use :hg:`pull
    -r X` where ``X`` is the last changeset listed by :hg:`incoming`.

    If SOURCE is omitted, the 'default' path will be used.
    See :hg:`help urls` for more information.

    If multiple sources are specified, they will be pulled sequentially as if
    the command was run multiple time. If --update is specify and the command
    will stop at the first failed --update.

    Specifying bookmark as ``.`` is equivalent to specifying the active
    bookmark's name.

    Returns 0 on success, 1 if an update had unresolved files.
    r�r�r�s,update destination required by configurations&use hg pull followed by hg update DESTrKrnspulling from %s
Nrmr^slookupsOother repository doesn't support revision lookup, so a rev cannot be specified.slistkeyss	namespacer_skeysremotebookmarkssremote bookmark %s not found!�opargsrWrWr�)r�r�rjr�opargs�confirmrscannot update to target: %sr)+r(r_r�rMrrrQr;r�r�r�rSr��flushrr�r�ZcapablerLZcommandexecutorZcallcommandr��resultrZunhexlifybookmarksrcrdrGr5r�r�r�rr��cgresultr�rr��_subtoppathr�ZFilteredRepoLookupErrorrr�)r4rTZsourcesrUr.rLr�r�r�r�Zupdate_conflictrzr�Z
pullopargsrRZfnodes�errrZfremotebookmarksr�Zremotebookmarksrnr<r�r�r�r�r��excrWrWrXr��s�L
���

�:


�


��.r�spurge|cleansabort-on-errsabort if an error occursspurge ignored files too�ignoredspurge only ignored files�dirsspurge empty directoriesspurge files�prints(print filenames instead of deleting thems?end filenames with NUL, for use with xargs (implies -p/--print)s%ask before permanently deleting filesshg purge [OPTION]... [DIR]...cOst�|�}t�|dd�|�d�}d}|�d�r:d}d}|�dd�rPd}d}n|�dd�}|}|�d	�}|�d
�}	|�d�}
|
dur�zt�d
�d}
Wnty�d}
Yn0|s�|	s�d}d}	t�	|d||�}t
j|||||	||�d�||
d�	}|D]}
|s�|�d|
|f�q�dS)aZremoves files not tracked by Mercurial

    Delete files not known to Mercurial. This is useful to test local
    and uncommitted changes in an otherwise-clean source tree.

    This means that purge will delete the following by default:

    - Unknown files: files marked with "?" by :hg:`status`
    - Empty directories: in fact Mercurial ignores directories unless
      they contain files under source control management

    But it will leave untouched:

    - Modified and unmodified tracked files
    - Ignored files (unless -i or --all is specified)
    - New files added to the repository (with :hg:`add`)

    The --files and --dirs options can be used to direct purge to delete
    only files, only directories, or both. If neither option is given,
    both will be deleted.

    If directories are given on the command line, only files in these
    directories are considered.

    Be careful with purge, as you could irreversibly delete some files
    you forgot to add to the repository. If you only want to print the
    list of files that this program would delete, use the --print
    option.
    r�r�r�r�r.r/FTr�r�r�Nspurgesabort_on_err)r��ignoredZremoveemptydirs�removefilesZabortonerrorZnoopr�r�)
r(r_rr`rMr�find�KeyErrorr.r^r#�purger�)r4rT�dirsrUZactr]r�r�r��
removedirsr�r^rr�rWrWrXr��sN6






�r��pushs
force pushsbookmark to pushs
all-bookmarkss!push all bookmarks (EXPERIMENTAL)s
new-branchsallow pushing a new branch�pushvarss/variables that can be sent to server (ADVANCED)�publishs+push the changeset as public (EXPERIMENTAL)s5[-f] [-r REV]... [-e CMD] [--remotecmd CMD] [DEST]...cs&t�|�}|�d�r4t�|dddg�t�j�|d<|�d�r�|�dd|dd�|dD]@}�j�|�}|�jvr�|�	dg��
|�qZ|�	dg��
d�qZd}d	}t��||�D�]X}|j
p�|j}|j|�d
�p�gf}	|�td�t�|��t���|	|�d��\}
}t��||�}�z�|
�rZ�fdd
�t��|
�D�}
|
�s�tjtd�td�d��np|j�r�t�d|j�}
t��|
g�}
�fdd
�|
D�}
|
�s�t�td���n$|�dd��r�tjtd�td�d��|�_zX�d}|j }t!|�D]8}|�"|��#|�}|d	k�r�W�`W|�$�dS�q�W�`n�`0t%|�di��}|�	dg��&|�dg��t'j#�||�d�|
|�d�|�dd�|�d�|d �}|j(d	k�r�d}n|j(d!u�r�d"}|j)d!u�r�|j)d#k�r�d#}n|�s�|j)�r�d#}|�r�W|�$��qW|�$�q�|�$�0q�|d	k�r"|�s"d}|S)$a�	push changes to the specified destination

    Push changesets from the local repository to the specified
    destination.

    This operation is symmetrical to pull: it is identical to a pull
    in the destination repository from the current one.

    By default, push will not allow creation of new heads at the
    destination, since multiple heads would make it unclear which head
    to use. In this situation, it is recommended to pull and merge
    before pushing.

    Use --new-branch if you want to allow push to create a new named
    branch that is not present at the destination. This allows you to
    only create a new branch without forcing other changes.

    .. note::

       Extra care should be taken with the -f/--force option,
       which will push all new heads on all branches, an action which will
       almost always cause confusion for collaborators.

    If -r/--rev is used, the specified revision and all its ancestors
    will be pushed to the remote repository.

    If -B/--bookmark is used, the specified bookmarked revision, its
    ancestors, and the bookmark will be pushed to the remote
    repository. Specifying ``.`` is equivalent to specifying the active
    bookmark's name. Use the --all-bookmarks option for pushing all
    current bookmarks.

    Please see :hg:`help urls` for important details about ``ssh://``
    URLs. If DESTINATION is omitted, a default path will be used.

    When passed multiple destinations, push will process them one after the
    other, but stop should an error occur.

    .. container:: verbose

        The --pushvars option sends strings to the server that become
        environment variables prepended with ``HG_USERVAR_``. For example,
        ``--pushvars ENABLE_FEATURE=true``, provides the server side hooks with
        ``HG_USERVAR_ENABLE_FEATURE=true`` as part of their environment.

        pushvars can provide for user-overridable hooks as well as set debug
        levels. One example is having a hook that blocks commits containing
        conflict markers, but enables the user to override the hook if the file
        is using conflict markers for testing purposes or the file format has
        strings that look like conflict markers.

        By default, servers will ignore `--pushvars`. To enable it add the
        following to your configuration file::

            [push]
            pushvars.server = true

    Returns 0 if push was successful, 1 if nothing to push.
    s
all_bookmarksr^rmr_spushingr��nullFrrnspushing to %s
csg|]}�|���qSrWrr�rrWrXr�yr=zpush.<locals>.<listcomp>s,specified revisions evaluate to an empty sets use different revision argumentsrKs	heads(%r)csg|]}�|���qSrWrr�rrWrXr��r=s6default push revset for path evaluates to an empty setr�spush.require-revssno revisions specified to pushsdid you mean "hg push -r ."?r=rr�r�rWs
new_branchrWr�)rzZ	newbranchrZpublishr�NTr:)*r(r_rMrrrrcr�rd�
setdefaultr�r;r�r�r�r rSrr�rr�r�r r�rrQZpushrevr,Z
formatspecr.r�r��substaterH�sub�pushr��dictrPrr�Zbkresult)r4rTr�rUrnZsome_pushedr�r�r�r�rzr�r��exprr|�subsr�Z
sub_resultr�ZpushoprWrrXr��s�d

�

�����
�#�
�
��r�srecover)r=�verifyFs(run `hg verify` after successful recovercKs8|��}|r4|drt�|�Std�}|�|�dSdS)a6roll back an interrupted transaction

    Recover from an interrupted commit or pull.

    This command tries to fix the repository status after an
    interrupted operation. It should only be necessary when Mercurial
    suggests it.

    Returns 0 if successful, 1 if nothing to recover or verify fails.
    r6sH(verify step skipped, run `hg verify` to check your repository content)
rr)�recoverrr6rrE)r4rTrUr�r.rWrWrXr��s
�
r�s	remove|rmsrecord delete for missing filess)forget added files, delete modified filesc
Os�t�|�}|�d�|�d�}}|�d�}|s@|s@t�td���t�|d||�}|�d�}tj|dd�}	t	j
|||d	|	||||d
�	S)a'remove the specified files on the next commit

    Schedule the indicated files for removal from the current branch.

    This command schedules the files to be removed at the next commit.
    To undo a remove before that, see :hg:`revert`. To undo added
    files, see :hg:`forget`.

    .. container:: verbose

      -A/--after can be used to remove only files that have already
      been deleted, -f/--force can be used to force deletion, and -Af
      can be used to remove files from the next revision without
      deleting them from the working directory.

      The following table details the behavior of remove for different
      file states (columns) and option combinations (rows). The file
      states are Added [A], Clean [C], Modified [M] and Missing [!]
      (as reported by :hg:`status`). The actions are Warn, Remove
      (from branch) and Delete (from disk):

      ========= == == == ==
      opt/state A  C  M  !
      ========= == == == ==
      none      W  RD W  R
      -f        R  RD RD R
      -A        W  W  W  R
      -Af       R  R  R  R
      ========= == == == ==

      .. note::

         :hg:`remove` never deletes files in Added [A] state from the
         working directory, not even if ``--force`` is specified.

    Returns 0 on success, 1 if any warnings encountered.
    rrWr2r1Nr�Tr\r=)rV)r(r_rMrrQrr.r^r`rrF)
r4rTrbrUZafterrjrVrcr�rdrWrWrXrF�s5


�rFsrename|move|mvs$unmark a destination file as renameds)record a rename that has already occurreds5(un)mark renames in the given revision (EXPERIMENTAL)s+forcibly move over an existing managed files[OPTION]... SOURCE... DESTcOsJt�|�}|���$tj||||dd�Wd�S1s<0YdS)akrename files; equivalent of copy + remove

    Mark dest as copies of sources; mark sources for deletion. If dest
    is a directory, copies are put in that directory. If dest is a
    file, there can only be one source.

    By default, this command copies the contents of files as they
    exist in the working directory. If invoked with -A/--after, the
    operation is recorded, but no copying is performed.

    To undo marking a destination file as renamed, use --forget. With that
    option, all given (positional) arguments are unmarked as renames. The
    destination file(s) will be left in place (still tracked). The source
    file(s) will not be restored. Note that :hg:`rename --forget` behaves
    the same way as :hg:`copy --forget`.

    This command takes effect with the next commit by default.

    Returns 0 on success, 1 if errors are encountered.
    T)rfNr
r�rWrWrXrf%s-

rf�resolvesselect all unresolved filess!list state of files needing mergesmarksmark files as resolvedsunmarksmark files as unresolveds	no-statusshide status prefixsre-mergesre-merge filesc"s|t����|�dd�}d��}�fdd�|D�\}}}}	}
}tttd|	|||g���}|dkrnt�t	d���n.|d	kr�|�dd
�r�t	d�}
tjt	d�|
d
��|r�|r�t�t	d���|s�|s�|	s�|s�|s�tjt	d�dd
��|�rR|r�|�
t	d��r�t�t	d���|�r(|�s(|�
t	d���r(t�t	d���|�rR|�sR|�
t	d���rRt�t	d���t�
|��|	�r8|�d�|�d��}tj�|�}|d}t�||��}tjdtjdtjdtjdi}|D]p}||��s̐q�|||\}}|��|j|d�|j|
dd||d�|j|d�|jd�|�|d��q�|��d	S|�����tj�|�}|���sz|j �!�|j"k�szt�#t	d���|d}t�||��}d	}d }g}|�r�|�$dd!�}|d"v�r�d }|D�]}||��sԐq�d#}||tjtjfv�rD|�r|�%|tj�n<|�r|�%|tj�n&||tjk�r�|�&t	d$��|���q�|�r�|�r�|j'�(|�}t)�*|��r�||tjk�r�|�+|�|�%|tj��q�|�r�|�%|tj��q�|�,|�}zt-�.||d%�Wn:t/t0f�y}z|j1t1j2k�r�WYd}~n
d}~00z`d&��3d'd(�i}|�4|d��|�5||�}Wd�n1�sH0Y|�r\d}W|�6�n
|�6�0zt-�7|d%t�8|||��Wn6t0�y�}z|j1t1j2k�r��WYd}~n
d}~00�q�|�r$|�&t	d)�d(�9�fd*d+�|D���|d,k�r$|�s$|�s$tj#t	d-�t	d.�d
��|�6�|j �!�|j"k}|j �:��$t�;||�<�|d�Wd�n1�sr0Y|�s2|�r2d}
t=d/d�|D���sd0d�|D�}t�||��}|D]R}||��sҐq�d1d2��d(�9��fd3d�|D��} t	d4�| d5�9|�f}
�q�q�|�&t	d6��|
�r2|�&|
�Wd�n1�sH0Y|�>�}!|!�sx|�?t	d7��t@�A|�|S)8a�redo merges or set/view the merge status of files

    Merges with unresolved conflicts are often the result of
    non-interactive merging using the ``internal:merge`` configuration
    setting, or a command-line merge tool like ``diff3``. The resolve
    command is used to manage the files involved in a merge, after
    :hg:`merge` has been run, and before :hg:`commit` is run (i.e. the
    working directory must have two parents). See :hg:`help
    merge-tools` for information on configuring merge tools.

    The resolve command can be used in the following ways:

    - :hg:`resolve [--re-merge] [--tool TOOL] FILE...`: attempt to re-merge
      the specified files, discarding any previous merge attempts. Re-merging
      is not performed for files already marked as resolved. Use ``--all/-a``
      to select all unresolved files. ``--tool`` can be used to specify
      the merge tool used for the given files. It overrides the HGMERGE
      environment variable and your configuration files.  Previous file
      contents are saved with a ``.orig`` suffix.

    - :hg:`resolve -m [FILE]`: mark a file as having been resolved
      (e.g. after having manually fixed-up the files). The default is
      to mark all unresolved files.

    - :hg:`resolve -u [FILE]...`: mark a file as unresolved. The
      default is to mark all resolved files.

    - :hg:`resolve -l`: list files which had or still have conflicts.
      In the printed list, ``U`` = unresolved and ``R`` = resolved.
      You can use ``set:unresolved()`` or ``set:resolved()`` to filter
      the list. See :hg:`help filesets` for details.

    .. note::

       Mercurial will not let you commit files with unresolved merge
       conflicts. You must use :hg:`resolve -m ...` before you can
       commit after a conflicting merge.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :mergestatus: String. Character denoting merge conflicts, ``U`` or ``R``.
      :path:    String. Repository-absolute path of the file.

    Returns 0 on success, 1 if any files fail a resolve attempt.
    r�sresolve.confirms'all mark unmark list no_status re_mergecsg|]}��|��qSrWr�r�r�rWrXr��r=zresolve.<locals>.<listcomp>Nrstoo many actions specifiedrsresolve.explicit-re-merges*use --mark, --unmark, --list or --re-mergesno action specifiedrKs can't specify --all and patterns�!no files or directories specifieds*use --all to re-merge all unresolved filess1re-merge all unresolved files (yn)?$$ &Yes $$ &Nos	user quits9mark all unresolved files as resolved (yn)?$$ &Yes $$ &Nos9mark all resolved files as unresolved (yn)?$$ &Yes $$ &Nor�)�resolve.unresolvedr6)sresolve.resolvedr<)r�r�r�smergestatusr�r�r�rqs/resolve command not applicable when not mergingFsresolve.mark-check)swarnrFTs,%s: path conflict must be resolved manually
s.resolverrr=s:warning: the following files still have conflict markers:
c3s|]}d�|�dVqdS)s  r�NrW)r�r�)rdrWrXr�Gszresolve.<locals>.<genexpr>rFsconflict markers detectedsuse --all to mark anywaycSsg|]}|�d�dkr|�qS)r�r)r�rsrWrWrXr�dr=cSsg|]}d|�qS)spath:%srWrsrWrWrXr�er=cSs|dkrdSd|dd�S)Nsre_merges--re-merge s-%s rrrW)r�rWrWrX�flagkszresolve.<locals>.flagcsg|]}��|�r�|��qSrWr�r�)r�rUrWrXr�pr=s(try: hg resolve %s%s)
r�s1arguments do not match paths that need resolving
s(no more unresolved files)
)Br(r_r�rr�r�filterrrQrZpromptchoiceZ
CanceledErrorr.r`r�r�
mergestatemodr"rSr^ZMERGE_RECORD_UNRESOLVEDZMERGE_RECORD_RESOLVEDZMERGE_RECORD_UNRESOLVED_PATHZMERGE_RECORD_RESOLVED_PATHr�r�r�r�r�r�r�r�rr*rrOr	�markrEZwvfsZtryreadr�hasconflictmarkersr�r�r5�copyfile�IOError�OSError�errno�ENOENTrMr"�resolverrfZ
backuppathr�ZparentchangeZ
recordupdates�actionsr�r$rSrZcheckafterresolved)"r4rTrbrUr�Zflaglistrr�ZunmarkroZnostatusZremergeZactioncountrLr��msZwctxrcZmergestateinfor�ryr�r�Zdidworkr�Z	markcheckZfdata�arir,r�Zbranchmerger�ZunresolvedfrW)r�rUrdrXrWsRE
�������

�
�


�����

,�����	�
4
�
*
rsreverts*revert all changes when no arguments givenstipmost revision matching dates revert to the specified revisions	no-backups"do not save backup copies of filess interactively select the changess[OPTION]... [-r REV] [NAME]...cOs�t�|�}|�d�r:t�|ddg�t�|||d�|d<|j��\}}|�d�sr||jkrrt	j
td�td�d��|�d�}|r�t�
||gd�}t�||�}|�sh|�d��sh|�d��sh|�d	��sh|�d
��shtd�}||jkr�td�}	t	j
||	d��t|���}
|��}||k�rB|
�r0td
�|��}	ntd�|��}	n|
�rRtd�}	ntd�}	t	j
||	d��tj|||g|�Rit�|���S)a�restore files to their checkout state

    .. note::

       To check out earlier revisions, you should use :hg:`update REV`.
       To cancel an uncommitted merge (and lose your changes),
       use :hg:`merge --abort`.

    With no revision specified, revert the specified files or directories
    to the contents they had in the parent of the working directory.
    This restores the contents of files to an unmodified
    state and unschedules adds, removes, copies, and renames. If the
    working directory has two parents, you must explicitly specify a
    revision.

    Using the -r/--rev or -d/--date options, revert the given files or
    directories to their states as of a specific revision. Because
    revert does not change the working directory parents, this will
    cause these files to appear modified. This can be helpful to "back
    out" some or all of an earlier change. See :hg:`backout` for a
    related method.

    Modified files are saved with a .orig suffix before reverting.
    To disable these backups, use --no-backup. It is possible to store
    the backup files in a custom directory relative to the root of the
    repository by setting the ``ui.origbackuppath`` configuration
    option.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    See :hg:`help backout` for a way to reverse the effect of an
    earlier changeset.

    Returns 0 on success.
    rvrms,uncommitted merge with no revision specifieds'use 'hg update' or see 'hg help revert'rKr~r�r�r�r�r�s[uncommitted merge, use --all to discard all changes, or 'hg update -C .' to abort the mergesRuncommitted changes, use --all to discard all changes, or 'hg update %d' to updates:use --all to revert all files, or 'hg update %d' to updates5uncommitted changes, use --all to discard all changessuse --all to revert all files)r(r_rMrr�finddaterrrrrQrr.r�r r�r�rSr�r�r'r)r4rTrbrUrr*r�r�r.rLr�r�rWrWrXr'�sf3

�
�����
�
���	���
r'�rollbacksignore safety measurescKs8|�dd�stjtd�dd��|j|�d�|�d�d�S)	a�roll back the last transaction (DANGEROUS) (DEPRECATED)

    Please use :hg:`commit --amend` instead of rollback to correct
    mistakes in the last commit.

    This command should be used with care. There is only one level of
    rollback, and there is no way to undo a rollback. It will also
    restore the dirstate at the time of the last transaction, losing
    any dirstate changes since that time. This command does not alter
    the working directory.

    Transactions are used to encapsulate the effects of all commands
    that create new changesets or propagate existing changesets into a
    repository.

    .. container:: verbose

      For example, the following commands are transactional, and their
      effects can be rolled back:

      - commit
      - import
      - pull
      - push (with this repository as the destination)
      - unbundle

      To avoid permanent data loss, rollback will refuse to rollback a
      commit transaction if it isn't checked out. Use --force to
      override this protection.

      The rollback command can be entirely disabled by setting the
      ``ui.rollback`` configuration setting to false. If you're here
      because you want to use rollback and it's disabled, you can
      re-enable the command by setting ``ui.rollback`` to true.

    This command is not intended for use on public repositories. Once
    changes are visible for pull by other users, rolling a transaction
    back locally is ineffective (someone else may already have pulled
    the changes). Furthermore, a race is possible with readers of the
    repository; for example an in-progress pull from the repository
    may fail if a rollback is performed.

    Returns 0 on success, 1 if no rollback data is available.
    rr	s)rollback is disabled because it is unsafes)see `hg help -v rollback` for informationrKrIrj)rVrj)r�rrLr�rollbackrM)r4rTrUrWrWrXr
�s2�r
r")r�rGcKsdt�|�}|�d|��:}|��|�dd|j�|j|j|jd�Wd�n1sV0YdS)a�print the root (top) of the current working directory

    Print the root directory of the current repository.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :hgpath:    String. Path to the .hg directory.
      :storepath: String. Path to the directory holding versioned data.

    Returns 0 on success.
    r"sreporootrq)ZhgpathZ	storepathN)	r(r_rr�r�r�r�r�Zspath)r4rTrUr�rWrWrXr�+s

r�sserves	accesslogs#name of access log file to write tosdaemonsrun server in backgroundsdaemon-postexecsused internally by daemon mode�Eserrorlogs"name of error log file to write tosports!port to listen on (default: 8000)sPORTsaddresss.address to listen on (default: all interfaces)sADDRs0prefix path to serve from (default: server root)r�s6name to show in web pages (default: working directory)sNAMEsweb-confs3name of the hgweb config file (see 'hg help hgweb')swebdir-confs*name of the hgweb config file (DEPRECATED)spid-files#name of file to write process ID to�stdiosfor remote clients (ADVANCED)s	cmdservers	templatessweb templates to usesTEMPLATEsstylestemplate style to usesSTYLE�6sipv6suse IPv6 in addition to IPv4scertificatesSSL certificate files	print-urlsstart and print only the URLs[OPTION]...)rGrHr�cKs�t�|ddg�t�|�}|dr6|jr6t�td���|drl|durTt�td���t	�
||�}|��dSt�
|||�}tj||j|jd�S)	a�start stand-alone webserver

    Start a local HTTP repository browser and pull server. You can use
    this for ad-hoc sharing and browsing of repositories. It is
    recommended to use a real web server to serve a repository for
    longer periods of time.

    Please note that the server does not implement access control.
    This means that, by default, anybody can read from the server and
    nobody can write to it by default. Set the ``web.allow-push``
    option to ``*`` to allow everybody to push to the server. You
    should use a real web server if you need to authenticate users.

    By default, the server logs accesses to stdout and errors to
    stderr. Use the -A/--accesslog and -E/--errorlog options to log to
    files.

    To have the server choose a free port number to listen on, specify
    a port number of 0; in this case, the server will print the port
    number it uses.

    Returns 0 on success.
    ZstdioZ	cmdservers	print_urls%cannot use --print-url with --verboserNrz)ZinitfnZrunfn)rrr(r_rrrQr�	RepoErrorr8Z	sshserverZ
serve_foreverr/Z
createserviceZ
runservicer��run)r4rTrUr�ZservicerWrWrX�serveIsr
�rsshelves7mark new/missing files as added/removed before shelving�unknowns!store unknown files in the shelve�cleanupsdelete all shelved changess%shelve with the specified commit dates"delete the named shelved change(s)�keeps1shelve, but keep changes in the working directoryslist current shelves�messagesuse text as shelve messages)use the given name for the shelved commit�patchs]output patches for changes (provide the names of the shelved changes as positional arguments)sinteractive moder!skoutput diffstat-style summary of changes (provide the names of the shelved changes as positional arguments)shg shelve [OPTION]... [FILE]...c
st����ddhfddhfddhfddhfddhfddhfddhfd	dhfd
dhfdddhfdddhfg���fd
d�}|d�r�|r�t�td���t�||�S|d�r�t�|||�S|d�r�t�|||��S|d�s�|d�r�t�	|||��St�
|||��SdS)a�save and set aside changes from the working directory

    Shelving takes files that "hg status" reports as not clean, saves
    the modifications to a bundle (a shelved change), and reverts the
    files so that their state in the working directory becomes clean.

    To restore these changes to the working directory, using "hg
    unshelve"; this will work even if you switch to a different
    commit.

    When no files are specified, "hg shelve" saves all not-clean
    files. If specific files or directories are named, only changes to
    those files are shelved.

    In bare shelve (when no files are specified, without interactive,
    include and exclude option), shelving remembers information if the
    working directory was on newly created branch, in other words working
    directory was on different branch than its first parent. In this
    situation unshelving restores branch information to the working directory.

    Each shelved change has a name that makes it easier to find later.
    The name of a shelved change defaults to being based on the active
    bookmark, or if there is no active bookmark, the current named
    branch.  To specify a different name, use ``--name``.

    To see a list of existing shelved changes, use the ``--list``
    option. For each shelved change, this will print its name, age,
    and description; use ``--patch`` or ``--stat`` for more details.

    To delete specific shelved changes, use ``--delete``. To delete
    all shelved changes, use ``--cleanup``.
    rfscreaterrrXr�rr]rr�rr!csF��|�rB�D].\}}�|r||vrt�td�||f��qdSdS)Ns2options '--%s' and '--%s' may not be used togetherT)rMrrQr)�optr<Z	allowable�Z
allowablesrUrWrX�checkopt9s
���zshelve.<locals>.checkopts+cannot specify names when using '--cleanup'N)r(r_rrQr�	shelvemodZ
cleanupcmdZ	deletecmdZlistcmdZ	patchcmdsZ	createcmd)r4rTrbrUrrWrrXr0�s6\


�
�r0snothings	status|stsshow status of all filessmodifiedsshow only modified filessaddedsshow only added filessshow only removed filessdeletedsshow only missing filessshow only files without changess%show only unknown (not tracked) filessshow only ignored files�terses$show the terse output (EXPERIMENTAL)s6show source of copied files (DEFAULT: ui.statuscopies)sshow difference from revisions$list the changed files of a revisioncs�t��dd�t������dg�}��dd�}��dt�}|turZ|rNd}n|�dd�}|rv|rvtd	�}t�	|��nJ|r�t
�||gd
�}t�
||d�}|��}	nt
�||d
�}t�||�\}	}d}
|�dd�r�|�dd�}
t
j|t|�|
d
�}��d��rd}nd}d��}
�fdd�|
D�}��d��rP||j�rJ|
dd�dg�pL|
7}|�sx|j�rl|
dd�}n|
dd�}t
�||��}|�r�|j|	��|��|d|v�p�d|vdd��d�d��t��|��n0|�|	��|��|d|vd|vd|v��d���t|
t�d��fdd�|
D��}i}��d��sH��d ��sH|�d!d"��rb��d#��sbt�|	||�}d}|j�s||�dd$��r�|���s���d��s�t� |�}|�!d%�|�"d%��}d&|}��d#�}|D]�\}}}||v�r�d'|}|D]�}|�#�|j$|d(�|j%d)|d*�|j&|d%d+||d,�|j|||�|d,�||v�rr|j%||d-�|jd.||||�d/d,�|�r�|�'||��q�q�|�r�|�(|�|�)�dS)0a�
show changed files in the working directory

    Show status of files in the repository. If names are given, only
    files that match are shown. Files that are clean or ignored or
    the source of a copy/move operation, are not listed unless
    -c/--clean, -i/--ignored, -C/--copies or -A/--all are given.
    Unless options described with "show only ..." are given, the
    options -mardu are used.

    Option -q/--quiet hides untracked (unknown and ignored) files
    unless explicitly requested with -u/--unknown or -i/--ignored.

    .. note::

       :hg:`status` may appear to disagree with diff if permissions have
       changed or a merge has occurred. The standard diff format does
       not report permission changes and diff only reports changes
       relative to one merge parent.

    If one revision is given, it is used as the base revision.
    If two revisions are given, the differences between them are
    shown. The --change option can also be used as a shortcut to list
    the changed files of a revision from its first parent.

    The codes used to show the status of files are::

      M = modified
      A = added
      R = removed
      C = clean
      ! = missing (deleted by non-hg command, but still tracked)
      ? = not tracked
      I = ignored
        = origin of the previous file (with --copies)

    .. container:: verbose

      The -t/--terse option abbreviates the output by showing only the directory
      name if all the files in it share the same status. The option takes an
      argument indicating the statuses to abbreviate: 'm' for 'modified', 'a'
      for 'added', 'r' for 'removed', 'd' for 'deleted', 'u' for 'unknown', 'i'
      for 'ignored' and 'c' for clean.

      It abbreviates only those statuses which are passed. Note that clean and
      ignored files are not displayed with '--terse ic' unless the -c/--clean
      and -i/--ignored options are also used.

      The -v/--verbose option shows information when the repository is in an
      unfinished merge, shelve, rebase state etc. You can have this behavior
      turned on by default by enabling the ``commands.status.verbose`` option.

      You can skip displaying some of these states by setting
      ``commands.status.skipstates`` to one or more of: 'bisect', 'graft',
      'histedit', 'merge', 'rebase', or 'unshelve'.

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions. See also :hg:`help templates`.

      :path:    String. Repository-absolute path of the file.
      :source:  String. Repository-absolute path of the file originated from.
                Available if ``--copies`` is specified.
      :status:  String. Character denoting file's status.

      Examples:

      - show changes in the working directory relative to a
        changeset::

          hg status --rev 9353

      - show changes in the working directory relative to the
        current directory (see :hg:`help patterns` for more information)::

          hg status re:

      - show all changes including copies in an existing changeset::

          hg status --copies --change 9353

      - get a NUL separated list of added files, suitable for xargs::

          hg status -an0

      - show more information about the repository status, abbreviating
        added, removed, modified, deleted, and untracked paths::

          hg status -v -t mardu

    Returns 0 on success.

    r�r rmrr=rr�sstatus.tersescannot use --terse with --revr~Nsstatus.relative)r]�forcerelativevaluer.r/r�s4modified added removed deleted unknown ignored cleancsg|]}��|�r|�qSrWr�)r��kr�rWrXr�r=zstatus.<locals>.<listcomp>r��rp�r�r[Tr�)r%r�r#rsMAR!?ICcsg|]}t�|�d���qS)�utf8)�getattr�decode�r�r�)r�rWrXr�-r=r�rsstatuscopiess	no_statussstatus.verbosesstatusr�sstatus.r�rt)Zitemtyper�r�r�)r�s  %s�
status.copied)*rr`r(r_rM�	_NOTTERSEr	rrrQr.r�r r�r�r$Z	hasconfigr�r`rFrr�r^rSr�Ztersedirr�ZiterbytestrrZ
pathcopiesrr�Zreadmorestatusr�rr�r�r�r�Z
formatfileZformatfooterr�)r4rTrbrUrzr Zterser.r&r'rrdr�rYrorcZchangestatesrZ
morestatusr�r�Zshowcharr1r�r0ryr�rW)rUr�rXrSYs�

�$�
�
���
���
���



�
rSssummary|sum�remotescheck for push and pulls
[--remote]c.s�t������d��d����}|d��}g}ztj���}WnHtj	y�}z.d�
|j�}��t
d�|�g}	WYd}~nd}~00t|���}	|D�]}
�jt
d�|
��|
ft�|
�d��jd�
|
���dd�|
��r�|�|
���|
��d	k�r,t���s��t
d
��n��t
d��|
���rD��t
d��|
���r|�fd
d�|
��D�}��dd�
|�d���d�|
��r��jd|
����d��ddd�q����}�� |�}
t
d�|}|dk�r�j|dd�n�j|dd�|�r��j!}�jt
d�dd�|du�rb||v�rN�jd|tj"d�|�#|�n�jd|tj"d�|D]}�jd|dd��qf�jddd��jdd�}�j$�%�}gg}}t�&|�D]P\}}||j'v�r�|j'�#|�|�(|�n
|�(|�||j)v�r�|j)�#|��q��fdd��j*D�}��+t
d�d �|j,f��+t
d!�d"�|j)f��+t
d#�d$�|j'f��+t
d%�d&�|f��+t
d'�d&�|f��+t
d(�d)�|j-f��+t
d*�d+�|j.f��+t
d,�d-�|	f��+t
d.�d �|fg	}g}|D]"\}}|�r�|�(|t|���q�d�
|�}d/}�j/�0d0��r"|t
d1�7}�j/�0d2��r>|t
d3�7}n�t|�d4k�rZ|t
d5�7}n�||d��k�rz|t
d6�7}n�|d�1��r�|�j |dd7�v�r�|t
d8�7}nR|j,�s�|j)�s�|j'�s�|�s�|�s�|�s�|t
d9�7}d}n||
v�r�|t
d:�7}|�rt2d;d�|D��}nt3j4}|t3�5��k�r>|d<t3j6|7}|�r\��t
d=�|���n��t
d=�|���t�j7�8d>d�|D�|
��}|dk�r���t
d?��n8||
v�rƈ�t
d@�|�n��t
dA�|t|
�f�g}t��9dB��}|�r
|�(t
dC�|�t��9dD��}|�r0|�(t
dE�|�|�s<|�rT��t
dF�d�
|��t�:�tj;��r�dGD]P}t��9|dH��}t
dI�t
dJ�t
dK�dG�} |dk�rh��| ||d��qht<�=�����>dL��r�dM\}!}"nHdN\}!}"t<�?���d�D]\}#}$|#�rd}!|$�r�d}"�q�|!�s$|"�s$dS���fdOdP�}%|!�rL|%�\����}&nd����}&�������fdQdR�}'|"�r�|'�\}(})}*}+nd}(})}*}+��>dL��r��du�s�J�|+du�s�J�g}|&�r�|�(t
dS��|+j@}$|$�r|�(t
dT�t|$��|*�p�},dU|,�AdV�v�rnt�B�|,�}-|-ddk�rJ|�(t
dW�|-d�|-d4dk�rn|�(t
dX�|-d4�|�r���t
dY�d�
|��n��t
dZ��t<�?�������f|(|)|*|+ff�dS)[aTsummarize working directory state

    This generates a brief summary of the working directory state,
    including parents, branch, commit status, phase and available updates.

    With the --remote option, this will check the default paths for
    incoming and outgoing changes. This can be time-consuming.

    Returns 0 on success.
    �summaryNrr�s6warning: merge state has unsupported record types: %s
sparent: %d:%s r�slog.tagr�s (empty repository)s (no revision checked out)s (obsolete)c3s|]}��|d|�VqdS)s
trouble.%sNr�)r�Zinstability)r4rWrXr��s�zsummary.<locals>.<genexpr>s (r�)r�slog.summarysbranch: %s
rts
log.branchs
bookmarks:slog.bookmarks *s [%s]T)r�csg|]}��|���r|�qSrW)r�r�r"r�rWrXr��r=zsummary.<locals>.<listcomp>s%d modifiedsstatus.modifieds%d addedsstatus.addeds
%d removedsstatus.removeds
%d renamedr#s	%d copieds
%d deletedsstatus.deleteds
%d unknownsstatus.unknowns
%d unresolvedr�s%d subreposFr>s (graft in progress)supdatestates (interrupted update)rs (merge)s
 (new branch)r�s (head closed)s (clean)s (new branch head)css|]}|��VqdSr�)r�rsrWrWrXr��r=rAscommit: %s
cSsg|]}|���qSrWr)r�rLrWrWrXr�r=supdate: (current)
s#update: %d new changesets (update)
s3update: %d new changesets, %d branch heads (merge)
sdraft()s%d draftssecret()s	%d secretsphases: %s
)sorphanscontentdivergentsphasedivergents()sorphan: %d changesetss content-divergent: %d changesetssphase-divergent: %d changesetsr%)TT)FFcs�t�d��d�\}}|d}zt��i|��Wn.tjy\��d�rJ�||dddfYS0t���|d�\}}|r��fdd�|D�}��dt�	|���j
��� tj
��|d�}Wd�n1s�0Y||�||d	fS)
Nr&rtrr%csg|]}��|��qSrW�rr��r�rWrXr�Ir=z0summary.<locals>.getincoming.<locals>.<listcomp>r�)r�r)r;r�rr�rrrMr�r�r�r4�silentrZfindcommonincoming)r�r��sbranchrzr��	commonincr�r)rX�getincoming9s"�
.zsummary.<locals>.getincomingc	snd}d�jvrd}nd�jvr"d}|durNt�d��|�}|jpD|j}|j}nd}d}t���|gfd�\}}�|kr�zt��i|�}Wn,t	j
y���d�r��||ddfYS0��dt�
|��n�dur�||ddfS�}�|k�s�du�r�|k�rd}n�}|�r$�fdd�|D�}�j���"tj�|||d�}Wd�n1�sX0Y||||fS)	Nsdefault-pushrtr&r%r�csg|]}��|��qSrWr(r�rrWrXr�wr=z0summary.<locals>.getoutgoing.<locals>.<listcomp>)r�r,)rr;Zget_unique_push_pathr�r�r rr�r�rrrMr�r�r4r*rr�)	�dr�r��dbranchrzr��dotherr�r�)r,rUrTr+�sotherr�r4rWrX�getoutgoingTsB


�&zsummary.<locals>.getoutgoings1 or more incomings%d outgoingr_r|s%d incoming bookmarkss%d outgoing bookmarkssremote: %s
sremote: (synced)
)Cr(r_r�rr�r�r"rSrZUnsupportedMergeRecordsr�ZrecordtypesrErr�
unresolvedr�r�r Zchangesetlabelsr3rrPr�r$Z
isunstable�
instabilitiesrHrS�
splitlinesrur r!rgZactivebookmarklabelrFrrrr�r�r�r�ryr�r�r�r7r�r�r�r'ZpublicZnewcommitphaseZ
phasenamesrr�rzr�r�rZsummaryhooksrMZsummaryremotehooksr�rrU).r4rTrUrZpnodeZmarksrrr�r3r�r4r r+rcr�rSr|ZcopiedZrenamedr.r�r�r{r�ZcleanworkdirZpendingphase�newZdraftr�ZtroubleZ
numtroubleZ
troublemsgZ
needsincomingZ
needsoutgoingr<r�r-r�r2r�r/r0r�r�ZcountsrW)r,r�rUrTr+r1r�r4rXrU\s�


�
�



�
�






�
�
������
�


���

*


��rUr�s	force tagsmake the tag localsrevision to tag�removesremove a tagsuse text as commit messages8[-f] [-l] [-m TEXT] [-d DATE] [-u USER] [-r REV] NAME...cOsBt�|ddg�t�|�}|����|�����d}dd�|f|D�}t|�tt|��krlt�	t
d���|D]$}t�||d�|spt�	t
d���qp|�
d	�r�|d	}|�
d
�}|�
d��r�|�
d�r�d}nd
}|D]�}|�|�d
k�rt�||�}	|	|d|jk�rt�	t
d�|��|�|��s:t�	t
d�|��|�|�|kr�|d
k�rft�	t
d�|��q�t�	t
d�|��q�d}|�s�dd�|�}n8|�
d��s�|D]&}||��v�r�t�	t
d�|���q�|�
d��s2|j��\}
}||jk�rt�t
d���|��}|�
d��s2|�r2|
|v�r2t�	t
d���t�||���}
|�s^dd�|�t|
�f}|�
d�}|�rxt�|�}|�
d��r�d}nd}tjfd|it�|���}|�
d��s�t�||�� �t!k�r�t�	t
d���tj"|||
||�
d�|�
d �||d!�Wd"�n1�s0YWd"�n1�s40Yd"S)#aadd one or more tags for the current or given revision

    Name a particular revision using <name>.

    Tags are used to name particular revisions of the repository and are
    very useful to compare different revisions, to go back to significant
    earlier versions or to mark branch points as releases, etc. Changing
    an existing tag is normally disallowed; use -f/--force to override.

    If no revision is given, the parent of the working directory is
    used.

    To facilitate version control, distribution, and merging of tags,
    they are stored as a file named ".hgtags" which is managed similarly
    to other project files and can be hand-edited if necessary. This
    also means that tagging creates a new commit. The file
    ".hg/localtags" is used for local tags (not shared among
    repositories).

    Tag commits are usually made at the head of a branch. If the parent
    of the working directory is not a branch head, :hg:`tag` aborts; use
    -f/--force to force the tag commit to be based on a non-head
    changeset.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    Since tag names have priority over branch names during revision
    lookup, using an existing branch name as a tag name is discouraged.

    Returns 0 on success.
    rFr�r=cSsg|]}|���qSrW)ru)r�r{rWrWrXr��r=ztag.<locals>.<listcomp>stag names must be uniquer�s/tag names cannot consist entirely of whitespacermrr7r�r�rstag '%s' is already removedstag '%s' does not existstag '%s' is not a global tagstag '%s' is not a local tagr�sRemoved tag %srrWs)tag '%s' already exists (use -f to force)suncommitted merges;working directory is not at a branch head (use -f to force)sAdded tag %s for changeset %srvs
tag.removestag.addr	scannot tag null revisionrrrN)#rrr(r_r�r�r�r�rrQrr.rvrM�tagtype�tagsmodZfindglobaltagsrr�r3rrrOr!r r�r�rr9rr
rr�rr�)r4rTZname1rirUZrev_r�rZexpectedtypeZalltagsr�r*r+r�r�r	rrWrWrXr��s�/
�



�

�
�
����

�����r�c	Ks�t�|�}|�d�|�d|�}|j}t|���D]�\}}||�}d}|�|�}	|	r\|	dkrbd}	nd|	}|��|j	|d�|j
dd||d	�d
dt�|�d}
|j
|jd
|
|j�|�||d	�|j
|jo�|	dd|	|d	�|�d�q2|��dS)alist repository tags

    This lists both regular and local tags. When the -v/--verbose
    switch is used, a third column "local" is printed for local tags.
    When the -q/--quiet switch is used, only the tag name is printed.

    .. container:: verbose

      Template:

      The following keywords are supported in addition to the common template
      keywords and functions such as ``{tag}``. See also
      :hg:`help templates`.

      :type:    String. ``local`` for local tags.

    Returns 0 on success.
    rystags.normalr�r=stags.rr�r�r�r��s %5d:%sr�r�s %sr�N)r(r_r�rr��reversedZtagslistr8r�r�r�rr�r�r�rr�rr�r�)r4rTrUr�r�r{r�Zhnryr8r�rWrWrXr3?s8



��r3rs
show patchsgitsuse git extended diff formats	[-p] [-g]cKs2t�|�}t�|||�}|�|d�|��dS)a6show the tip revision (DEPRECATED)

    The tip revision (usually just called the tip) is the changeset
    most recently added to the repository (and therefore the most
    recently changed head).

    If you have just made a commit, that commit will be the tip. If
    you have just pulled changes from another repository, the tip of
    that repository becomes the current tip. The "tip" tag is special
    and cannot be renamed or assigned to a different changeset.

    This command is deprecated, please use :hg:`heads` instead.

    Returns 0 on success.
    rN)r(r_r rIror�)r4rTrUrSrWrWrXr({s
r(�unbundles6update to new branch head if changesets were unbundleds[-u] FILE...cOs\|f|}|����|D]�}t�||�}t�|||�}t|tj�rZtj	t
d�t
d�d��d|}z`d}	t|tj�s�dt
�|�}	|�|	��$}
tj|||
d|d�}Wd�n1s�0YWnFtj�y}z*tjt
d	�||ft
d
�d��WYd}~n
d}~00t�|�}
qWd�n1�s,0Yt|||
|�d�dd��rTdSd
SdS)z�apply one or more bundle files

    Apply one or more bundle files generated by :hg:`bundle`.

    Returns 0 on success, 1 if an update has unresolved files.
    s3packed bundles cannot be applied with "hg unbundle"s$use "hg debugapplystreamclonebundle"rKsbundle:r<sunbundle
%s)r��urlNs%s: unknown bundle feature, %ssEsee https://mercurial-scm.org/wiki/BundleFeature for more informationr�rr)r�rr�rZ
readbundler�r2ZstreamcloneapplierrrQrrZ
unbundle20r;r�raZapplybundleZBundleUnknownFeatureErrorrLZcombinechangegroupresultsr�rM)r4rTZfname1�fnamesrUr�r��genr=Ztxnnamerl�opr�r�rWrWrX�unbundle�s@
��
�(��,rAsunshelves&abort an incomplete unshelve operations)continue an incomplete unshelve operations#use interactive mode (EXPERIMENTAL)skeep shelve after unshelvings&restore shelved change with given namersspecify merge tools+set date for temporary commits (DEPRECATED)s&hg unshelve [OPTION]... [[-n] SHELVED]cOsF|���*tj||g|�Ri|��Wd�S1s80YdS)a�restore a shelved change to the working directory

    This command accepts an optional name of a shelved change to
    restore. If none is given, the most recent shelved change is used.

    If a shelved change is applied successfully, the bundle that
    contains the shelved changes is moved to a backup location
    (.hg/shelve-backup).

    Since you can restore a shelved change on top of an arbitrary
    commit, it is possible that unshelving will result in a conflict
    between your changes and the commits you are unshelving onto. If
    this occurs, you must resolve the conflict, then use
    ``--continue`` to complete the unshelve operation. (The bundle
    will not be moved until you successfully complete the unshelve.)

    (Alternatively, you can use ``--abort`` to abandon an unshelve
    that causes a conflict. This reverts the unshelved changes, and
    leaves the bundle in place.)

    If bare shelved change (without interactive, include and exclude
    option) was done on newly created branch it would restore branch
    information to the working directory.

    After a successful unshelve, the shelved changes are stored in a
    backup directory. Only the N most recent backups are kept. N
    defaults to 10 but can be overridden using the ``shelve.maxbackups``
    configuration option.

    .. container:: verbose

       Timestamp in seconds is used to decide order of backups. More
       than ``maxbackups`` backups are kept, if same timestamp
       prevents from deciding exact order of them, for safety.

       Selected changes can be unshelved with ``--interactive`` flag.
       The working directory is updated with the selected changes, and
       only the unselected changes remain shelved.
       Note: The whole shelve is applied to working directory first before
       running interactively. So, this will bring up all the conflicts between
       working directory and the shelve, irrespective of which changes will be
       unshelved.
    N)r�rZunshelvecmd)r4rTZshelvedrUrWrWrX�unshelve�sK
rBsshelvedstatesunshelve already in progress)r�rNrPr
r�supdate|up|checkout|cos'discard uncommitted changes (no backup)schecksrequire clean working directorysmerge uncommitted changessrevisions[-C|-c|-m] [-d DATE] [[-r] REV]c
Kst�|ddd�|�d�}|�d�}|�d�}|�d�}|�d�}|rX|rXt�td���|�dd�r�|s�|s�|s�tjtd	�td
�d��|dus�|d
kr�|}|r�|dur�t�td���d}	|s�|dur�|s�d}	n|s�|dur�|s�d}	|����t�|�|�rt�	|||�}|}
|�r&t
�||gd�}tj
||dd�}|��}|��}d|�dd
�i}
|�|
d��&tj||||
||	d�}Wd�n1�s�0Y|�r�|��dd�}|�td�|�|���r�t�|||�}|�d|�|Wd�S1�s0YdS)a�update working directory (or switch revisions)

    Update the repository's working directory to the specified
    changeset. If no changeset is specified, update to the tip of the
    current named branch and move the active bookmark (see :hg:`help
    bookmarks`).

    Update sets the working directory's parent revision to the specified
    changeset (see :hg:`help parents`).

    If the changeset is not a descendant or ancestor of the working
    directory's parent and there are uncommitted changes, the update is
    aborted. With the -c/--check option, the working directory is checked
    for uncommitted changes; if none are found, the working directory is
    updated to the specified changeset.

    .. container:: verbose

      The -C/--clean, -c/--check, and -m/--merge options control what
      happens if the working directory contains uncommitted changes.
      At most of one of them can be specified.

      1. If no option is specified, and if
         the requested changeset is an ancestor or descendant of
         the working directory's parent, the uncommitted changes
         are merged into the requested changeset and the merged
         result is left uncommitted. If the requested changeset is
         not an ancestor or descendant (that is, it is on another
         branch), the update is aborted and the uncommitted changes
         are preserved.

      2. With the -m/--merge option, the update is allowed even if the
         requested changeset is not an ancestor or descendant of
         the working directory's parent.

      3. With the -c/--check option, the update is aborted and the
         uncommitted changes are preserved.

      4. With the -C/--clean option, uncommitted changes are discarded and
         the working directory is updated to the requested changeset.

    To cancel an uncommitted merge (and lose your changes), use
    :hg:`merge --abort`.

    Use null as the changeset to remove the working directory (like
    :hg:`clone -U`).

    If you want to revert just one file to an older revision, use
    :hg:`revert [-r REV] NAME`.

    See :hg:`help dates` for a list of formats valid for -d/--date.

    Returns 0 on success, 1 if there are unresolved files.
    r%�checkr!r�r�rr�r�syou must specify a destinationsfor example: hg update ".::"rKNr=s'you can't specify a revision and a daterFr�r~)r�rrBr�)r%�updatecheckrsupdated to hidden changeset %s
s(%s)
)rr`rMrrQrr�r�Zclearunfinishedrr.r�r r�r��hiddenr"rr�rrEr$r%Z_getfilteredreason)r4rTr�rUr�r�r%rCr!rDr�r�rEr,r�ZctxstrZ
obsfatemsgrWrWrXr�0sZE




�
�&
r�r�)r=�fullFs"perform more checks (EXPERIMENTAL)cKs(t�|�}d}|drtj}t�||�S)averify the integrity of the repository

    Verify the integrity of the current repository.

    This will perform an extensive check of the repository's
    integrity, validating the hashes and checksums of each entry in
    the changelog, manifest, and tracked files, as well as the
    integrity of their crosslinks and indices.

    Please see https://mercurial-scm.org/wiki/RepositoryCorruption
    for more information about recovery from corruption of the
    repository.

    Returns 0 on success, 1 if errors are encountered.
    NrF)r(r_�	verifymodZVERIFY_FULLrr6)r4rTrU�levelrWrWrXr6�s

r6cKs�t�|�}|jr|�d�|�d|�}|��|�dtd�t�	��td�}|j
s\|�|�|jrp|�td��g}g}g}tt
�
��D]6\}}|�|�|�t
�|�p�d�|�t
�|��q�|jddd	�}	|�r~d
tdd�|D��}
td
�td�g}t|||�D]v\}}
}|	��|	�|jd|
|�|j�rD|	�d||�|	j|d�|	�|j�o^|
dd|
�|j�r|	�d��q|	��|��dS)a�output version and copyright information

    .. container:: verbose

      Template:

      The following keywords are supported. See also :hg:`help templates`.

      :extensions: List of extensions.
      :ver:     String. Version number.

      And each entry of ``{extensions}`` provides the following sub-keywords
      in addition to ``{ver}``.

      :bundled: Boolean. True if included in the release.
      :name:    String. Extension name.
    rCsvers'Mercurial Distributed SCM (version %s)
s�(see https://mercurial-scm.org for more information)

Copyright (C) 2005-2022 Olivia Mackall and others
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
s
Enabled extensions:

Ns
extensionss{name}
r�s
  %%-%ds  css|]}t|�VqdSr�)r�r�rWrWrXr�r=zversion_.<locals>.<genexpr>sexternalsinternalr�s%s  )Zbundledr�r�)r(r_rr�rr�r�rr5�versionr�r�rHrr�Z
moduleversionZismoduleinternalr�r�r�r�r�r�)r4rUr��licenseriZversZisinternalsr��moduler�r�Zplacesr�r�r�rWrWrX�version_�sJ

��

rLcCs<dd�|D�}|r.|�td�|d�|�f�t�|�dS)z.Load command functions from specified cmdtablecSsg|]}|tvr|�qSrW)r)r�rQrWrWrXr�r=z loadcmdtable.<locals>.<listcomp>s&extension '%s' overrides commands: %s
r�N)rErr�rr�)r4r�Zcmdtabler,rWrWrX�loadcmdtables��rM)NN)NN)	NNNNNNNNN)N)FF)N)r=)r=)N)NNNNNNN)N)rt)r=)NN)N)N)N)N)�Z
__future__rrr�rbrtZi18nrr�rrrrr(r	�r
rrr
rrrrZdebugcommandsmodrrrrrrrrrrrrWrrrr r!r#r"r�r#r$r%r&r'r)r*r+r,r-r.r/r0rr1rCr2r3r9r4r�r5r6rGr7r�r8Zutilsr9r:r;rr�rNZ_tableZINTENT_READONLYZencodingmoderZ
dryrunoptsZ
remoteoptsrgZ
commitoptsZcommitopts2Zcommitopts3Z
formatteroptsZtemplateoptsZlogoptsr�Z
diffwsoptsZ	diffopts2Z
mergetooloptsZsimilarityoptsZsubrepooptsZdebugrevlogoptsZCATEGORY_CHANGE_MANAGEMENTrYZCATEGORY_WORKING_DIRECTORYrariZCATEGORY_FILE_CONTENTSr�ZCATEGORY_IMPORT_EXPORTr�r�r�ZCATEGORY_CHANGE_NAVIGATIONrMZCATEGORY_CHANGE_ORGANIZATIONrmr r�r�r�ZCATEGORY_REPO_CREATIONr�ZCATEGORY_COMMITTINGrr�Z
CATEGORY_HELPr	rrrr(r,r0r3r8r7rDZ
addunfinishedZhgabortgraftr�rxr�r�ZCATEGORY_REMOTE_REPO_MANAGEMENTr�r�r�r=ZCATEGORY_MAINTENANCEr�r�r�rrr�r�r�r�r�r�rFrfrr'r
r�rr$rSrUr�r(rArBZhgabortunshelveZhgcontinueunshelverLrMrWrWrWrX�<module>sT�1
����
�����B�

�
1�
G������� �'
P���
��
P���������!8o������	�
p����L��
��W������%�&�+
2����
�
7��
�����
�)�*�1��������
<
�����%�������������	�
�n������w�������J����1�����"�#�$�%�*c���	��	�����0�1�2�9Y�����F�����	�
��M��
�����*�+�,�-�2;��������!]�������4��	���������
����X�Y�Z�b(���9�����W���������� 8��	�
�8�S��Q&������#�$�*��	���N����� �!�'*�������5��������	�
�����	�a�5���	���������Q�R�Y+������	���5�6�;N���� �!�"�#�+Y�H�	�
��5���
���
/�����0�
���n��?

Youez - 2016 - github.com/yon3zu
LinuXploit