ó
    6°h‹k  ã                  ó(  • S SK Jr  S SKrSSKJr  SSKJr  SSKJrJ	r
JrJrJrJrJrJrJr  SSKJr  SrS	 rS
 rS rS rS rSS jrS rS rS rS r S r!S r"SS jr#S r$S S jr%S r& S!S jr'S S jr(S S jr)        S"S jr*      S#S jr+g)$é    )ÚannotationsNé   )Ú_)Úhex)	ÚerrorÚmatchÚmergeÚ
mergestateÚpathutilÚpycompatÚrequirementsÚscmutilÚutil)ÚhashutilFc                ób   • [        U SS5      (       a  g[        R                  U R                  ;   $ )NÚ_has_sparseFT)Úgetattrr   ÚSPARSE_REQUIREMENT)Úrepos    Ú2/usr/lib/python3/dist-packages/mercurial/sparse.pyÚ
use_sparser   "   s-   € Üˆt�] E×*Ñ*ð
 Ü×*Ñ*¨d×.?Ñ.?Ñ?Ð?ó    c                ó�  • [         R                  " S[        U5      U5         [        5       n[        5       n[        5       nSnSnUR	                  S5       GHO  nUR                  5       nU(       a  UR                  S5      (       a  M3  UR                  S5      (       a/  USS R                  5       nU(       a  UR                  U5        Mv  Mx  US:X  a6  U(       a)  Xc:w  a$  [        R                  " [        S	5      S
U0-  5      eSnUnM´  US:X  a  SnUnMÀ  U(       d  MÉ  Uc,  [        R                  " [        S5      X(S.-  [        S5      S9eUR                  5       R                  S5      (       a"  U R                  [        S5      X(S.-  5        GM>  UR                  U5        GMR     X4U4sSSS5        $ ! , (       d  f       g= f)z¤Parse sparse config file content.

action is the command which is trigerring this read, can be narrow, sparse

Returns a tuple of includes, excludes, and profiles.
z+sparse.parseconfig(ui, %d bytes, action=%s)NFó   
ó   #s	   %include é	   s	   [include]s5   %(action)s config cannot have includes after excludesó   actionTs	   [exclude]s4   %(action)s config entry outside of section: %(line)s)r   s   lines<   add an [include] or [exclude] line to declare the entry type)Úhintó   /sP   warning: %(action)s profile cannot use paths starting with /, ignoring %(line)s
)r   ÚtimedcmÚlenÚsetÚsplitÚstripÚ
startswithÚaddr   ÚAbortr   Úwarn)	ÚuiÚrawÚactionÚincludesÚexcludesÚprofilesÚcurrentÚhavesectionÚlines	            r   Úparseconfigr2   ,   s³  € ô 
�ŠØ5´s¸3³xÀõ
ô “5ˆÜ“5ˆÜ“5ˆØˆØˆà—I‘I˜e×$ˆDØ—:‘:“<ˆDÞ˜4Ÿ?™?¨4×0Ñ0áØ—‘ ×.Ñ.Ø˜A˜B�x—~‘~Ó'�ÞØ—L‘L Ö&ñ à˜Ó%Þ 7Ó#6äŸ+š+Üð.óð % fÐ-ñ	.óð ð #�Ø"�ÙØ˜Ó%Ø"�Ø"’ß�Ø‘?ÜŸ+š+Üð1óð '-Ñ<ñ	=ô
 ð9óñ
ð 
ð —:‘:“<×*Ñ*¨4×0Ñ0Ø—G‘GÜðKóð '-Ñ<ñ	=ôò Ø—‘˜D×!ña %ðd  8Ð+÷w
÷ 
÷ 
ús   ¢C9F7ÄBF7Æ7
Gc                ó<   • U R                  XS9R                  5       $ )z1Resolve the raw content of a sparse profile file.)Úchangeid)ÚfilectxÚdata)r   Úprofiler4   s      r   Úreadprofiler8   r   s   € ð �<‰<˜ˆ<Ð3×8Ñ8Ó:Ð:r   c                óÐ  • [        U 5      (       d  [        5       [        5       [        5       4$ U R                  R                  S5      nU(       d  [        5       [        5       [        5       4$ Uc  [        R
                  " [        S5      5      e[        U R                  US5      u  p4nX   nU(       až  [        5       nU(       a‹  UR                  5       nX‡;   a  M  UR                  U5         [        XU5      n[        U R                  US5      u  p«nUR!                  U
5        UR!                  U5        UR!                  U5        U(       a  M‹  UnU(       a  UR                  S5        X4U4$ ! [        R                   ac    SX†4-  n	U R                  R                  SS5      (       a  U R                  R                  U	5        OU R                  R                  U	5         GM&  f = f)z€Obtain sparse checkout patterns for the given rev.

Returns a tuple of iterables representing includes, excludes, and
patterns.
ó   sparses3   cannot parse sparse patterns from working directorys?   warning: sparse profile '%s' not found in rev %s - ignoring it
s   missingwarnings   .hg*)r   r"   ÚvfsÚtryreadr   r'   r   r2   r)   Úpopr&   r8   ÚManifestLookupErrorÚ
configboolr(   ÚdebugÚupdate)r   Úrevr*   r,   r-   r.   ÚctxÚvisitedr7   ÚmsgÚ	pincludesÚ	pexcludesÚsubprofss                r   ÚpatternsforrevrI   y   sœ  € ô �d×ÑÜ‹u”c“eœS›UÐ"Ð"à
�(‰(×
Ñ
˜9Ó
%€CÞÜ‹u”c“eœS›UÐ"Ð"à
�{Ü�kŠkÜÐDÓEó
ð 	
ô $/¨t¯w©w¸¸YÓ#GÑ €H˜Ø
‰)€CæÜ“%ˆÞØ—l‘l“nˆGØÓ!Ùà�K‰K˜Ô ðÜ! $°Ó5�ô .9Ø—‘˜˜ió.Ñ*ˆI (ð �O‰O˜IÔ&Ø�O‰O˜IÔ&Ø�O‰O˜HÔ%÷5 ˆhð8 ˆæØ�‰�WÔà˜xÐ'Ð'øô1 ×,Ñ,ó 
ð1Ø4;°>ñBð ð
 —7‘7×%Ñ% iÐ1B×CÑCØ—G‘G—L‘L Õ%à—G‘G—M‘M #Ô&Ûð
ús   Ã.E. Å.A2G%Ç$G%c                ó>  • U R                   R                  5        Vs/ s H/  nXR                  :w  d  M  U R                  R	                  U5      PM1     nn[        5       n[        5       n[        5       nU H  n[        X5      u  pxn	X7-  nXH-  nXY-  nM     X4U4$ s  snf )z±Determine the active sparse config rules.

Rules are constructed by reading the current sparse config and bringing in
referenced profiles from parents of the working directory.
)ÚdirstateÚparentsÚnullidÚ	changelogrB   r"   rI   )
r   ÚnodeÚrevsÚallincludesÚallexcludesÚallprofilesrB   r,   r-   r.   s
             r   ÚactiveconfigrT   µ   s¦   € ð —M‘M×)Ñ)Ô+óâ+ˆDØ—;‘;Ñó 	!ˆ�‰×Ñ˜4Ö Ù+ð 	ð ô “%€KÜ“%€KÜ“%€KãˆÜ'5°dÓ'@Ñ$ˆ˜HØÑˆØÑˆØÑŠñ	 ð  [Ð0Ð0ùò!s
   �B´Bc                óÒ  • U R                   nUR                  S5      nU(       a  UR                  S5      nOSnUb
  U(       a   Uc�  [        [        R                  " U R
                  R                  S5      5      R                  5       5      nX2S'   U(       aL  U R
                  R                  S5      n[        [        R                  " U5      R                  5       5      nXBS'   SX44-  $ )zwObtain the signature string for the current sparse configuration.

This is used to construct a cache key for matchers.
s	   signatures   tempsignatureó   0r:   ó
   tempsparseó   %s %s)Ú_sparsesignaturecacheÚgetr   r   Úsha1r;   r<   Údigest)r   ÚincludetempÚcacheÚ	signatureÚtempsignaturer*   s         r   Úconfigsignaturera   Î   s¾   € ð
 ×&Ñ&€Eà—	‘	˜,Ó'€IæØŸ	™	Ð"2Ó3‰àˆàÑž[¨]Ñ-BÜœŸš d§h¡h×&6Ñ&6°yÓ&AÓB×IÑIÓKÓLˆ	Ø'ˆlÑæØ—(‘(×"Ñ" =Ó1ˆCÜ¤§¢¨cÓ 2× 9Ñ 9Ó ;Ó<ˆMØ&3Ð"Ñ#à�yÐ0Ñ0Ð0r   c                ó  • U R                  SS5       n[        U5       H  nUR                  SU-  5        M     U(       aE  UR                  S5        [        U5       H%  nUR                  U5        UR                  S5        M'     U(       aE  UR                  S5        [        U5       H%  nUR                  U5        UR                  S5        M'     SSS5        U R                  R	                  5         g! , (       d  f       N)= f)z:Write the sparse config file given a sparse configuration.r:   s   wbs   %%include %s
s
   [include]
r   s
   [exclude]
N)r;   ÚsortedÚwriterY   Úclear)r   r,   r-   r.   ÚfhÚpÚiÚes           r   Úwriteconfigrj   è   sÁ   € à	�‰�)˜UÔ	# rÜ˜Ö!ˆAØ�H‰HÐ&¨Ñ*Ö+ñ "ö Ø�H‰H�^Ô$Ü˜HÖ%�Ø—‘˜”Ø—‘˜–ñ &ö Ø�H‰H�^Ô$Ü˜HÖ%�Ø—‘˜”Ø—‘˜–ñ &÷ 
$ð  	×Ñ×$Ñ$Õ&÷! 
$Õ	#ús   “B?C5Ã5
Dc                óŽ   • U R                   R                  S5      nU(       d
  [        5       $ [        UR                  S5      5      $ ©NrW   r   )r;   r<   r"   r#   )r   r*   s     r   Úreadtemporaryincludesrm   ý   s4   € Ø
�(‰(×
Ñ
˜=Ó
)€CÞÜ‹uˆäˆs�y‰y˜ÓÓ Ð r   c                ó    • U R                   R                  SSR                  [        U5      5      5        U R                  R                  5         g rl   )r;   rd   Újoinrc   rY   re   )r   r,   s     r   Úwritetemporaryincludesrp     s4   € Ø‡H�H‡N�N�= %§*¡*¬V°HÓ-=Ó">Ô?Ø×Ñ×$Ñ$Õ&r   c                ód   • [        U 5      nU H  nUR                  U5        M     [        X5        g ©N)rm   r&   rp   )r   Ú
additionalr,   rh   s       r   Úaddtemporaryincludesrt   
  s)   € Ü$ TÓ*€HÛˆØ�‰�QŽñ ä˜4Õ*r   c           	     óx  • [        U 5      (       a   U R                  R                  S5      (       d  g U R                  5       nUR                  (       d3  UR
                  (       d"  UR                  (       d  UR                  (       a  g [        U SS9nU R                  n[        R                  " 5       n/ n[        U 5      nU HW  nXs;   d  M
  U" U5      (       a  M  [        S5      nUR                  U[        R                   S U5        UR#                  U5        MY     [        R$                  " XU S    U S   SSS9  U H  nUR'                  USSS9  M     U R                  R)                  S5        U R*                  R-                  5         [        S5      n	U R.                  R                  U	[1        U5      -  5        g )	NrW   F©r]   s*   dropping temporarily included sparse filesó   .©Úwantfiledata©Ú
p1_trackedÚ
wc_trackedsA   cleaned up %d temporarily added file(s) from the sparse checkout
)r   r;   ÚexistsÚstatusÚmodifiedÚaddedÚremovedÚdeletedÚmatcherrK   ÚmergemodÚmergeresultrm   r   ÚaddfileÚmergestatemodÚACTION_REMOVEÚappendÚapplyupdatesÚupdate_fileÚunlinkrY   re   r)   r!   )
r   ÚsÚsparsematchrK   ÚmresultÚdroppedÚtempincludesÚfileÚmessagerE   s
             r   Úprunetemporaryincludesr”     sW  € Ü�d×Ñ 4§8¡8§?¡?°=×#AÑ#AØà�‰‹€AØ‡z‡z�Q—W—W §	§	¨Q¯Y¯Yàä˜$¨EÑ2€KØ�}‰}€HÜ×"Ò"Ó$€GØ€GÜ(¨Ó.€LÛˆØÕ¡K°×$5Ó$5ÜÐEÓFˆGØ�O‰O˜D¤-×"=Ñ"=¸tÀWÔMØ�N‰N˜4Ö ñ	 ô ×ÒØ�t˜D‘z 4¨¡:¨uÀ5òó
 ˆØ×Ñ˜T¨eÀÐÓFñ ð 	‡H�H‡O�O�MÔ"Ø×Ñ×$Ñ$Ô&Ü
ð	ó€Cð 	‡G�G‡N�N�3œ˜\Ó*Ñ*Õ+r   c                ó’   • U Vs/ s H  nSUS4PM
     nn[         R                  " SU5      n[         R                  " X@/5      $ s  snf )zmReturns a matcher that returns true for any of the forced includes
before testing against the actual matcher.s   pathr   )ÚmatchmodÚincludematcherÚunionmatcher)rƒ   r,   ÚincludeÚkindpatsr—   s        r   Úforceincludematcherr›   6  sL   € ñ 8@Ó@²x¨G�˜' 3Ó'±x€HÐ@Ü×,Ò,¨S°(Ó;€NÜ× Ò  .Ð!:Ó;Ð;ùò As   …Ac           
     ó˜  • [        U 5      (       d  [        R                  " 5       $ U(       a  US/:X  aT  U R                  R	                  5        Vs/ s H/  nX0R
                  :w  d  M  U R                  R                  U5      PM1     nn[        XS9nSUSR                  [        [        R                  U5      5      4-  nU R                  R                  U5      nU(       a  U$ / nU HV  n [        X5      u  pšnU	(       d  U
(       a6  [        R                   " U R"                  S/ U	U
SS9nUR%                  U5        MV  MX     U(       d  [        R                  " 5       nO+[)        U5      S:X  a  US	   nO[        R*                  " U5      nU(       a  [-        U 5      n[/        Xm5      nX`R                  U'   U$ s  snf ! [&         a     Má  f = f)
zØObtain a matcher for sparse working directories for the given revs.

If multiple revisions are specified, the matcher is the union of all
revs.

``includetemp`` indicates whether to use the temporary sparse profile.
Nrv   rX   ó    r   s   relpath)r™   ÚexcludeÚdefaultr   r   )r   r–   ÚalwaysrK   rL   rM   rN   rB   ra   ro   Úmapr   ÚbytestrÚ_sparsematchercacherZ   rI   r   Úrootr‰   ÚOSErrorr!   r˜   rm   r›   )r   rP   r]   rO   r_   ÚkeyÚresultÚmatchersrB   r,   r-   r.   rƒ   r‘   s                 r   rƒ   rƒ   >  s™  € ô �d×ÑÜ�ŠÓ Ð æ�4˜D˜6“>ð Ÿ™×-Ñ-Ô/ó
â/�Ø—{‘{Ñ"ó %ˆD�N‰N×Ñ˜tÖ$Ù/ð 	ð 
ô   Ñ>€Ià
�i §¡¬3¬x×/?Ñ/?ÀÓ+FÓ!GÐHÑ
H€Cà×%Ñ%×)Ñ)¨#Ó.€FÞØˆà€HÛˆð	Ü+9¸$Ó+DÑ(ˆH æž8Ü"Ÿ.š.Ø—I‘IØØØ$Ø$Ø&ñ�ð —‘ Ö(ñ $ñ	 ö" Ü—’Ó"‰Ü	ˆX‹˜!Ó	Ø˜!‘‰ä×&Ò& xÓ0ˆæÜ,¨TÓ2ˆÜ$ VÓ:ˆà$*×Ñ˜SÑ!à€Mùò[
øô: ó 	Úð	ús   ÁF6Á'F6Ã+AF;Æ;
G	ÇG	c           
     óÒ  • [        U 5      (       d  gUR                  5        Vs/ s H  oUR                  5       PM     nn[        X5      nUR	                  5       (       a  g[        5       n0 n	U(       a)  [        XR                  5       R                  5       /5      n
O[        XR                  5       /5      n
/ nUR                  5        GH   u  pÍUu  pïnUR                  U5        U
" U5      (       a  XÙU'   O‹U[        R                  :X  a  UR                  U5        XÙU'   OaU(       a'  UR                  (       d  UR                  U5        XÙU'   O3U[        R                  :X  a  XÙU'   OXÁ;   a  [        R                  UU4Xœ'   U(       d  MÂ  U[        R                  :X  d  MØ  Uu  nnnnnU
" U5      (       a  Mï  UR                  U5        GM     [        U5      S:”  Ga;  U R                   R#                  [%        S5      [        U5      -  5        ['        X5        [(        R*                  " 5       nSnU S   R-                  5       nU HE  nUU;   d  M  U S   U   nUR/                  U[        R0                  UR3                  5       S4U5        MG     U R4                  R7                  U 5         [(        R8                  " U UU S   U S   SSS9  U R4                  nUR;                  [        R0                  /5       H  u  nnnUR=                  USSS	9  M     SSS5        [?        U 5      S
   nUU-  nU(       a�  U(       dˆ  UR-                  5       nU Hr  nU" U5      nU
" U5      n U(       d1  U (       a*  UR3                  U5      n[        R0                  US4S4Xœ'   MK  U(       d  MT  U (       a  M]  [        R                  / S4Xœ'   Mt     URA                  U	5        gs  snf ! , (       d  f       NÎ= f)zAFilter updates to only lay out files that match the sparse rules.Nr   sC   temporarily included %d file(s) in the sparse checkout for merging
s%   temporarily adding to sparse checkoutFrw   rx   Trz   é   r   )!r   rL   rB   rƒ   r    r"   Úp1Úfilemapr&   r‡   ÚACTION_MERGEr‰   Úno_opÚACTION_FORGETrˆ   r!   r)   r~   r   rt   r„   r…   Úmanifestr†   Ú
ACTION_GETÚflagsrK   Úchanging_parentsrŠ   Ú
getactionsr‹   rT   Ú
setactions)!r   ÚwctxÚmctxÚbranchmerger�   ÚpctxÚoldrevsÚoldsparsematchÚfilesÚprunedactionsrŽ   Útemporaryfilesr’   r+   ÚtypeÚargsrE   Úf1Úf2ÚfaÚmoveÚancÚtmresultr“   ÚwctxmanifestÚfctxrK   r²   r.   ÚchangedprofilesÚmfÚoldÚnews!                                    r   ÚfilterupdatesactionsrÍ   {  ss  € ä�d×ÑØà&*§l¡l¤nÓ5¢n˜d�x‰xŽz¡n€GÐ5Ü˜TÓ+€Nà×Ñ×ÑØä‹E€EØ€Mæô ˜d§W¡W£Y§]¡]£_Ð$5Ó6‰ô ˜d§X¡X£Z LÓ1ˆà€NØŸ™×)‰ˆØ ‰ˆ�CØ�	‰	�$ŒÙ�t×ÑØ"(˜$ÒØ”]×/Ñ/Ó/Ø×!Ñ! $Ô'Ø"(˜$ÒÞØ—:—:Ø×%Ñ% dÔ+Ø&,˜dÑ#øØ”]×0Ñ0Ó0Ø"(˜$ÒØ‹\Ü#0×#>Ñ#>ÀÀcÐ"JˆMÑ÷ ˆ;˜4¤=×#=Ñ#=Õ=Ø$(Ñ!ˆB��B˜˜cÙ˜r—?“?Ø×%Ñ% b×)ñ5 *ô8 ˆ>Ó˜QÔØ�‰�‰Üð*óô �.Ó!ñ	"ô	
ô 	˜TÔ2ô ×'Ò'Ó)ˆØ:ˆØ˜D‘z×*Ñ*Ó,ˆÛ"ˆDØ�|Õ#Ø˜D‘z $Ñ'�Ø× Ñ ØÜ!×,Ñ,Ø—Z‘Z“\ 5Ð)Øö	ñ #ð �]‰]×+Ñ+¨DÕ1Ü×!Ò!ØØØ�T‘
Ø�T‘
ØØ"òð —}‘}ˆHØ$,×$7Ñ$7Ü×)Ñ)Ð*ö%Ñ ��e˜Sð ×$Ñ$ T°dÀtÐ$ÓLñ%÷ 2ô  ˜DÓ! !Ñ$€HØ Ñ&€Oö ž{Ø�]‰]‹_ˆÛˆDÙ  Ó&ˆCÙ˜dÓ#ˆCÞž3ØŸ™ ›�ä!×,Ñ,Ø˜E�NØð'�Ó#÷
 �ŸS˜SÜ'4×'BÑ'BÀBÈÐ&L�Ó#ñ ð ×Ñ�}Õ%ùòW 6÷N 2Õ1ús   ¤OÊ(A(OÏ
O&c           	     ó   • [        5       nUR                  UR                  5        UR                  UR                  5        UR                  UR                  5        [        U 5      nSnU H@  nU" U5      (       a  M  U R                  R                  [        S5      U-  5        U(       + nMB     U(       a  [        R                  " [        S5      5      eU R                  nU S   n	/ n
/ n/ nU	R                  5       n[        U5      n[        R                  " 5       nU GH8  nU" U5      nU" U5      nU(       a  U(       a  U(       a«  U(       a¤  UU;  až  UR                  U5      nU R                   R#                  U5      (       a6  UR%                  U[&        R(                  U4S5        UR+                  U5        M�  UR%                  U[&        R,                  US4S5        U
R+                  U5        MÔ  U(       a  U(       a  U(       a  Më  U(       a  Mô  UU;   d  Mü  UR+                  U5        UU;  d  GM  UR%                  U[&        R.                  SS5        GM;     SnU H1  nU R                  R                  [        S5      U-  5        U(       + nM3     U(       a  [        R                  " [        S5      5      eUR1                  5        HA  u  nnUU;  d  M  U" U5      nU" U5      nU(       d  M'  U(       a  M0  UR+                  U5        MC     [        R2                  " XU S   U S   SSS9  U
 H  nUR5                  US	S	S
9  M     U H  nUR5                  USSS
9  M     U H  nUR5                  US	S	S	S9  M     X¬U4$ )zøRefreshes working directory by taking sparse config into account.

The old status and sparse matcher is compared against the current sparse
matcher.

Will abort if a file with pending changes is being excluded or included
unless ``force`` is True.
Fs   pending changes to '%s'
s2   could not update sparseness due to pending changesrw   r   Nsj   cannot change sparseness due to pending changes (delete the files or use --force to bring them back dirty)rx   Trz   )r{   r|   Úpossibly_dirty)r"   rA   r   r€   r�   rƒ   r)   r(   r   r   r'   rK   r°   r„   r…   r²   Úwvfsr}   r†   r‡   ÚACTION_EXECr‰   r±   rˆ   ÚitemsrŠ   r‹   )r   Ú
origstatusÚorigsparsematchÚforceÚpendingrŽ   ÚabortÚfrK   rC   r€   Úlookupr�   rÊ   r¼   r�   r’   rË   rÌ   ÚflÚstates                        r   ÚrefreshwdirrÜ   î  s  € ô ‹e€GØ‡N�N�:×&Ñ&Ô'Ø‡N�N�:×#Ñ#Ô$Ø‡N�N�:×%Ñ%Ô&Ü˜$“-€KØ€EãˆÙ˜1�~‹~Ø�G‰G�L‰LœÐ7Ó8¸1Ñ<Ô=Ø”IŠEñ ö
 Ü�kŠkÜÐCÓDó
ð 	
ð
 �}‰}€HØ
ˆt‰*€CØ€EØ€FØ€GØ	�‰‹€BÜ�‹G€EÜ×"Ò"Ó$€GäˆÙ˜dÓ#ˆÙ˜$Óˆö ž¦®°T¸XÓ5EØ—‘˜$“ˆBØ�y‰y×Ñ ×%Ñ%Ø—‘ ¤m×&?Ñ&?À"ÀÈÔLØ—‘˜dÖ#à—‘Øœ-×2Ñ2°R¸°KÀôð —‘˜TÖ"ö ž#§s s·3°3¸4À8Õ;KØ�N‰N˜4Ô Ø˜7Ö"Ø—‘ ¤m×&AÑ&AÀ4È×Mñ) ð. €EÛˆØ�‰�‰”QÐ3Ó4°tÑ;Ô<Ø”	Šñ ö Ü�kŠkÜð5óó
ð 	
ð  —~‘~Ö'‰ˆˆeØ�u�}Ù! $Ó'ˆCÙ˜dÓ#ˆCßˆsŸ3˜3Ø—‘˜tÖ$ñ (ô ×ÒØ�t˜D‘z 4¨¡:¨uÀ5òó
 ˆØ×Ñ˜T¨d¸tÐÓDñ ó ˆØ×Ñ˜T¨eÀÐÓFñ ó ˆà×ÑØ˜T¨dÀ4ð 	ó 	
ñ ð ˜6Ð!Ð!r   c                óè   • X   n[        XR                  5       5      S   nU[        UR                  5       5      -  (       a&  U R	                  5       n[        U 5      n[        XUSS9  [        U 5        g)z1Perform actions after a working directory commit.rª   T©rÕ   N)rI   rB   r"   r¼   r~   rƒ   rÜ   r”   )r   rO   rC   r.   rÓ   rÔ   s         r   Úaftercommitrß   S  s]   € ð ‰*€Cä˜d§G¡G£IÓ.¨qÑ1€Hð ”#�c—i‘i“kÓ"×"Ø—[‘[“]ˆ
Ü! $›-ˆÜ�D o¸TÒBä˜4Õ r   c                ó†  • U R                  5          U R                  R                  S5      n[        U R                  US5      u  pxn	U R                  5       n
[        U 5      n[        U R                  5      n[        R                  U;   aF  U(       a?  U R                  R                  [        R                  5        [        R                  " U SS9  OR[        R                  U;  a>  U R                  R                  [        R                  5        [        R                  " U SS9   [        XX#5        [        X
X´S9sSSS5        $ ! [          ab    U R                  U:w  aD  U R                  R#                  5         U =R                  U-  sl        [        R                  " U SS9  [        XX‰5        e f = f! , (       d  f       g= f)z5Update the sparse config and working directory state.r:   F)ÚmaywritestorerÞ   N)Úwlockr;   r<   r2   r)   r~   rƒ   r"   r   r   Údiscardr   Úwritereporequirementsr&   rj   rÜ   Ú	Exceptionre   )r   r,   r-   r.   rÕ   Úremovingr*   ÚoldincludesÚoldexcludesÚoldprofilesÚ	oldstatusÚoldmatchÚoldrequiress                r   Ú_updateconfigandrefreshwdirrí   d  s\  € ð 
�‰�Ø�h‰h×Ñ˜yÓ)ˆÜ0;Ø�G‰G�S˜)ó1
Ñ-ˆ +ð —K‘K“Mˆ	Ü˜4“=ˆÜ˜$×+Ñ+Ó,ˆô ×*Ñ*¨kÓ9¾hØ×Ñ×%Ñ%¤l×&EÑ&EÔFÜ×)Ò)¨$¸eÓDÜ×,Ñ,°KÓ?Ø×Ñ×!Ñ!¤,×"AÑ"AÔBÜ×)Ò)¨$¸eÒDð		Ü˜¨Ô;Ü˜t°ÑF÷7 
‰øô8 ó 	Ø× Ñ  KÓ/Ø×!Ñ!×'Ñ'Ô)Ø×!Ò! [Ñ0Õ!Ü×-Ò-¨dÀ%ÒHÜ˜¨;ÔDØð	ú÷9 
�ús   ‘DF2Ä$EÅA,F/Æ/F2Æ2
G c           
     ó¤  • U R                  5          U R                  R                  U 5         U R                  R	                  S5      n[        U R                  US5      u  p4nU(       d  U(       d   SSS5        SSS5        g[        U [        5       [        5       XQS9  SSS5        SSS5        g! , (       d  f       N= f! , (       d  f       g= f)z Clears include/exclude rules from the sparse config.

The remaining sparse config only has profiles, if defined. The working
directory is refreshed, as needed.
r:   NrÞ   )	râ   rK   r³   r;   r<   r2   r)   rí   r"   )r   rÕ   r*   r,   r-   r.   s         r   Ú
clearrulesrï   �  sƒ   € ð 
�‰��t—}‘}×5Ñ5°dÕ;Ø�h‰h×Ñ˜yÓ)ˆÜ'2°4·7±7¸CÀÓ'KÑ$ˆ˜Hæ¦Ø÷ <�ˆô 	$ D¬#«%´³¸ÒN÷ <�ˆ×;Õ;ú��ús/   ‘C­AB0Á2CÂB0ÂCÂ0
B>	Â:CÃ
Cc                ó  • U R                  5          U R                  R                  U 5         U R                  R	                  S5      n[        U R                  US5      u  pVn[        U 5      u  p‰n
SnU Hç  n[        R                  " [        R                  " U5      SS9 nUR                  5       nSSS5        [        U R                  US5      u  pïn[        U5      [        U5      -   [        U5      -   nUR                  Xè-
  5        UR                  Xù-
  5        UR                  UU
-
  5        [        U5      [        U5      -   [        U5      -   U:”  d  Må  SnMé     S=n=nnSnU(       a@  [        Xz-
  5      n[        XX-
  5      n[        Xi-
  5      n[        [        [        XXgUS	95      n[!        U R                  UUUU/UQ76   SSS5        SSS5        g! , (       d  f       GN/= f! , (       d  f       N)= f! , (       d  f       g= f)
z„Import sparse config rules from files.

The updated sparse config is written out and the working directory
is refreshed, as needed.
r:   Fs   rb)ÚmodeNTr   )r   r   r   rÞ   )râ   rK   r³   r;   r<   r2   r)   rT   r   Ú	posixfileÚ
expandpathÚreadr!   rA   r¡   rí   Úprintchanges)r   ÚoptsÚpathsrÕ   r*   r,   r-   r.   Ú	aincludesÚ	aexcludesÚ	aprofilesÚchangedrg   rf   Ú	iincludesÚ	iexcludesÚ	iprofilesÚoldsizeÚprofilecountÚincludecountÚexcludecountÚfcountss                         r   Úimportfromfilesr  �  s½  € ð 
�‰��t—}‘}×5Ñ5°dÕ;à�h‰h×Ñ˜yÓ)ˆÜ'2°4·7±7¸CÀÓ'KÑ$ˆ˜HÜ*6°tÓ*<Ñ'ˆ	˜ið ˆÛˆAÜ—’¤§¢°Ó 2¸Ò?À2Ø—g‘g“i�÷ @ô /:Ø—‘˜˜ió/Ñ+ˆI )ô ˜(“m¤c¨(£mÑ3´c¸(³mÑCˆGØ�O‰O˜IÑ1Ô2Ø�O‰O˜IÑ1Ô2Ø�O‰O˜I¨	Ñ1Ô2Ü�8‹}œs 8›}Ñ,¬s°8«}Ñ<¸wÕFØ’ñ ð 67Ð6ˆÐ6�| lØˆæÜ˜xÑ3Ó4ˆLÜ˜xÑ3Ó4ˆLÜ˜xÑ3Ó4ˆLäÜÜ+Ø H¸eñóˆGô 	Ø�G‰G�T˜<¨°|ð	
ØFMó	
÷M <�ˆ÷ @Ö?ú÷ <Õ;ú��úsC   ‘G=­A4G,Â!G	Â2B$G,ÅA/G,Ç	G=Ç
G)Ç$G,Ç,
G:	Ç6G=Ç=
Hc
                óú  ^ ^	• T R                  5          T R                  R                  T 5         T R                  R	                  S5      n
[        T R                  U
S5      u  p¼nU(       a  [        5       n[        5       n[        5       nO![        U5      n[        U5      n[        U5      nU U	4S jnU" U5      nU" U5      nU" U5      nU" U5      nU" U5      nUR                  U5        UR                  U5        UR                  U5        UR                  U5        UR                  U5        UR                  U5        [        UU-
  5      [        UU-
  5      -
  n[        Xë-
  5      [        X¾-
  5      -
  n[        Xü-
  5      [        XÏ-
  5      -
  n[        [        [        T UUUUUS95      n[        T R                  UUUU/UQ76   SSS5        SSS5        g! , (       d  f       N= f! , (       d  f       g= f)zmPerform a sparse config update.

The new config is written out and a working directory refresh is performed.
r:   c                óÆ  >• [        S U  5       5      (       a  [        R                  " [        S5      5      eT	(       a  U $ TR                  TR                  5       p!/ nU  H}  n[        R                  " US 5      u  pVU[        R                  ;   d  Uc9  U(       a  US-   OS[        R                  " XU5      -   nUR                  U5        Ml  UR                  U5        M     U$ )Nc              3  ó`   #   • U  H$  n[         R                  R                  U5      v •  M&     g 7frr   )ÚosÚpathÚisabs)Ú.0Úpats     r   Ú	<genexpr>Ú7updateconfig.<locals>.normalize_pats.<locals>.<genexpr>î  s    é € Ð6²¨#”2—7‘7—=‘= ×%Ð%²ùs   ‚,.s   paths cannot be absoluteó   :r   )Úanyr   r'   r   r¤   Úgetcwdr–   Ú	_patsplitÚcwdrelativepatternkindsr   Ú	canonpathr‰   )
Úpatsr¤   ÚcwdÚabspatsÚkindpatÚkindr  Úapr   Úusereporootpathss
           €€r   Únormalize_patsÚ$updateconfig.<locals>.normalize_patsí  s¾   ø€ ÜÑ6±Ó6×6Ñ6Ü—k’k¤!Ð$?Ó"@ÓAÐAæØ�ð Ÿ	™	 4§;¡;£=�#ØˆGÛ�Ü$×.Ò.¨w¸Ó=‘	�Øœ8×;Ñ;Ó;¸t¹|Þ)-˜$ š+°3¼(×:LÒ:LØ 3ó;ñ �Bð —N‘N 2Ö&à—N‘N 7Ö+ñ  ð ˆNr   )rÕ   ræ   N)râ   rK   r³   r;   r<   r2   r)   r"   Údifference_updaterA   r!   r¡   rí   rõ   )r   rö   r™   rž   ÚresetÚdeleteÚenableprofileÚdisableprofilerÕ   r  r*   Ú
oldincludeÚ
oldexcluderé   Ú
newincludeÚ
newexcludeÚnewprofilesr  r   r  r  r  s   `        `            r   Úupdateconfigr(  Î  sÕ  ù€ ð  
�‰��t—}‘}×5Ñ5°dÕ;Ø�h‰h×Ñ˜yÓ)ˆÜ.9Ø�G‰G�S˜)ó/
Ñ+ˆ
 ö Ü›ˆJÜ›ˆJÜ›%‰Kä˜Z›ˆJÜ˜Z›ˆJÜ˜kÓ*ˆKö	ñ* ! Ó)ˆÙ  Ó)ˆÙ Ó'ˆÙ'¨Ó7ˆÙ& }Ó5ˆà×$Ñ$ VÔ,Ø×$Ñ$ VÔ,Ø×%Ñ% nÔ5Ø×Ñ˜'Ô"Ø×Ñ˜=Ô)Ø×Ñ˜'Ô"ä˜;¨Ñ4Ó5¼Ø˜+Ñ%ó9
ñ 
ˆô ˜:Ñ2Ó3´cØÑ#ó7
ñ 
ˆô ˜:Ñ2Ó3´cØÑ#ó7
ñ 
ˆô ÜÜ'ØØØØØØñó

ˆô 	Ø�G‰G�T˜<¨°|ð	
ØFMó	
÷O <�ˆ×;Õ;ú��ús#   “G,¯FGÇ
G,Ç
G)	Ç%G,Ç,
G:c                óz  • U R                  SU5       nUR                  5         UR                  U R                  S[	        S5      U5        UR                  U R                  S[	        S5      U5        UR                  U R                  S[	        S5      U5        UR                  5       (       du  UR                  U R                  S[	        S	5      U5        UR                  U R                  S
[	        S5      U5        UR                  U R                  S[	        S5      U5        SSS5        g! , (       d  f       g= f)z/Print output summarizing sparse config changes.r:   s   profiles_addeds   Profiles changed: %d
s   include_rules_addeds   Include rules changed: %d
s   exclude_rules_addeds   Exclude rules changed: %d
s   files_addeds   Files added: %d
s   files_droppeds   Files dropped: %d
s   files_conflictings   Files conflicting: %d
N)Ú	formatterÚ	startitemÚ	condwriteÚverboser   Úisplain)	r)   rö   r   r  r  r€   r�   ÚconflictingÚfms	            r   rõ   rõ   *  s  € ð 
�‰�i Ô	&¨"Ø
�‰ŒØ
�‰Ø�J‰JØÜÐ'Ó(Øô		
ð 	�‰Ø�J‰JØ"ÜÐ,Ó-Øô		
ð 	�‰Ø�J‰JØ"ÜÐ,Ó-Øô		
ð �z‰z�|‰|Ø�L‰LØ—
‘
˜N¬AÐ.BÓ,CÀUôð �L‰LØ—
‘
Ð,¬aÐ0FÓ.GÈôð �L‰LØ—
‘
Ø$ÜÐ,Ó-Øô	÷? 
'×	&Ö	&ús   “DD,Ä,
D:)T)NT)F)FF)© r1  Fr1  r1  r1  FF)r   r   r   r   r   r   ),Ú
__future__r   r  Úi18nr   rO   r   Ú r   r   r–   r	   r„   r
   r‡   r   r   r   r   r   Úutilsr   Úenabledr   r2   r8   rI   rT   ra   rj   rm   rp   rt   r”   r›   rƒ   rÍ   rÜ   rß   rí   rï   r  r(  rõ   r1  r   r   Ú<module>r7     sÚ   ðõ #ã 	å Ý ÷
÷ 
õ 
õ ð €ò@òB,òL;ò9(òx1ô21ò4'ò*!ò'ò
+ò",òJ<ô:òzp&ôfb"òJ!ð$ ?Dô&ôROô .
ðh ØØ
ØØØØ
ØôY
ð~ ØØØ
ØØõ/r   