
    q&f$                     B    d Z ddlmZmZ  G d dej                        Zy)z6largefile store working over Mercurial's wire protocol   )lfutilremotestorec                   0     e Zd Z fdZd Zd Zd Z xZS )	wirestorec                     |j                  d      }|st        j                  g       |j                  d      }d|vrt        j                  |      || _        t
        t        |   |||j                                y )Ns
   largefiles   ,s   serve)	capabler   storeprotonotcapablesplitremotesuperr   __init__url)selfuirepor   cap
storetypes	__class__s         </usr/lib/python3/dist-packages/hgext/largefiles/wirestore.pyr   zwirestore.__init__   sk    nn]+--b11YYt_
:%--j99i'D&**,?    c                 :    | j                   j                  ||      S N)r   putlfile)r   hashfds      r   _putzwirestore._put   s    {{##D"--r   c                 8    | j                   j                  |      S r   )r   getlfile)r   r   s     r   _getzwirestore._get   s    {{##D))r   c           
         | j                   j                         5 }g }|D ]'  }|j                  ||j                  dd|i      f       ) |D ci c]  \  }}||j	                          c}}cddd       S c c}}w # 1 sw Y   yxY w)zFor each hash, return 0 if it is available, other values if not.
        It is usually 2 if the largefile is missing, but might be 1 the server
        has a corrupted copy.s	   statlfiles   shaN)r   commandexecutorappendcallcommandresult)r   hashesefsr   fs         r   _statzwirestore._stat   s    
 [[((* 	8aB 		( &
 577qD!((*$7	8 	8 8	8 	8s   4A=A7*A=7A==B)__name__
__module____qualname__r   r   r    r*   __classcell__)r   s   @r   r   r      s    @.*8r   r   N)__doc__ r   r   r    r   r   <module>r2      s!    =%8'' %8r   