
    6hg                    (   S r SSKJr  SSKrSSKJr  SSKJrJrJ	r	J
r
Jr  SSKJr  0 r\R                  " \5      r\" SS	S
S\" S5      4S	SS\" S5      4S	SS	\" S5      4S	SS	\" S5      4S	SS	\" S5      4S	SS\" S5      4/\" S5      SSS9S 5       rg)a'  chainsaw is a collection of single-minded and dangerous tools. (EXPERIMENTAL)

  "Don't use a chainsaw to cut your food!"

The chainsaw is a collection of commands that are so much geared towards a
specific use case in a specific context or environment that they are totally
inappropriate and **really dangerous** in other contexts.

The help text of each command explicitly summarizes its context of application
and the wanted end result.

It is recommended to run these commands with the ``HGPLAIN`` environment
variable (see :hg:`help scripting`).
    )annotationsN   )_)cmdutilcommandserror	localrepo	registrar)urlutils   admin::chainsaw-update    s   purge-unknownTsx   Remove unversioned files before update. Disabling this can in some cases interfere with the update.See also :hg:`purge`.s   purge-ignoreds|   Remove ignored files before update. Disable this for instance to reuse previous compiler object files. See also :hg:`purge`.s   revs   revision to update tos   sources   repository to clone froms   dests.   repository to update to REV (possibly cloning)s   initial-clone-minimalFs   Pull only the prescribed revision upon initial cloning. This has the side effect of ignoring clone-bundles, which if often slower on the client side and stressful to the server than applying available clone bundles.sH   hg admin::chainsaw-update [OPTION] --rev REV --source SOURCE --dest DEST)	helpbasicnorepoc                   US   nUS   nUS   nU(       d  [         R                  " [        S5      5      eU(       d  [         R                  " [        S5      5      eU(       d  [         R                  " [        S5      5      e[        R                  " U5      n [
        R                  " XSS9nSnU R                  [        S	U-  5      5        UR                  R                  S5      (       a  U R                  [        S5      5        UR                  R                  S5      (       a  U R                  [        S5      5        UR                  5          UR!                  5          U R                  [        S5      5        UR#                  5         U R                  [        S5      U-  5        U(       a  UR%                  S5      (       d  / nOU/nSS0nUR&                  R)                  US5         [*        R,                  " S[.        R0                  5      S   S   n	U	" UR&                  UUUSS9n
U
(       a  U
sSSS5        sSSS5        sSSS5        $  SSS5        [*        R,                  " S[.        R0                  5      S   S   nU" U USUR%                  S5      UR%                  S5      SS9n
U
(       a  U
sSSS5        sSSS5        $ U R                  [        S 5      U-  5        [*        R,                  " S![.        R0                  5      S   S   nU" XUSS"9n
U
(       a  U
sSSS5        sSSS5        $ U R                  [        S#5      X%R2                  4-  5        SSS5        SSS5        g! [         R                   a     [        R                  " U5        U R                  [        S
U-  5      5        O-! [         a     U R                  [        SU-  5      5         Of = fU R                  [        SU-  5      5        [
        R                  " XSS9nSn GNMf = f! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       g= f)$au  pull and update to a given revision, no matter what, (EXPERIMENTAL)

Context of application: *some* Continuous Integration (CI) systems,
packaging or deployment tools.

Wanted end result: local repository at the given REPO_PATH, having the
latest changes to the given revision and with a clean working directory
updated at the given revision.

chainsaw-update pulls from one source, then updates the working directory
to the given revision, overcoming anything that would stand in the way.

By default, it will:

- clone if the local repo does not exist yet, **removing any directory
  at the given path** that would not be a Mercurial repository.
  The initial clone is full by default, so that clonebundles can be
  applied. Use the --initial-clone-minimal flag to avoid this.
- break locks if needed, leading to possible corruption if there
  is a concurrent write access.
- perform recovery actions if needed
- revert any local modification.
- purge unknown and ignored files.
- go as far as to reclone if everything else failed (not implemented yet).

DO NOT use it for anything else than performing a series
of unattended updates, with full exclusive repository access each time
and without any other local work than running build scripts.
In case the local repository is a share (see :hg:`help share`), exclusive
write access to the share source is also mandatory.

It is recommended to run these commands with the ``HGPLAIN`` environment
variable (see :hg:`scripting`).

Motivation: in Continuous Integration and Delivery systems (CI/CD), the
occasional remnant or bogus lock are common sources of waste of time (both
working time and calendar time). CI/CD scripts tend to grow with counter-
measures, often done in urgency. Also, whilst it is neat to keep
repositories from one job to the next (especially with large
repositories), an exceptional recloning is better than missing a release
deadline.
revsourcedests$   specify a target revision with --revs!   specify a pull path with --sources   specify a repo path with --destF)creates   loaded repository at "%s"
s0   removed non-repository file or directory at "%s"s   no such directory: "%s"
s   creating repository at "%s"
Ts   locks   had to break store lock
s   wlocks   had to break working copy lock
s1   recovering after interrupted transaction, if any
s   pulling from %s
initial_clone_minimal)s   uis   quiets   chainsaw-updates   pull   r   )r   remote_hiddenNs   purgepurge_ignoredpurge_unknown)dirsallfilesconfirms   updating to revision '%s'
s   update)r   cleans=   chainsaw-update to revision '%s' for repository at '%s' done
)r   
InputErrorr   r   urllocalpathr	   instancestatus	RepoErrorshutilrmtreeFileNotFoundErrorsvfs	tryunlinkvfswlocklockrecovergetuiconfigoverrider   findcmdr   tableroot)r-   optsr   r   	repo_pathreporepo_created	pull_revs	overridespullretpurgeupdates                :/usr/lib/python3/dist-packages/mercurial/admin/chainsaw.pyr;   r;   *   s   L u+C(^FVIq!HIJJq!EFGGq!CDEE$$Y/I!!">
		!2Y>?@$ yy7##
		!012xx(##
		!789 
tyy{
		!IJK
		!()F23)@ A AII&-	WW##I/AB??7HNN;A>qAD#C  CB #{&  C (..9!<Q?)((?+
 A #{D 			!45;<HNN;A>qAR3d3M #{P 			3 II		
Q #/ ?? 
	MM)$ II!*+ ! 	CIIa4y@AB	C 			!4y@AB!!"=B CB #{s   4M- Q"BP0-AP5	P0>	QA$P06	Q	AP0!	Q4(P0Q-PN6P6'O PO  7PP
P-(P00
P>	:Q
Q)__doc__
__future__r   r#   i18nr    r   r   r   r	   r
   utilsr   cmdtablecommandr;    r   r<   <module>rE      s   #    


H
% 	 )			
 )			
 &'		
 )*		
 ?@		
 $H	
	
O2f S s:v
w:v
r   