
    	^c$                     @    d Z ddlmZmZ  G d dej                  ZdS )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                 >   |                     d          }|st          j        g           |                    d          }d|vrt          j        |          || _        t          t          |                               |||                                           d S )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__   s    nn]++ 	2-b111YYt__
:%%-j999i''D&**,,?????    c                 8    | j                             ||          S N)r   putlfile)r   hashfds      r   _putzwirestore._put   s    {##D"---r   c                 6    | j                             |          S r   )r   getlfile)r   r   s     r   _getzwirestore._get   s    {##D)))r   c           
          | j                                         5 }g }|D ]/}|                    ||                    dd|i          f           0d |D             cddd           S # 1 swxY w Y   dS )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   shac                 >    i | ]\  }}||                                 S  )result).0r   fs      r   
<dictcomp>z#wirestore._stat.<locals>.<dictcomp>3   s&    777qD!((**777r   N)r   commandexecutorappendcallcommand)r   hashesefsr   s        r   _statzwirestore._stat   s    
 [((** 	8aB  		( & 
 
 
 
 87B777	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8 	8s   A A''A+.A+)__name__
__module____qualname__r   r   r    r.   __classcell__)r   s   @r   r   r      sj        @ @ @ @ @. . .* * *8 8 8 8 8 8 8r   r   N)__doc__ r   r   r   r#   r   r   <module>r5      sl    = <       %8 %8 %8 %8 %8' %8 %8 %8 %8 %8r   