
    6hn	                    `    S SK Jr  S SKJrJr  \R
                  r " S S5      r " S S5      rg)    )annotations)hgsshpeerc                  &    \ rS rSrS rS rS rSrg)connectionpool   c                .    Xl         [        5       U l        g N)_repodict_pool)selfrepos     D/usr/lib/python3/dist-packages/hgext/remotefilelog/connectionpool.py__init__connectionpool.__init__   s    
V
    c                   U R                   R                  U5      nUc  [        5       nX R                   U'   S n[        U5      S:  aO   UR	                  5       nUR
                  n[        U[        5      (       a  UR                  R                  5       b  S nUcc  [        R
                  " U R                  R                  0 U5      n[        US5      (       a   " S SUR                  5      nXTl        [!        X$5      nU$ ! [         a     Ntf = f)Nr   _cleanupc                  ,   ^  \ rS rSrSU 4S jjrSrU =r$ )"connectionpool.get.<locals>.mypeer-   c                v   > [        U S5      (       a  U R                  R                  5         [        TU ]  5       $ )Npipee)hasattrr   closesuperr   )r   warn	__class__s     r   r   +connectionpool.get.<locals>.mypeer._cleanup.   s0     #411 JJ,,.$w/11r    r
   )__name__
__module____qualname____firstlineno__r   __static_attributes____classcell__)r   s   @r   mypeerr   -   s    2 2r   r(   )r   getlistlenpoppeer
isinstance
_sshv1peer_subprocesspoll
IndexErrorr   r   uir   r   
connection)r   pathpathpoolconnr-   r(   s         r   r)   connectionpool.get   s    ::>>$'vH'JJtx=1||~yydJ//'',,.:# <774::=="d3DtZ((2T^^ 2 "(h-D)  s   	AC? ?
DDc                    U R                   R                  5        H!  nU H  nUR                  5         M     US S 2	 M#     g r
   )r   valuesr   )r   r6   r7   s      r   r   connectionpool.close<   s3    

))+H 

 ! ,r   )r   r   N)r"   r#   r$   r%   r   r)   r   r&   r!   r   r   r   r      s    #Jr   r   c                  ,    \ rS rSrS rS rS rS rSrg)r4   C   c                    Xl         X l        g r
   r   r-   )r   poolr-   s      r   r   connection.__init__D   s    
	r   c                    U $ r
   r!   r   s    r   	__enter__connection.__enter__H   s    r   c                b    Uc  U R                   R                  U 5        g U R                  5         g r
   )r   appendr   )r   typevalue	tracebacks       r   __exit__connection.__exit__K   s$     <JJd#JJLr   c                p    [        U R                  S5      (       a  U R                  R                  5         g g )Ncleanup)r   r-   rN   rC   s    r   r   connection.closeT   s(    499i((II )r   r?   N)	r"   r#   r$   r%   r   rD   rK   r   r&   r!   r   r   r4   r4   C   s     r   r4   N)	
__future__r   	mercurialr   r   	sshv1peerr/   r   r4   r!   r   r   <module>rS      s1    #
 
. .b   r   