
    6h`                    P   S SK Jr  S SKrS SKrS SKJr  S SKJrJr  S SK	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJr  0 r\R@                  " \5      r S r!S r"S	 r#S
 r$S r%\RL                  " \S\%5        S r'S r(\ " SSS/ \" S5      4SS/ \" S5      4SSS\" S5      4SS/ \" S5      4SSS\" S5      4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/
\RR                  -   \" S'5      S#\ RT                  S(9S*S) j5       r+g)+    )annotationsN)_)hexshort)bundle2cmdutilcommands	discoveryencodingerrorexchange
extensionshg
narrowspecpathutilpycompat	registrarrepairrepoviewrequirementssparseutilwireprototypes)urlutilc                    [         R                  " [        R                  S[        5      n U S   R                  SSS[        S5      45        U S   R                  SSS[        S5      45        U S   R                  SS	S[        S
5      45        S[         R                  " 5       ;  aB  U S   R                  SS/ [        S5      45        U S   R                  SS/ [        S5      45        [         R                  " [        R                  S[        5      n U S   R                  SSS[        S5      45        [         R                  " [        R                  S[        5        g)z@Wraps user-facing mercurial commands with narrow-aware versions.s   clone          narrowNs%   create a narrow clone of select files   depths0   limit the history fetched by distance from headss
   narrowspecs   read narrowspecs from files   sparses   includes&   specifically fetch this file/directorys   excludes2   do not fetch this file/directory, even if includeds   pulls   archive)
r   wrapcommandr	   tableclonenarrowcmdappendr   enabledpullnarrowcmdarchivenarrowcmd)entrys    =/usr/lib/python3/dist-packages/hgext/narrow/narrowcommands.pysetupr)   /   s>    ""8>>8^LE	!HOO	iq!IJK 
!HOOAB		
 
!HOOS-a0M.NOP
**,,a*b!$M"NO	
 	aGH		
 ""8>>7MJE	!HOOAB		
 8>>:7GHr   c                  ^ [         R                  " 5       nTS   nU(       Ga   [        R                  R	                  [
        R                  " 5       U5      nUR                  [        S5      U-  5         [         R                  " U5      n[        R                   " XS5      u  pnU(       a  [        R"                  " [        S5      5      e[$        R&                  " U
5        [$        R&                  " U5        STS'   TS	   R)                  U
5        TS
   R)                  U5        TS   (       a"  U4S jn[*        R,                  " [.        SU5      nU   U " X/UQ70 TD6sSSS5        $ ! [         aG  n	[        R                  " [        S5      U[
        R                  " U	R                  5      4-  5      eSn	A	ff = f! , (       d  f       g= f)zAWraps clone command, so 'hg clone' first wraps localrepo.clone().r   s   reading narrowspec from '%s'
%   cannot read narrowspecs from '%s': %sNr   s9   cannot specify other files using '%include' in narrowspecTnarrowincludeexcludec                T   > U " X5        TR                  S5      (       a	  TS   US'   g g Ndepthr   getorigpullopkwargsoptss      r(   pullbundle2extraprepare_widen5clonenarrowcmd.<locals>.pullbundle2extraprepare_widen}   s-     xx  #'=x  !r   _pullbundle2extraprepare)r   nullcontextmanagerospathjoinr   getcwdstatusr   readfileOSErrorr   Abort
strtolocalstrerrorr   parseconfigConfigErrorr   validatepatternsextendr   wrappedfunctionr   )r5   uirepoargsr8   wrappedextrapreparenarrowspecfilefilepathfdatainstincludesexcludesprofilesr9   s       `         r(   r"   r"   Z   s   113,'N77<< 1>B
		!56AB	MM(+E (.'9'9"Y'O$H###  	##H-##H- XYx(Yx(H~	1 )8802O
 
B,t,t, 
	I  	++:;X00?@A 	H 
	s%   5E( F<(
F92AF44F9<
G
c                   ^ [         R                  " 5       n[        R                  UR                  ;   a"  U4S jn[        R
                  " [        SU5      nU   U " X/UQ70 TD6sSSS5        $ ! , (       d  f       g= f)z2Wraps pull command to allow modifying narrow spec.c                T   > U " X5        TR                  S5      (       a	  TS   US'   g g r0   r2   r4   s      r(   r9   4pullnarrowcmd.<locals>.pullbundle2extraprepare_widen   s-     xx  #'=x  !r   r;   N)r   r<   r   NARROW_REQUIREMENTr   rK   r   )r5   rL   rM   rN   r8   rO   r9   s       `  r(   r%   r%      sj    113&&$*;*;;	1
 )8802O
 
B,t,t, 
		s   A//
A=c                >   [         R                  UR                   ;   at  UR                  u  pV[        UR	                  S/ 5      5      n[        UR	                  S/ 5      5      n[
        R                  " XxXV5      u  pxn	U(       a  XtS'   U(       a  XS'   U " X/UQ70 UD6$ )z5Wraps archive command to narrow the default includes.r-   r.   )r   rZ   
narrowpatssetr3   r   restrictpatterns)
r5   rL   rM   rN   r8   repo_includesrepo_excludesrT   rU   unused_invalids
             r(   r&   r&      s    &&$*;*;;'+$txx	2./txx	2./-7-H-H.
*N &O&O(4(4((r   c                   UR                   n[        R                  UR                  ;  a  U " X5      $ [        R                  UR
                  R                  5       ;  a  [        R                  " [        S5      5      eU " X5        SUS'   UR                  u  pEXBS'   XRS'   U(       a  XBS'   U(       a  XRS'   [        R                  UR
                  R                  5       ;   av  UR                  SUR                  5       Vs/ s H<  nUR                  5       UR                  :w  d  M#  [!        UR                  5       5      PM>     snUS	'   US	   (       d  US		 g g g s  snf )
N%   server does not support narrow clonesTr   s   oldincludepatss   oldexcludepats   includepats   excludepats   ::%ln   known)rM   r   rZ   r   	NARROWCAPremotecapabilitiesr   rD   r   r\   ELLIPSESCAP1r]   commonnodenullidr   )r5   r6   r7   rM   r-   r.   ctxs          r(   pullbundle2extrapreparerp      s2   ;;D&&d.?.??F##v}}'A'A'CCkk!DEFFF9G ' '!(~!(~ ""fmm&@&@&BB xx&--8
8xxzT[[( C
O8
x
 h x 	   C
s   "E'Er;   c
           
       ^^ ^! [         R                  " TR                  XE5      m![         R                  " TR                  Xg5      m TR                  5       n
[        R
                  " XUS9nU R                  [        S5      5        U R                  [        S5      [        S5      [        UR                  5      [        UR                  5      -   S9n/ nU   [        R                  " UR                  UR                  5       HQ  nUR                  5         [        U U!4S jX   R!                  5        5       5      (       d  M@  UR#                  U5        MS     S S S 5        U
R%                  SU5      n[&        R(                  " TS5      n[+        U4S jUU-
   5       5      nU(       a  U R                  [        S	5      5        S
nU R,                  (       d  [        U5      U::  a'  U H   nU R                  S[/        U5      -  5        M"     ORUS U  H   nU R                  S[/        U5      -  5        M"     U R                  [        S5      [        U5      U-
  -  5        U(       d'  [0        R2                  " [        S5      [        S5      S9eU R5                  5          U(       a  U Vs/ s H  nU
R6                  R9                  U5      PM      nnTS   R9                  5       U;   aD  [;        TR%                  STS   R9                  5       U5      5      n[<        R>                  " TU5        SS0nU	(       a  U R                  [        S5      5        OU R                  [        S5      5        U RA                  US5         [B        RD                  " X
USU	S9  S S S 5        / nTRF                  RI                  5        GH%  nURJ                  (       d  M  URL                  (       aM  T " URN                  5      (       d4  UR!                  5        H  nUR#                  URP                  5        M      Ms  Mu  URR                  (       d  M  URN                  S S n[U        [V        RX                  " U15      5      U/-   nSnU H'  nT R[                  U5      nU(       d  Sn  OUS:X  d  M'    O   U(       a  M  UR!                  5        H  nUR#                  URP                  5        M      GM(     TR]                  5         TR_                  S5         TRa                  Xg5        U Hj  nU R                  [        S5      U-  5        [b        Rd                  " TRf                  Ri                  U5      5        TRF                  Rk                  U5        Ml     U R                  [        S5      5        TRl                  Ro                  T5         [         Rp                  " TSS9  [         Rr                  " T5        S S S 5        S S S 5        TRu                  5         S S S 5        g ! , (       d  f       GN= fs  snf ! , (       d  f       GN= f! , (       d  f       NX= f! , (       d  f       Na= f! , (       d  f       g = f)N	commonincs,   looking for local changes to affected paths
s
   changesets)topicunittotalc              3  \   >#    U  H!  nT" U5      =(       a    T" U5      (       + v   M#     g 7fN ).0fnewmatcholdmatchs     r(   	<genexpr>_narrow.<locals>.<genexpr>   s#     LOq8A;2x{?2Os   ),s   descendants(%ln)s   visiblec              3  Z   >#    U  H   nTR                   R                  U5      v   M"     g 7frx   )	changelogrm   )rz   rrM   s     r(   r~   r      s'      )A1A)As   (+sT   The following changeset(s) or their ancestors have local changes not on the remote:

      %s
s*   ...and %d more, use --verbose to list all
s   local changes founds*   use --force-delete-local-changes to ignore)hint   .s   (::%n) - %ln + null)   devels   strip-obsmarkersFs%   moving unwanted changesets to backup
s   deleting unwanted changesets
r   )rt   backupTs   alls	   narrowings   deleting %s
s*   deleting unwanted files from working copy
)assumeclean);r   matchroot
unfilteredr
   findcommonoutgoingrA   r   makeprogresslenmissingexcluded	itertoolschain	incrementanyfilesr#   revsr   
filterrevslistverboser   r   
StateErroruninterruptibler   rm   maxr   cleanconfigoverrider   stripstoredata_entries	is_revlog
is_filelog	target_idunencoded_pathis_manifestlogsortedr   dirsvisitdir
destroyingtransactionsetnarrowpatsr   
unlinkpathsvfsr?   markremoveddirstatechanging_parentsupdateworkingcopycopytoworkingcopy	destroyed)"rL   rM   ri   rs   oldincludesoldexcludesnewincludesnewexcludesforcer   unfioutgoingprogress
localnodesnrevstostrip
hiddenrevsvisibletostripmaxnodesr   tostripurev	overridestodeleter'   file_dirr   r-   dvisitr{   r|   r}   s"    `                              @@r(   _narrowr      s    		;DH		;DH
 ??D++DINHIIa@AB}(""#c(*;*;&<<  H
 J	!1!183D3DEA LDGMMOLLL!!!$ F 

 ))/<K$$T:6J )4z)A N 
		6	
 ::^,8#		'E!H,- $ $IX.		'E!H,- /II@A~&13 ""()DE 
 
			7BC{!t~~**1-{GCDz G+II.T
)& t$8%@I		!EFG		!=>?""9i8RwiO 9 ZZ,,.E??00!& (<(<= "/ 1 %%%oocr*hmmSE23se;A$--a0E "'  w!& (<(<= "/' /, 	l+ {8		!,-12		q 12

&&q) 
 IIaFGH//5,,TtD,,T2 6 , 	{ 
	E 
H D  98N 65 ,+] 
	s   A(XXY%%X
B/Y9X#B(Y=AY	Y(AY B7Y7,X5#Y+Y
XY#
X2	-Y5
Y?Y
Y	Y
Y%c                  ^^^^ UR                  5       m[        U4S j[        R                   5       5      nU=(       a-    [        R                  T;   =(       a    [        R
                  T;  n	UU4S jn
[        R                  " [        SU
5      nUUU4S jnUTl	        SS0nUS   nU R                  5          U(       al  TR                  nUR                  5       UR                  5       nnUR                  T5         UR                  TR                   TR                   5        S S S 5        U	(       a"  U   [        R"                  " TX.S9  S S S 5        GO(/ nU(       aP  TR%                  S	U5       Vs/ s H3  nUR'                  5       TR                   :w  d  M#  UR'                  5       PM5     nnUR)                  5        nUR+                  S
UUTTSUUUS.5      R-                  5       nS S S 5        [        R.                  " TSUR1                  5       5      nU   TR2                  R5                  US5         [6        R8                  " TUR:                  SS9n[6        R<                  " TWUUS9  S S S 5        S S S 5        U(       a,  WR                  T5         UR                  WW5        S S S 5        TR;                  S5         TR                  R                  T5         TR                  5         [>        R@                  " T5        [>        RB                  " T5        S S S 5        S S S 5        S S S 5        g ! , (       d  f       GN= f! , (       d  f       N= fs  snf ! , (       d  f       GNz= f! , (       d  f       GN= f! , (       d  f       GN= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       N= f! , (       d  f       g = f)Nc              3  ,   >#    U  H	  oT;   v   M     g 7frx   ry   )rz   cap	remotecaps     r(   r~   _widen.<locals>.<genexpr>`  s      $HSy$Hs   c                *   > U " X5        TUS'   TUS'   g )Nrd   re   ry   )r5   r6   r7   r   r   s      r(   r9   -_widen.<locals>.pullbundle2extraprepare_widenl  s    V!,~!,~r   r;   c                 *   > TR                  TT 5        g rx   )r   )r   r   rM   s   r(   setnewnarrowpats _widen.<locals>.setnewnarrowpatsx  s    ;4r   )r   s   all-warningsFr   )headsrf   s   narrow_widens   03)s   oldincludess   oldexcludess   newincludess   newexcludess	   cgversions   commonheadsrg   s   ellipsess   widen)source)opri   s   widening)"rj   r   r   SUPPORTED_ELLIPSESCAPrk   ELLIPSESCAPr   rK   r   r   r   r   p1p2r   
setparentsrn   pullr]   rm   commandexecutorcallcommandresulttransactionmanagerurlrL   r   r   bundleoperationr   processbundler   r   r   )rL   rM   ri   rs   r   r   r   r   ellipsesremoteisoldellipsesr9   rO   r   r   rl   dsr   r   knownro   ebundle	trmanagerr   r   s    `    ``                @r(   _widenr   O  s     ##%I $2$H$H N 	 	8''94	8&&i7 - %44,.K5 -D,e4Iq\F				BUUWbeegB$$T*dkk4;;7 +$dF9 %$ E  $xx&99xxzT[[0 CHHJ9  
 '')Q#(3(3(3(3&+(."'%3	 &(  * !33h

I DGG229hG,,)// %%dFr&I H $$T*b"% + k*DMM,J,J-
 !!#((.((.-
*] 
	 +* %$

 *)$ HG +*-
 -
**] 
	s   9AO>'L4%O6M'O3"MM-O?*M)0ON 68M..N 6 ON)ON4=N#N4#O4
M	>O
M	O
M+	&O.
M=8N  
N	
O
N 	O#
N1-N44
O	>O
O   trackedr   s
   addincludes   new paths to includes   removeincludes   old paths to no longer includes   auto-remove-includesFs.   automatically choose unused includes to removes
   addexcludes   new paths to excludes   import-ruless   import narrowspecs from a files   removeexcludes   old paths to no longer excludes   clears*   whether to replace the existing narrowspecs   force-delete-local-changess/   forces deletion of local changes when narrowings   backupTs$   back up local changes when narrowings   update-working-copys.   update working copy when the store has changeds   [OPTIONS]... [REMOTE])	inferrepohelpcategoryc                  ^$ [         R                  UR                   ;  a  [        R                  " [	        S5      5      eUS   (       a  [        R                  " [	        S5      5      eUR                  S5      nU(       a  [        R                  R                  [        R                  " 5       U5      n [        R                  " U5      n["        R$                  " XS5      u  pnU(       a  [        R                  " [	        S5      5      eUS	   R'                  U	5        US
   R'                  U
5        [(        R*                  " US	   5      n[(        R*                  " US   5      n[(        R*                  " US
   5      n[(        R*                  " US   5      nUS   nUS   nU=(       d/    U=(       d&    U=(       d    U=(       d    U=(       d    U=(       d    U(       + nU(       a  UR,                  u  nnU R/                  S5        U R1                  S[2        R4                  " U5      5      n[7        U5       H7  nUR9                  5         UR;                  SSSSS9  UR;                  SSUSS9  M9     [7        U5       H7  nUR9                  5         UR;                  SSSSS9  UR;                  SSUSS9  M9     UR=                  5         gUR?                  5          URA                  5          UR,                  u  nnUU-  nUU-  nUU-  nUU-  nU=(       d    UnU=(       d    UnU(       a|  URC                  S5         URD                  RG                  U5         [(        RH                  " U5        [(        RJ                  " U5        SSS5        SSS5         SSS5        SSS5        gU(       d:  U(       d3  U(       d,  U RM                  [	        S5      5         SSS5        SSS5        g[N        RP                  " U5        [R        RT                  " SX5      nU RM                  [	        S5      [R        RV                  " URX                  5      -  5        [Z        R\                  " U[2        R4                  " U5      U5      n U(       aA  [^        R`                  URc                  5       ;  a  [        Rd                  " [	        S5      5      e[f        Rh                  " UU5      nU(       Gab  [f        Rj                  " UUUS9nU RM                  [	        S5      5        [m        5       n[n        Rp                  " URr                  URt                  5       H%  nURw                  UU   Ry                  5       5        M'     / n[7        U5       HS  n [(        Rz                  " UR|                  U /U5      m$[        U$4S  jU 5       5      (       a  MB  UR                  U 5        MU     U(       aO  U H  n!U RM                  SU!-  5        M     U R                  [	        S!5      5      S:X  a  URw                  U5        S"nOU RM                  [	        S#5      5        U(       a(  UU-
  n"UU-  n#[        U UUUUUU"U#US$   US%   5
        U"nU#nU(       a  UU-  n"UU-
  n#[        U UUUUUU"U#5        UR                  5          SSS5        SSS5        g! [         aG  n[        R                  " [	        S5      U[        R                  " UR                   5      4-  5      eSnAff = f! , (       d  f       GN= f! , (       d  f       GN= f! UR                  5         f = f! , (       d  f       N= f! , (       d  f       g= f)&a  show or change the current narrowspec

With no argument, shows the current narrowspec entries, one per line. Each
line will be prefixed with 'I' or 'X' for included or excluded patterns,
respectively.

The narrowspec is comprised of expressions to match remote files and/or
directories that should be pulled into your client.
The narrowspec has *include* and *exclude* expressions, with excludes always
trumping includes: that is, if a file matches an exclude expression, it will
be excluded even if it also matches an include expression.
Excluding files that were never included has no effect.

Each included or excluded entry is in the format described by
'hg help patterns'.

The options allow you to add or remove included and excluded expressions.

If --clear is specified, then all previous includes and excludes are DROPPED
and replaced by the new ones specified to --addinclude and --addexclude.
If --clear is specified without any further options, the narrowspec will be
empty and will not match any files.

If --auto-remove-includes is specified, then those includes that don't match
any files modified by currently visible local commits (those not shared by
the remote) will be added to the set of explicitly specified includes to
remove.

--import-rules accepts a path to a file containing rules, allowing you to
add --addinclude, --addexclude rules in bulk. Like the other include and
exclude switches, the changes are applied immediately.
sJ   the tracked command is only supported on repositories cloned with --narrowclears'   the --clear option is not yet supportedimport_rulesr+   Nr   sJ   including other spec files using '%include' is not supported in narrowspec
addinclude
addexcluderemoveincluderemoveexcludeauto_remove_includesupdate_working_copyr   s   statuss   %s    Is   narrow.included)labels   patr      Xs   narrow.excludedr   s	   narrow-wcs   nothing to widen or narrow
s   comparing with %s
rc   rr   s&   looking for unused includes to remove
c              3  4   >#    U  H  nT" U5      v   M     g 7frx   ry   )rz   r{   r   s     r(   r~   trackedcmd.<locals>.<genexpr>  s     <AuQxxs   s0   remove these unused includes (Yn)?$$ &Yes $$ &NoTs   found no unused includes
force_delete_local_changesr   )Er   rZ   r   
InputErrorr   r3   r=   r>   r?   r   r@   r   rB   rC   StorageErrorrE   rF   r   rG   rJ   r   parsepatternsr\   pager	formatterr   byteskwargsr   	startitemwriteendwlocklockr   r   r   r   r   rA   r   bailifchangedr   get_unique_pull_path_objhidepasswordlocr   peerr   rh   rj   rD   r
   findcommonincomingr   r]   r   r   r   r   updater   r   r   r   r#   promptchoicer   r   close)%rL   rM   
remotepathpatsr8   newrulesrQ   rR   rS   includepatsexcludepatsrV   addedincludesremovedincludesaddedexcludesremovedexcludesautoremoveincludesr   	only_showr   r   fmiwidening	narrowingr>   ri   rs   r   
localfilesr   suggestedremovalsr-   sr   r   r   s%                                       @r(   
trackedcmdr(    s[   Z &&d.?.??5
 	
 G}q!KLMM xx'H77<< 18<	MM(+E .4-?-?y.
*( ""6  	\!!+.\!!+.,,T,-?@M ..tO/DEO,,T,-?@M ..tO/DEO4545 			 	 		
 	 I #'?? [
\\)X%9%9$%?@$ALLNHHY4FHGHHVWa/AHB % $ALLNHHY4FHGHHVWa/AHB % 		tyy{#'?? [ 	$;&$;& 3O#4}	!!,/1O1O2 ,,T2,,T2	2/
 ' #* I);IIa789/ #2 	d#
 //
BK
		!*+g.B.B488.LLMx33D94@M	
 ",,F4G4G4IIkk!$L"MNN!44T6BI!$77&I 		!FGH U
")9)98;L;LMA%%d1gmmo6 N$&!%k2G&,,TYY	;OE<<<<)009  3 %.		'A+. / !2  (../@A$(	IIa =>?)O;)M956N *))M9)O;	 LLN_ #b I  	$$:;X00?@A 	B2 2//B LLN_ #{b s   4Z8 ](A]:\-\	\	]]%0]]&B];E \0?C\0]']8
\	A\\	
\\
\-(]0]]
]	]
]$rx   ),
__future__r   r   r=   mercurial.i18nr   mercurial.noder   r   	mercurialr   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   mercurial.utilsr   r!   commandr)   r"   r%   r&   rp   wrapfunctionr   r   
remoteoptsCATEGORY_MAINTENANCEr(  ry   r   r(   <module>r2     s   #  	      * 	


E
"(IV/-d-$) !>   (*A
zzd/P 		mR#:!;<	A&G$HI#?@		
 
mR#:!;<	osA&G$HI	A&G$HI;<		
 )@A		
 56		
 "?@		
=$J K%L --U+XXY+XXr   