ó
œçƒQc           @   s;   d  Z  d d l Z d d l Z d e j f d „  ƒ  YZ d S(   s6   largefile store working over Mercurial's wire protocoliÿÿÿÿNt	   wirestorec           B   s,   e  Z d  „  Z d „  Z d „  Z d „  Z RS(   c         C   sƒ   | j  d ƒ } | s' t j g  ƒ ‚ n  | j d ƒ } d | k rT t j | ƒ ‚ n  | |  _ t t |  ƒ j | | | j ƒ  ƒ d  S(   Nt
   largefilest   ,t   serve(	   t   capablet   lfutilt   storeprotonotcapablet   splitt   remotet   superR    t   __init__t   url(   t   selft   uit   repoR   t   capt
   storetypes(    (    s>   /sys/lib/python2.7/site-packages/hgext/largefiles/wirestore.pyR
      s    	c         C   s   |  j  j | | ƒ S(   N(   R   t   putlfile(   R   t   hasht   fd(    (    s>   /sys/lib/python2.7/site-packages/hgext/largefiles/wirestore.pyt   _put   s    c         C   s   |  j  j | ƒ S(   N(   R   t   getlfile(   R   R   (    (    s>   /sys/lib/python2.7/site-packages/hgext/largefiles/wirestore.pyt   _get   s    c         C   so   |  j  j ƒ  } i  } x! | D] } | j | ƒ | | <q W| j ƒ  i  } x | D] } | | j | | <qP W| S(   s­   For 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.(   R   t   batcht	   statlfilet   submitt   value(   R   t   hashesR   t   futuresR   t   retval(    (    s>   /sys/lib/python2.7/site-packages/hgext/largefiles/wirestore.pyt   _stat   s    
(   t   __name__t
   __module__R
   R   R   R   (    (    (    s>   /sys/lib/python2.7/site-packages/hgext/largefiles/wirestore.pyR       s   	
		(   t   __doc__R   t   remotestoreR    (    (    (    s>   /sys/lib/python2.7/site-packages/hgext/largefiles/wirestore.pyt   <module>   s   