ó
    6°hèf  ã                  ó8  • S r SSKJr  SSKrSSKrSSK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JrJr  SSKJr  SSKJr  S	r\S
-   rSr\R@                  S;S j5       r!S<S jr"S r#S r$\4S jr%S r&S r' " S S\R                  5      r(S;S jr)S r*S=S jr+S>S jr,S>S jr-S r.S r/S r0S r1S r2S r3S?S  jr4S! r5S" r6S# r7S$ r8S% r9S& r:S' r;S( r<S) r=S* r>S+ r?S, r@S- rAS. rBS/ rC " S0 S1\D5      rES2 rFS3 rGS4 rHS5 rIS6 rJS7 rK " S8 S95      rLS?S: jrMg)@zGlargefiles utility code: must not import other modules in this package.é    )ÚannotationsN)Ú_)Úhex)ÚdirstateÚencodingÚerrorÚhttpconnectionÚmatchÚpycompatÚrequirementsÚscmutilÚsparseÚutilÚvfs)Úhashutil)Ú	timestamps   .hglfó   /ó
   largefilesc              #  ó^   #   • [        U SS5      nXl         S v •  X l        g ! X l        f = f7f)NÚlfstatusF)Úgetattrr   )ÚrepoÚvalueÚoldvalues      Ú9/usr/lib/python3/dist-packages/hgext/largefiles/lfutil.pyr   r   ,   s*   é € ä�t˜Z¨Ó/€HØ„Mð!Ûà �ø˜�üs   ‚-—" ›-¢*ª-c                ó  • UnU(       d  U(       a  U R                  [        SUS9nU(       a   [        U5      nUc  [        R
                  " [        S5      5      eU$ ! [         a#    [        R
                  " [        S5      U-  5      ef = f)Ns   minsize)Údefaults)   largefiles: size must be number (not %s)
s-   minimum size for largefiles must be specified)ÚconfigÚlongnameÚfloatÚ
ValueErrorr   ÚAbortr   )ÚuiÚassumelfilesÚoptr   Úlfsizes        r   Ú
getminsizer'   6   s‚   € Ø€FÞ–lØ—‘œ8 Z¸�ÐAˆÞð	Ü˜6“]ˆFð
 �~Ü�kŠkœ!ÐLÓMÓNÐNØ€Møô ó 	Ü—+’+ÜÐ?Ó@À6ÑIóð ð	ús   ®A Á-B
c                ó.  • [         R                  " [        R                  R	                  U5      5         [         R
                  " X5        g! [         a¾    [        U S5       n[         R                  " U5       n[         R                  " U5       H  nUR                  U5        M     SSS5        O! , (       d  f       O= fSSS5        O! , (       d  f       O= f[        R                  " U[        R                  " U 5      R                  5         gf = f)z@Try to create hardlink - if that fails, efficiently make a copy.ÚrbN)r   ÚmakedirsÚosÚpathÚdirnameÚoslinkÚOSErrorÚopenÚatomictempfileÚfilechunkiterÚwriteÚchmodÚstatÚst_mode)ÚsrcÚdestÚsrcfÚdstfÚchunks        r   Úlinkr<   F   s¨   € ä‡M‚M”"—'‘'—/‘/ $Ó'Ô(ð-Ü�Š�CÕøÜó -ä�#�tŒ_ ¤d×&9Ò&9¸$Ô&?À4Ü×+Ò+¨DÖ1�Ø—
‘
˜5Ö!ñ 2÷ '@×&?Ö&?ú�_�_Ž_úô 	�Š�”r—w’w˜s“|×+Ñ+Ö,ð-úsA   µA ÁDÁ"CÁ9/B1Â(	CÂ1
B?Â;CÃ	DÃ
C	Ã<DÄDc                óT   • [         R                  R                  [        U 5      U5      $ )zÖReturn the correct location in the "global" largefiles cache for a file
with the given hash.
This cache is used for sharing of largefiles across repositories - both
to preserve download bandwidth and storage space.)r+   r,   ÚjoinÚ_usercachedir)r#   Úhashs     r   ÚusercachepathrA   S   s   € ô
 �7‰7�<‰<œ bÓ)¨4Ó0Ð0ó    c                ó6  • U R                  US5      nU(       a  U$ Sn[        R                  (       av  [        R                  R                  S[        R                  R                  S5      5      nU(       a  [        R                  R                  XA5      $ [        S5      SSU4-  nGOQ[        R                  (       aY  [        R                  R                  S5      nU(       a"  [        R                  R                  USSU5      $ [        S	5      SU4-  nOã[        R                  (       až  [        R                  R                  S
5      nU(       a  [        R                  R                  X!5      $ [        R                  R                  S5      nU(       a!  [        R                  R                  USU5      $ [        S5      S
SU4-  nO0[        R                  " [        S5      [        R                  -  5      e[        R                  " [        S5      U-  US9e)z5Return the location of the "global" largefiles cache.s	   usercacheNs   LOCALAPPDATAs   APPDATAs7   define %s or %s in the environment, or set %s.usercaches   HOMEs   Librarys   Cachess1   define %s in the environment, or set %s.usercaches   XDG_CACHE_HOMEs   .caches   unknown operating system: %s
s   unknown %s usercache location)Úhint)Ú
configpathr   Ú	iswindowsr   ÚenvironÚgetr+   r,   r>   r   ÚisdarwinÚisposixr   r"   Úosname)r#   Únamer,   rD   ÚappdataÚhomes         r   r?   r?   [   s®  € à�=‰=˜˜|Ó,€DÞØˆà€Dä××Ü×"Ñ"×&Ñ&ØœX×-Ñ-×1Ñ1°*Ó=ó
ˆö Ü—7‘7—<‘< Ó.Ð.äÐKÓLØØØðP
ñ 
Šô
 
×	×	Ü×Ñ×#Ñ# GÓ,ˆÞÜ—7‘7—<‘<  j°)¸TÓBÐBäÐEÓFØØðJ
ñ 
‰ô 
×	×	Ü×Ñ×#Ñ#Ð$5Ó6ˆÞÜ—7‘7—<‘< Ó+Ð+Ü×Ñ×#Ñ# GÓ,ˆÞÜ—7‘7—<‘<  i°Ó6Ð6äÐKÓLØØØðP
ñ 
‰ô �kŠkÜÐ/Ó0´8·?±?ÑBó
ð 	
ô �+Š+”aÐ8Ó9¸DÑ@ÀtÑ
LÐLrB   c                óV   • [        X5      n[        R                  R                  U5      $ ©N)rA   r+   r,   Úexists)r#   r@   r,   s      r   ÚinusercacherR   �   s   € Ü˜Ó"€DÜ�7‰7�>‰>˜$ÓÐrB   c                ó\  • [        X5      u  p#U(       a)  U R                  R                  [        S5      U-  5        U$ [	        U R                  U5      (       aT  U R                  R                  [        S5      U-  5        [        X5      n[        [        U R                  U5      U5        U$ g)z§Return store path of the largefile with the specified hash.
As a side effect, the file might be linked from user cache.
Return None if the file can't be found locally.s   found %s in store
s   found %s in system cache
N)Úfindstorepathr#   Únoter   rR   Ú	storepathr<   rA   )r   r@   r,   rQ   s       r   ÚfindfilerW   ’   s†   € ô ! Ó,�L€DÞØ�‰�‰”QÐ-Ó.°Ñ5Ô6ØˆÜ	�T—W‘W˜d×	#Ñ	#Ø�‰�‰”QÐ4Ó5¸Ñ<Ô=Ü˜Ó$ˆÜŒ]˜4Ÿ7™7 DÓ)¨4Ô0ØˆØrB   c                  óR   ^ • \ rS rSrSrSrS	U 4S jjrU 4S jrS rU 4S jr	Sr
U =r$ )
Úlargefilesdirstateé¢   Ts   -large-filesc                ó2   >• [         TU ]  [        U5      US9$ )N)Ú
reset_copy)ÚsuperÚset_trackedÚunixpath)ÚselfÚfr\   Ú	__class__s      €r   r^   Úlargefilesdirstate.set_tracked©   s   ø€ Ü‰wÑ"¤8¨A£;¸:Ð"ÐFÐFrB   c                ó4   >• [         TU ]  [        U5      5      $ rP   )r]   Úset_untrackedr_   )r`   ra   rb   s     €r   re   Ú largefilesdirstate.set_untracked¬   s   ø€ Ü‰wÑ$¤X¨a£[Ó1Ð1rB   c                ó   • g©NF© )r`   ra   s     r   Ú
_dirignoreÚlargefilesdirstate._dirignore¯   s   € ØrB   c                óR   >• U(       a  UR                  SSS9  [        TU ]	  S 5        g )Ns   largefiles/dirstates   plain)Úlocation)Ú	addbackupr]   r3   )r`   Útrrb   s     €r   r3   Úlargefilesdirstate.write²   s%   ø€ ö Ø�L‰LÐ/¸(ˆLÑCÜ‰‰�dÕrB   ri   ©F)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú_large_file_dirstateÚ_tr_key_suffixr^   re   rj   r3   Ú__static_attributes__Ú__classcell__)rb   s   @r   rY   rY   ¢   s(   ø† ØÐØ$€N÷
Gõ2ò÷ó rB   rY   c           
     ó|  ^• [        TR                  SS5      nUb  U$ TR                  n[        n[        R                  " UR                  U5      5      n[        R                  TR                  ;   n[        UU TR                  TR                  R                  U4S jTR                  U5      nU(       aÈ  UR                  UR                  US5      5      (       d¢   TR                  SS9   UR                  T5         [        T5      n	TR                  R!                  U	/ SSS9n
[#        U
5      S:”  a  UR%                  U5        U
 H   n['        U5      nUR)                  US	S	S	S
9  M"     SSS5        SSS5        U$ U$ ! , (       d  f       N= f! , (       d  f       U$ = f! [*        R,                   a     U$ f = f)zæ
Return a dirstate object that tracks largefiles: i.e. its root is
the repo root, but it is saved in .hg/largefiles/dirstate.

If a dirstate object already exists and is being used for a 'changing_*'
context, it will be returned.
Ú_sub_dirstateNc                 ó0   >• [         R                  " T 5      $ rP   )r   Úmatcher)r   s   €r   Ú<lambda>Ú openlfdirstate.<locals>.<lambda>Ï   s   ø€ ”—’˜tÔ$rB   s   dirstateF)Úwait©ÚsubreposÚunknownÚignoredr   T)Ú
p1_trackedÚ
wc_trackedÚpossibly_dirty)r   r   r   r   Úvfsmodr>   r   ÚDIRSTATE_V2_REQUIREMENTrY   ÚrootÚ	_validateÚnodeconstantsrQ   ÚwlockÚchanging_filesÚgetstandinmatcherÚwalkÚlenr*   ÚsplitstandinÚhacky_extension_update_filer   Ú	LockError)r#   r   ÚcreateÚsub_dirstater   Ú
lfstoredirÚopenerÚuse_dirstate_v2Ú
lfdirstater}   ÚstandinsÚstandinÚlfiles    `           r   Úopenlfdirstaterž   »   s–  ø€ ô ˜4Ÿ=™=¨/¸4Ó@€LØÑØÐØ
�(‰(€CÜ€JÜ�ZŠZ˜Ÿ™ Ó,Ó-€FÜ"×:Ñ:¸d×>OÑ>OÑO€OÜ#ØØ
Ø�	‰	Ø�‰×ÑÜ$Ø×ÑØó€Jö �c—j‘j §¡¨*°kÓ!B×CÑCð	Ø—‘ �Ò'¨×)BÑ)BÀ4Õ)HÜ+¨DÓ1�ØŸ=™=×-Ñ-Ø b°%Àð .ð �ô �x“= 1Ó$Ø—L‘L Ô,ã'�GÜ(¨Ó1�EØ×:Ñ:ØØ#'Ø#'Ø'+ð	 ;ó ñ  (÷ *I×'ð, Ðˆ:Ð÷- *IÕ)Hú×'Ô'ð, Ðûô �‰ó 	ð ØÐð	úsI   ÃF# Ã,FÃ>A.F Å,FÅ4F# Æ 
F	Æ
FÆ
F ÆF# Æ F# Æ#F;Æ:F;c                óL  • US   n[         R                  " 5       nU R                  U/ SSSS9u  pEnUR                  UR                  p‡US    n	U H¿  n
 U[        U
5         nU(       a'  [        U5      [        UR                  U
5      5      :w  a  UR                  U
5        MS  UR                  U
5        Xš   R                  5       nUR                  nUR                  n[        R                  " XÆ5      nUc  M©  XÞU4nU R!                  U
U5        MÁ     U$ ! [         a    S n NÁf = f)Nó   .F©r‚   r„   Úcleanrƒ   )ÚmatchmodÚalwaysÚstatusÚmodifiedr¢   rœ   ÚLookupErrorÚreadasstandinÚhashfileÚwjoinÚappendÚlstatr6   Úst_sizer   Úreliable_mtime_ofÚ	set_clean)rš   r   Úpctxr
   ÚunsureÚsÚmtime_boundaryr¦   r¢   Úwctxr�   ÚfctxÚstÚmodeÚsizeÚmtimeÚ
cache_datas                    r   Úlfdirstatestatusr»   ò   s  € Ø�‰:€DÜ�OŠOÓ€EØ *× 1Ñ 1Ø˜ E°Àð !2ð !Ñ€Fˆ~ð —j‘j !§'¡'ˆeØ�‰:€DÛˆð	Øœ ›Ñ'ˆDö ”} TÓ*¬h°t·z±zÀ%Ó7HÓ.IÓIØ�O‰O˜EÖ"à�L‰L˜ÔØ‘×"Ñ"Ó$ˆBØ—:‘:ˆDØ—:‘:ˆDÜ×/Ò/°ÓCˆEØÓ Ø"¨%Ð0�
Ø×$Ñ$ U¨JÖ7ñ ð  €Høô ó 	ØŠDð	ús   ÁDÄD#Ä"D#c                óà   • Uc  [        U 5      nX   R                  U5       Vs/ s H=  nUc,  U R                  R                  U5      R                  (       d  M2  [        U5      PM?     sn$ s  snf )zJreturn a list of largefiles in the working copy or the
specified changeset)r�   r�   r   Ú	get_entryÚany_trackedr’   )r   Úrevr}   ra   s       r   Ú
listlfilesrÀ     sg   € ð �Ü# DÓ)ˆð
 ‘—‘ Ô(óâ(ˆAØ‰?˜dŸm™m×5Ñ5°aÓ8×DÕDó 	Œ�QŽÙ(ñð ùò s   ¤1A+ÁA+c                óT   • [         R                  R                  [        XU5      5      $ )zBReturn true if a largefile with the given hash exists in the store)r+   r,   rQ   rV   ©r   r@   Ú
forcelocals      r   ÚinstorerÄ     s   € ä�7‰7�>‰>œ) D°
Ó;Ó<Ð<rB   c                óÐ   • U(       d@  U R                  5       (       a+  U R                  R                  U R                  [        U5      $ U R                  R                  [        U5      $ )z^Return the correct location in the repository largefiles store for a
file with the given hash.)Úsharedr   ÚreljoinÚ
sharedpathr   r>   rÂ   s      r   rV   rV   !  sC   € ö ˜$Ÿ+™+Ÿ-™-Ø�x‰x×Ñ §¡´¸4Ó@Ð@Ø�8‰8�=‰=œ 4Ó(Ð(rB   c                ó²   • [        XS5      n[        X5      (       a  US4$ U R                  5       (       a  [        XS5      (       a  [        XS5      S4$ US4$ )zÇSearch through the local store path(s) to find the file for the given
hash.  If the file is not found, its path in the primary store is returned.
The return value is a tuple of (path, exists(path)).
FT)rV   rÄ   rÆ   ©r   r@   r,   s      r   rT   rT   )  sX   € ô �T Ó'€Däˆt×ÑØ�dˆ|ÐØ	�‰�‰œ7 4¨t×4Ñ4Ü˜ TÓ*¨DÐ0Ð0à�%ˆ=ÐrB   c                óê  • U R                   n[        X5      nUc  gUR                  UR                  UR	                  U5      5      5        [        US5       oS" US5       n[        [        R                  " U5      U5      nSSS5        SSS5        WU:w  a;  U R                  R                  [        S5      X$U4-  5        UR                  U5        gg! , (       d  f       NX= f! , (       d  f       Na= f)a  Copy the specified largefile from the repo or system cache to
filename in the repository. Return true on success or false if the
file was not found in either cache (which should not happened:
this is meant to be called only after ensuring that the needed
largefile exists in the cache).NFr)   s   wbs'   %s: data corruption in %s with hash %s
T)ÚwvfsrW   r*   r-   r>   r0   Úcopyandhashr   r2   r#   Úwarnr   Úunlink)r   r@   ÚfilenamerÌ   r,   ÚsrcfdÚdestfdÚgothashs           r   ÚcopyfromcacherÔ   ;  sÆ   € ð �9‰9€DÜ�DÓ€DØ�|ØØ‡M�M�$—,‘,˜tŸy™y¨Ó2Ó3Ô4ô 
ˆd�DÔ	˜U D¨°5Ô$9¸VÜœd×0Ò0°Ó7¸Ó@ˆ÷ %:×	à�$ƒØ�‰�‰ÜÐ9Ó:Ø˜wÐ'ñ(ô	
ð 	�‰�HÔØØ÷ %:Õ$9ú×	Õ	ús$   Á	C$Á !CÂC$Ã
C!	ÃC$Ã$
C2c                ó  • U R                   n[        X   5      n[        X5      (       a  g UR                  U5      (       a  [	        XR                  U5      U5        g U R                  R                  [        S5      X%4-  5        g )Ns0   %s: largefile %s not available from local store
)	rÌ   r¨   rÄ   rQ   Úcopytostoreabsoluter>   r#   rÎ   r   )r   ÚctxÚfileÚfstandinrÌ   r@   s         r   ÚcopytostorerÚ   T  si   € Ø�9‰9€DÜ˜™Ó'€DÜˆt×ÑØØ‡{�{�4×ÑÜ˜D§)¡)¨D£/°4Õ8à�‰�‰ÜÐBÓCØˆlñõ	
rB   c                óœ   • X   nUR                  5        H4  n[        U5      nUc  M  X2R                  5       ;   d  M(  [        XXC5        M6     g)z4Copy all largefiles in a given revision to the storeN)Úfilesr’   ÚmanifestrÚ   )r   Únoder×   rÐ   Úrealfiles        r   Úcopyalltostorerà   b  s@   € ð ‰*€CØ—I‘I–KˆÜ Ó)ˆØÓ H·±³Õ$>Ü˜ 8Ö6ò  rB   c                ó\  • [        U R                  U5      (       a*  [        [        U R                  U5      [	        X5      5        g [
        R                  " [        R                  R                  [	        X5      5      5        [        US5       n[
        R                  " [	        X5      U R                  R                  S9 n[
        R                  " U5       H  nUR                  U5        M     S S S 5        S S S 5        [!        X5        g ! , (       d  f       N"= f! , (       d  f       N+= f)Nr)   )Ú
createmode)rR   r#   r<   rA   rV   r   r*   r+   r,   r-   r0   r1   Ústorerâ   r2   r3   Úlinktousercache)r   rØ   r@   r9   r:   r;   s         r   rÖ   rÖ   l  sÅ   € Ü�4—7‘7˜D×!Ñ!ÜŒ]˜4Ÿ7™7 DÓ)¬9°TÓ+@ÕAä�Š”b—g‘g—o‘o¤i°Ó&;Ó<Ô=Ü�$˜Ô Ü×$Ò$Ü˜$Ó%°$·*±*×2GÑ2GòàÜ!×/Ò/°Ö5�EØ—J‘J˜uÖ%ñ 6÷÷ ô 	˜Õ#÷õ ú÷ Õús$   Â3DÃ/DÃ0DÄ
D	ÄDÄ
D+c                óZ   • [        U R                  U5      n[        [        X5      U5        g)zNLink / copy the largefile with the specified hash from the store
to the cache.N)rA   r#   r<   rV   rÊ   s      r   rä   rä   z  s#   € ô ˜Ÿ™ $Ó'€DÜŒ�4Ó	 Õ%rB   c                ó†  • U R                   n[        nS nU(       av  UR                  5       (       da  UR                  5        Vs/ s H  oRR	                  X55      PM     nnU(       d  UR	                  U5      /n[
        R                  " U S   XdS9nU$ [
        R                  " U S   UR	                  U5      /US9nU$ s  snf )zDReturn a match object that applies rmatcher to the standin directoryc                ó   • g rP   ri   )ra   Úmsgs     r   r~   Ú#getstandinmatcher.<locals>.<lambda>‡  s   € ˜4rB   N)Úbadfn)rÌ   Ú	shortnamer¤   rÜ   r>   r   r
   )r   ÚrmatcherrÌ   Ú
standindirrê   ÚpatÚpatsr
   s           r   r�   r�   �  s¨   € à�9‰9€DÜ€Jñ  €Eæ˜Ÿ™×)Ñ)Ø6>·n±nÔ6FÓGÒ6F¨s—	‘	˜*Ö*Ñ6FˆÐGÞØ—I‘I˜jÓ)Ð*ˆDÜ—’˜d 4™j¨$Ñ<ˆð €Lô —’˜d 4™j¨4¯9©9°ZÓ+@Ð*AÈÑOˆØ€Lùò Hs   ÁB>c                ób   ^^• [        U T5      nUR                  mUU4S jnSUl        X2l        U$ )z¡Return a matcher that accepts standins corresponding to the
files accepted by rmatcher. Pass the list of files in the matcher
as the paths specified by the user.c                óV   >• T" U 5      =(       a    TR                  [        U 5      5      $ rP   )Úmatchfnr’   )ra   Ú	isstandinrì   s    €€r   ÚcomposedmatchfnÚ.composestandinmatcher.<locals>.composedmatchfn›  s!   ø€ Ù˜‹|×A × 0Ñ 0´¸a³Ó AÐArB   T)r�   rò   Ú_was_tampered_with)r   rì   Úsmatcherrô   ró   s    `  @r   Úcomposestandinmatcherrø   ”  s7   ù€ ô !  xÓ0€HØ× Ñ €IöBð #'€HÔØ&Ôà€OrB   c                ó<   • [         [        R                  " U 5      -   $ )zHReturn the repo-relative path to the standin for the specified big
file.)Úshortnameslashr   Úpconvert©rÐ   s    r   rœ   rœ   ¤  s   € ô œDŸMšM¨(Ó3Ñ3Ð3rB   c                ó,   • U R                  [        5      $ )zoReturn true if filename is a big file standin. filename must be
in Mercurial's internal form (slash-separated).)Ú
startswithrú   rü   s    r   ró   ró   ±  s   € ð ×Ñœ~Ó.Ð.rB   c                ó’   • [         R                  " U 5      R                  SS5      n[        U5      S:X  a  US   [        :X  a  US   $ g )Nr   é   é   r   )r   rû   Úsplitr‘   rë   )rÐ   Úbitss     r   r’   r’   ·  sA   € ô �=Š=˜Ó"×(Ñ(¨¨qÓ1€DÜ
ˆ4ƒy�Aƒ~˜$˜q™'¤YÓ.Ø�A‰wˆàrB   c                óî   • U R                  U5      nU R                  R                  U5      (       a#  [        U5      n[	        U5      n[        XXE5        g[        R                  " [        S5      U-  5      e)z‚Re-calculate hash value of lfile and write it into standin

This assumes that "lfutil.standin(lfile) == standin", for efficiency.
s   %s: file not found!N)	rª   rÌ   rQ   r©   ÚgetexecutableÚwritestandinr   r"   r   )r   r�   rœ   rØ   r@   Ú
executables         r   Úupdatestandinr  Â  s^   € ð
 �:‰:�eÓ€DØ‡y�y×Ñ˜×ÑÜ˜‹~ˆÜ" 4Ó(ˆ
Ü�T DÕ5ä�kŠkœ!Ð2Ó3°eÑ;Ó<Ð<rB   c                ó>   • U R                  5       R                  5       $ )ztread hex hash from given filectx of standin file

This encapsulates how "standin" data is stored into storage layer.)ÚdataÚstrip)rµ   s    r   r¨   r¨   Ð  s   € ð �9‰9‹;×ÑÓÐrB   c                óR   • U R                  XS-   U=(       a    S=(       d    S5        g)z#write hash to <repo.root>/<standin>ó   
ó   xrB   N)Úwwrite)r   rœ   r@   r  s       r   r  r  ×  s   € à‡K�K� ™ z×':°d×'A¸cÕBrB   c                ó¶   • [         R                  " S5      nU  H%  nUR                  U5        UR                  U5        M'     [	        UR                  5       5      $ )zƒRead bytes from instream (iterable) and write them to outfile,
computing the SHA-1 hash of the data along the way. Return the hash.rB   )r   Úsha1Úupdater3   r   Údigest)ÚinstreamÚoutfileÚhasherr
  s       r   rÍ   rÍ   Ü  sG   € ô �]Š]˜3Ó€FÛˆØ�‰�dÔØ�‰�dÖñ ô ˆv�}‰}‹ÓÐrB   c                ó°   • [         R                  R                  U 5      (       d  g[        U S5       n[	        U5      sS S S 5        $ ! , (       d  f       g = f)NrB   r)   )r+   r,   rQ   r0   Úhexsha1)rØ   Úfds     r   r©   r©   æ  s7   € Ü�7‰7�>‰>˜$×ÑØÜ	ˆd�DÔ	˜RÜ�r‹{÷ 
×	×	ús   ²AÁ
Ac                óÐ   • [         R                  " U 5      R                  nU[        R                  -  =(       a-    U[        R                  -  =(       a    U[        R
                  -  $ rP   )r+   r5   r6   ÚS_IXUSRÚS_IXGRPÚS_IXOTH)rÐ   r·   s     r   r  r  í  sI   € Ü�7Š7�8Ó×$Ñ$€Dà	”—‘Ñ	÷ 	"Ø”D—L‘LÑ ÷	"à”D—L‘LÑ ðrB   c                ó>   • S nU" X5      nU H  nU" XE5      nM     U$ )Nc                óv   • U R                  S5      (       d  U S-  n UR                  S5      (       a  USS  nX-   $ )Nr   r   )Úendswithrþ   )ÚleftÚrights     r   r>   Úurljoin.<locals>.join÷  s>   € Ø�}‰}˜T×"Ñ"Ø�D‰LˆDØ×Ñ˜D×!Ñ!Ø˜!˜"�IˆEØ‰|ÐrB   ri   )ÚfirstÚsecondÚargr>   ÚurlÚas         r   Úurljoinr)  ö  s+   € òñ ˆuÓ
€CÛˆÙ�3‹lŠñ à€JrB   c                óº   • [         R                  " 5       n[        R                  " U 5       H  nUR	                  U5        M     [        UR                  5       5      $ )zQhexsha1 returns the hex-encoded sha1 sum of the data in the file-like
object data)r   r  r   r2   r  r   r  )ÚfileobjÚhr;   s      r   r  r    s?   € ô 	�Š‹€AÜ×#Ò# GÖ,ˆØ	�‰�Žñ -äˆq�x‰x‹z‹?ÐrB   c                ó0   • [         R                  " XS5      $ )Ns   rb)r	   Úhttpsendfile)r#   rÐ   s     r   r.  r.    s   € Ü×&Ò& r°UÓ;Ð;rB   c                óh   • [         R                  " [        R                  R	                  U 5      5      $ )z@Return a version of path normalized for use with the lfdirstate.)r   rû   r+   r,   Únormpath)r,   s    r   r_   r_     s    € ä�=Š=œŸ™×)Ñ)¨$Ó/Ó0Ð0rB   c                óö   • SU R                   ;   aJ  U R                  R                  5        H,  nUR                  (       d  M  [        UR
                  ;   d  M,    g   [        [        U R                  U S5      5      $ )z,Return true if the repo is a largefile repo.r   TF)	r   rã   Údata_entriesÚ	is_revlogrú   Ú	target_idÚanyrž   r#   )r   Úentrys     r   Úislfilesrepor7    sX   € à˜×)Ñ)Ó)Ø—Z‘Z×,Ñ,Ö.ˆEØ��‰¤>°U·_±_Õ#DÙñ /ô Œ~˜dŸg™g t¨UÓ3Ó4Ð4rB   c                  ó   • \ rS rSrS rSrg)Ústoreprotonotcapablei   c                ó   • Xl         g rP   ©Ú
storetypes)r`   r<  s     r   Ú__init__Ústoreprotonotcapable.__init__!  s   € Ø$�rB   r;  N)rr   rs   rt   ru   r=  rx   ri   rB   r   r9  r9     s   † õ%rB   r9  c                óê   • / n[        U 5      nU S    nU R                  R                  U/ SSS9 H.  n[        U5      n [	        X4   5      nUR                  XV45        M0     U$ ! [
         a    S n N&f = f)NFr�   )r�   r   r�   r’   r¨   r/   r«   )r   r›   r}   r´   rœ   r�   r@   s          r   Úgetstandinsstater@  %  s‹   € Ø€HÜ Ó%€GØ�‰:€DØ—=‘=×%Ñ%Ø˜" e°Uð &ó ˆô ˜WÓ%ˆð	Ü  ¡Ó/ˆDð 	�‰˜˜Ö&ñð €Oøô ó 	ØŠDð	ús   ¾A#Á#A2Á1A2c                óô   • [        U5      nX@R                  ;  a  UR                  USSS9  g U R                  R                  U5      nUR                  UUR                  UR
                  UR                  SS9  g )NF)r…   r†   T)r†   r…   Úp2_infor‡   )rœ   r   r“   r½   Útrackedr…   rB  )r   rš   r�   ÚnormallookupÚ	lfstandinr6  s         r   ÚsynclfdirstaterF  5  sw   € Ü˜“€IØŸ™Ó%Ø×.Ñ.ØØØð 	/ò 	
ð —‘×'Ñ'¨	Ó2ˆØ×.Ñ.ØØ—}‘}Ø×'Ñ'Ø—M‘MØð 	/ò 	
rB   c                óH  • UR                  5       nUR                  R                  U5         U " U5        [        UR                  U5      nUR                  5        H   n[        U5      nUc  M  [        X4US5        M"     S S S 5        [        X25        g ! , (       d  f       N= frh   )	r   r   Úchanging_parentsrž   r#   rÜ   r’   rF  rà   )Úorigr×   rÞ   r   rš   ra   r�   s          r   ÚmarkcommittedrJ  H  s{   € Ø�8‰8‹:€Dà	�‰×	'Ñ	'¨Õ	-ÙˆTŒ
ô $ D§G¡G¨TÓ2ˆ
Ø—‘–ˆAÜ  “OˆEØÓ Ü˜t°¸Ö>ñ ÷ 
.ô0 �4Õ÷1 
.Õ	-ús   ¬>BÁ.BÂ
B!c                ó    • [        U 5      R                  [        U5      5      n/ nU H"  nUS   U;  d  M  UR                  US   5        M$     U$ )Nr   )ÚsetÚsymmetric_differencer«   )ÚoldstandinsÚnewstandinsÚchangedstandinsÚfilelistra   s        r   ÚgetlfilestoupdaterR  f  sN   € Ü˜+Ó&×;Ñ;¼CÀÓ<LÓM€OØ€HÛˆØˆQ‰4�xÕØ�O‰O˜A˜a™DÖ!ñ ð €OrB   c           
     ó*  • U R                   R                  nU" [        S5      [        S5      [        U5      S9 n[	        U5       GH™  u  pVUR                  U5        X   R                  5        Vs/ s H  owU R                  :w  d  M  UPM     nn[        U SS9   X   n	S S S 5        [        W	R                  5       5      n
[        U5      S:X  aÚ  U	R                  5       nU	R                  5       R                  5       nU	R                  5       R                  5       nU H  nXë;  d  M
  U
R                  U5        M     U H  nXë;  d  M
  U
R                  U5        M     U HF  nX¾   UR                  US 5      :w  d  X¾   UR                  US 5      :w  d  M5  U
R                  U5        MH     U
 H0  n[!        U5      (       d  M  Xù;   d  M  U" U[#        XŸ   5      5        M2     GMœ     S S S 5        g s  snf ! , (       d  f       GNZ= f! , (       d  f       g = f)Ns   finding outgoing largefiless	   revisions)ÚunitÚtotalF)r   r  )r#   Úmakeprogressr   r‘   Ú	enumerater  ÚparentsÚnullidr   rL  rÜ   rÝ   Úp1Úp2ÚaddrH   ró   r¨   )r   ÚmissingÚaddfuncrV  ÚprogressÚiÚnÚprX  r×   rÜ   ÚmcÚmp1Úmp2ra   Úfns                   r   Úgetlfilestouploadrg  o  s£  € Ø—7‘7×'Ñ'€LÙ	Ü	Ð
(Ó)Üˆ|‹_Ü�'‹lò
ð 
Ü˜g×&‰DˆAØ�O‰O˜AÔØ"&¡'§/¡/Ô"3ÓHÒ"3˜Q¸D¿K¹KÑ7G—qÑ"3ˆGÐHä˜$ eÓ,Ø‘g�÷ -ô ˜Ÿ	™	›Ó$ˆEÜ�7‹|˜qÓ Ø—\‘\“^�Ø—f‘f“h×'Ñ'Ó)�Ø—f‘f“h×'Ñ'Ó)�Û�AØ•{ØŸ	™	 !žñ ó �AØ•{ØŸ	™	 !žñ ó �AØ‘u §¡¨¨4Ó 0Ó0°B±E¸S¿W¹WÀQÈÓ=MÕ4MØŸ	™	 !žñ ó �Ü˜R—=“= R¥YÙ˜B¤¨c©gÓ 6Ö7ô ñ+ '÷
ð 
ùò Iç,Ö,ú÷
õ 
ús[   º7HÁ1G-ÂG-ÂHÂG2ÂBHÄ'HÅAHÆ(HÇ HÇHÇ-HÇ2
HÇ<HÈ
Hc           	     ó  ^^^• U R                   nUb  UR                  5       (       aû  [        R                  " 5       nU R                  R	                  U 5         [        X 5      nUR                  U/ SSSS9u  pVnSSS5        WWR                  -   UR                  -   UR                  -   n[        U 5      mT He  n	X˜;   d  M
  [        U	5      n
U R                  R                  U
5      (       d  M7  U R                  R                  U	5      (       d  MY  [        X	U
5        Mg     U$ [        U 5      mSUl        U R!                  UR#                  5       T5      Ul        ['        X5      nU R                  R)                  U/ SSS9mT(       d  U$ [        X 5      nT H<  n
[+        U
5      n	UR-                  U	5      R.                  (       d  M0  [        X	U
5        M>     [0        R0                  " U5      nSUl        UR2                  mU=R$                  [5        T5      -  sl        / nUR$                   H®  n[        U5      n
UT;   d  U
T;   aƒ  U R                  R-                  U
5      R                  (       d-  U R                  R-                  U5      R                  (       d  Mp  O,U R                  R-                  U5      R6                  (       d  M�  UR9                  U5        M°     XÁl        UUU4S jnXál        U$ ! , (       d  f       GN�= f)z£Update standins in the working directory according to specified match

This returns (possibly modified) ``match`` object to be used for
subsequent commit process.
NFr¡   Tr�   c                ó2   >• T" U 5      (       a  U T;  $ U T;   $ rP   ri   )ra   ÚlfilesÚorigmatchfnr›   s    €€€r   rò   Ú&updatestandinsbymatch.<locals>.matchfnö  s    ø€ Ù�q�>‰>Ø˜F‘?Ð"à˜‘=Ð rB   )r#   r¤   r£   r   Úrunning_statusrž   r¥   r¦   ÚaddedÚremovedrÀ   rœ   rÌ   rQ   r  rö   Ú
_subdirlfsrÜ   Ú_filesrø   r�   r’   r½   rC  Úcopyrò   Úsortedr¾   r«   )r   r
   r#   Ú
dirtymatchrš   r±   r²   r³   Úmodifiedfilesr�   rÙ   r÷   Úactualfilesra   rò   rj  rk  r›   s                  @@@r   Úupdatestandinsbymatchrw  �  sƒ  ú€ ð 
�‰€Bð
 �}˜Ÿ™Ÿ™ô —_’_Ó&ˆ
Ø�]‰]×)Ñ)¨$Õ/Ü'¨Ó1ˆJØ(2×(9Ñ(9ØØØØØð ):ð )Ñ%ˆF�~÷ 0ð  §¡Ñ+¨a¯g©gÑ5¸¿	¹	ÑAˆÜ˜DÓ!ˆó ˆEØÕ%Ü" 5›>�Ø—9‘9×#Ñ# H×-Ó-ð —y‘y×'Ñ'¨×.Ó.Ü% d°8Ö<ñ ð ˆä˜Ó€FØ#€EÔØ—?‘? 5§;¡;£=°&Ó9€E„Lô % TÓ1€HØ�}‰}×!Ñ!Ø˜2 u°eð "ð €Hö Øˆô   Ó)€JÛˆÜ˜XÓ&ˆØ×Ñ Ó&×.×.Ñ.Ü˜$ xÖ0ñ ô �IŠI�eÓ€EØ#€EÔØ—-‘-€Kð
 
‡L‚L”F˜8Ó$Ñ$…Là€KØ�\Œ\ˆÜ˜1“:ˆð �‹;˜( hÓ.Ø—=‘=×*Ñ*¨8Ó4×<×<Ø—}‘}×.Ñ.¨qÓ1×9×9Ùð :à—]‘]×,Ñ,¨QÓ/×;×;Ùà×Ñ˜1Öñ ð „L÷!ð „Mà€L÷w 0Ö/ús   Á"K4Ë4
Lc                  ó$   • \ rS rSrSrS rS rSrg)Úautomatedcommithooki  a’  Stateful hook to update standins at the 1st commit of resuming

For efficiency, updating standins in the working directory should
be avoided while automated committing (like rebase, transplant and
so on), because they should be updated before committing.

But the 1st commit of resuming automated committing (e.g. ``rebase
--continue``) should update them, because largefiles may be
modified manually.
c                ó   • Xl         g rP   ©Úresuming)r`   r|  s     r   r=  Úautomatedcommithook.__init__  s   € Ø �rB   c                óL   • U R                   (       a  SU l         [        X5      $ U$ rh   )r|  rw  )r`   r   r
   s      r   Ú__call__Úautomatedcommithook.__call__  s    € Ø�=�=Ø!ˆDŒMÜ(¨Ó5Ð5àˆLrB   r{  N)rr   rs   rt   ru   Ú__doc__r=  r  rx   ri   rB   r   ry  ry    s   † ñ	ò!õrB   ry  c                ót   • Uc   [        US5      (       a  UR                  S   $ U(       a  U R                  $ S $ )a  Return the function to write largefiles specific status out

If ``forcibly`` is ``None``, this returns the last element of
``repo._lfstatuswriters`` as "default" writer function.

Otherwise, this returns the function to always write out (or
ignore if ``not forcibly``) status.
Ú_largefilesenabledéÿÿÿÿc                 ó   • g rP   ri   )rè   Úoptss     r   r~   Ú!getstatuswriter.<locals>.<lambda>'  s   € ¨rB   )ÚhasattrÚ_lfstatuswritersr¥   )r#   r   Úforciblys      r   Úgetstatuswriterr‹    s;   € ð ÑœG DÐ*>×?Ñ?Ø×$Ñ$ RÑ(Ð(æØ—9‘9Ðá,Ð,rB   )T)é
   )NNrq   rP   )Nr�  Ú
__future__r   Ú
contextlibrr  r+   r5   Úmercurial.i18nr   Úmercurial.noder   Ú	mercurialr   r   r   r	   r
   r£   r   r   r   r   r   r   rˆ   Úmercurial.utilsr   Úmercurial.dirstateutilsr   rë   rú   r   Úcontextmanagerr   r'   r<   rA   r?   rR   rW   rY   rž   r»   rÀ   rÄ   rV   rT   rÔ   rÚ   rà   rÖ   rä   r�   rø   rœ   ró   r’   r  r¨   r  rÍ   r©   r  r)  r  r.  r_   r7  Ú	Exceptionr9  r@  rF  rJ  rR  rg  rw  ry  r‹  ri   rB   r   Ú<module>r–     sf  ðñ Nå "ã Û Û 	Û å Ý ÷÷ ÷ ñ õ %Ý -à€	Ø˜TÑ!€Ø€ð
 ×Ñó!ó ð!ôò 
-ò1ð $ô /Mòd ò
ô ˜×*Ñ*ô ô24ònô6ô=ô
)òò$ò2
ò7ò$ò&ôò&ò 
4ò/òò=òòCò
 òòòòò<ò1ò
5ô%˜9ô %ò
ò 
ò&ò<ò8òBn÷bñ õ.-rB   