
    6hf                    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*     tZ/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8ZA	6]F
 ~kk!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    MM"''//$'(-C -#t_d&9&9$&?4++D1

5! 2 '@&?&?___ 	rwws|++,-sA   A D"C9/B1(	C1
B?;C	D
C	<DDc                T    [         R                  R                  [        U 5      U5      $ )zReturn 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    
 77<<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*=
 77<<..KLP
 

 
		##G,77<<j)TBBEFJ
 
 
		##$5677<<++##G,77<<i66KLP
 
 kk/08??B
 	
 ++a89D@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77>>$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)zReturn 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     !,LDQ-.56	TWWd	#	#Q45<=$]477D)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"8A;:"FFrB   c                4   > [         TU ]  [        U5      5      $ rP   )r]   set_untrackedr_   )r`   ra   rb   s     r   re    largefilesdirstate.set_untracked   s    w$Xa[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%     LL/(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ZZ,-F"::d>O>OOO#
		$J cjj*k!BCC	')B)B4)H+D1==--b% .  x=1$LL,'G(1E::#'#''+	 ;   ( *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                  pU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                  " X5      nUc  M  XU4nU R!                  U
U5        M     U$ ! [         a    S n Nf = 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OOE * 1 1E !2 !F~ jj!''e:D	'D }T*htzz%7H.IIOOE"LL""$B::D::D//CE "%0
$$UJ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?dmm55a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    77>>)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     $++--xx4@@88==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$ )zSearch 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|	74t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     99DDD|MM$,,tyy234 
dD	UD5$9V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    99D'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IIK)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    477D!!]477D)9T+@Abggooi&;<=$$$$%$**2G2G!//5EJJu% 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    99DJ  E))6>nn6FG6Fs		**6FGIIj)*Dd4j$< L d4j499Z+@*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$ )zReturn 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0H  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     DMM(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1D
4yA~$q'Y.Aw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)zRe-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yy~"4(
TD5kk!23e;<<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     99;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    KKz':d'AcBrB   c                    [         R                  " S5      nU  H%  nUR                  U5        UR                  U5        M'     [	        UR                  5       5      $ )zRead 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    77>>$	dD	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    778$$D		 	"DLL 	"DLL 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""DLDD!!!"IE|rB   ri   )firstsecondargr>   urlas         r   urljoinr)    s+     u
C3l 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,	 -qxxz?rB   c                0    [         R                  " XS5      $ )Ns   rb)r	   httpsendfile)r#   r   s     r   r.  r.    s    &&rU;;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    )))ZZ,,.E>U__#D / ~dggtU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==%%"eU &  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..}}''MM 	/ 	
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{    88:D		'	'	-T
 $DGGT2
A OE 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MOHQ4xOOAaD!  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   77''L		
()|_'l
 
g&DAOOA"&'//"3H"3QDKK7Gq"3GH$e,g - 		$E7|q \\^ffh'')ffh'')A{		!  A{		!  Au4 00BESWWQ=M4M		!  R==RYBcg 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     Xl        UUU4S jnXl        U$ ! , (       d  f       GN= f)zUpdate 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
 } __&
]]))$/'1J(2(9(9 ): )%F~ 0 +agg5		AD! E%"5>99##H-- yy''..%d8<  F#E??5;;=&9EL %T1H}}!!2ue " H   )JX&&...$x0  IIeE#E--K
 
LLF8$$LK\\1: ;(h.==**84<<}}..q199 :]],,Q/;;1  L! MLw 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     ==!DM(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.
_largefilesenabledc                     g rP   ri   )r   optss     r   r~   !getstatuswriter.<locals>.<lambda>'  s    rB   )hasattr_lfstatuswritersr   )r#   r   forciblys      r   getstatuswriterr    s;     GD*>??$$R((99,,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 %
 
&<8Bnb .-rB   