
    q&f                     D    d dl Z d dlZ ee d      ZddZd ZddZddZy)	    Nenvironc                     d|z   }|dz   }| j                  d|      }|0| j                  d|      }|dz   }t        |       t        ||       yy)zbsynchronize on the `cfg` config path

    Use this to synchronize commands during race tests.
    s   sync.s   -timeouts   develNs   .waiting)timeout)config
write_file	wait_file)uicfgr   full_configwait_config	sync_path
ready_paths          </usr/lib/python3/dist-packages/mercurial/testing/__init__.pywait_on_cfgr      s^    
 S.K+K		(K0I))Hk2,
:)W-	     c                      t        t        j                  dd            } t        t        j                  d|             }|dk(  ry|t        |       z  S )z*return the current modification to timeoutHGTEST_TIMEOUT_DEFAULTih  HGTEST_TIMEOUTr      )intr   getfloat)defaultcurrents     r   _timeout_factorr      sG    '++6<=G'++.89G!|U7^##r   c                 D   |t               z  }t        j                         }t        j                  j	                  |       s`|r(t        j                         |z
  |kD  rt        d| z        t        j                  d       t        j                  j	                  |       s_y y )Ns   timed out waiting for file: %sg{Gz?)r   timeospathexistsRuntimeErrorsleep)r   r   starts      r   r   r   $   sn      GIIKEggnnT"tyy{U*W4@4GHH

4 ggnnT"r   c                     |rd| z  }n| }t        |d      5 }|j                  |       d d d        | |k7  rt        j                  ||        y y # 1 sw Y   &xY w)Ns   %s.tmpwb)openwriter   rename)r   content
write_pathfs       r   r   r   -   s\    %

	j$	 1	z
		*d#  s   AA)
   )r   )r   r   getattrr   r   r   r   r    r   r   <module>r/      s-    	  "i
 .$$r   