
    6h	                    f    S r SSKJr  SSKJr  SSKJr  SSKJrJ	r	   " S S\R                  5      r
g	)
z store class for local filesystem    )annotations)_)util   )	basestorelfutilc                  D   ^  \ rS rSrSrU 4S jrS rS rS rS r	Sr
U =r$ )	
localstore   zlocalstore first attempts to grab files out of the store in the remote
Mercurial repository.  Failing that, it attempts to grab the files from
the user cache.c                   > UR                  5       U l        [        TU ]  XU R                  R	                  5       5        g N)localremotesuper__init__url)selfuirepor   	__class__s       =/usr/lib/python3/dist-packages/hgext/largefiles/localstore.pyr   localstore.__init__   s*    lln4;;??#45    c                    [         R                  " U R                  U5      (       a  g [         R                  " U[         R                  " U R                  U5      5        g r   )r   instorer   link	storepath)r   sourcehashs      r   putlocalstore.put   s9    >>$++t,,FF,,T[[$?@r   c                b    0 nU H&  n[         R                  " U R                  U5      X#'   M(     U$ r   )r   r   r   )r   hashesretvalr   s       r   existslocalstore.exists$   s,    D!>>$++t<FL r   c                L   [         R                  " U R                  U5      nU(       d+  [        R                  " X#U R
                  [        S5      5      e[        US5       n[         R                  " [        R                  " U5      U5      sS S S 5        $ ! , (       d  f       g = f)Ns   can't get file locallyrb)r   findfiler   r   
StoreErrorr   r   opencopyandhashr   filechunkiter)r   tmpfilefilenamer   pathfds         r   _getfilelocalstore._getfile*   sr    t{{D1&&!,E*F  $%%d&8&8&<gF s    +B
B#c                   SnU H  u  pEn[         R                  " U R                  U5      u  pxU(       d#  [         R                  " U R                  U5      u  pxU(       d-  U R                  R                  [        S5      XEU4-  5        SnM  U(       d  M  [         R                  " U5      n	X:w  d  M  U R                  R                  [        S5      XEU4-  5        SnM     U$ )NFs'   changeset %s: %s references missing %s
Ts)   changeset %s: %s references corrupted %s
)r   findstorepathr   r   r   warnr   hashfile)
r   contentsfilestocheckfailedcsetr/   expectedhashr   r%   
actualhashs
             r   _verifyfileslocalstore._verifyfiles3   s    ,8(DL & 4 4TYY MI$*$8$8KK%!	 ABy12 #__Y7
-GGLLGH956 "F' -9( r   )r   )__name__
__module____qualname____firstlineno____doc__r   r    r%   r2   r>   __static_attributes____classcell__)r   s   @r   r
   r
      s(    6A
G r   r
   N)rD   
__future__r   mercurial.i18nr   	mercurialr    r   r   r
    r   r   <module>rL      s*    ' "  3$$ 3r   