File: //lib/python3/dist-packages/mercurial/testing/__pycache__/__init__.cpython-310.pyc
o
�]Lb< � @ sJ d dl mZmZ d dlZd dlZeed�Zdd� Zddd�Zd
d
d�Z dS )� )�absolute_import�divisionN�environc C s8 t t�dd��} t t�d| ��}|dkrdS |t| � S )z*return the current modification to timeout�HGTEST_TIMEOUT_DEFAULTih �HGTEST_TIMEOUTr � )�intr �get�float)�default�current� r
�</usr/lib/python3/dist-packages/mercurial/testing/__init__.py�_timeout_factor s
r �
c C s\ |t � 9 }t�� }tj�| �s,|rt�� | |krtd| ��t�d� tj�| �rd S d S )Ns timed out waiting for file: %sg{�G�z�?)r �time�os�path�exists�RuntimeError�sleep)r �timeout�startr
r
r � wait_file s
�r � c C sb |rd| }n| }t |d��
}|�|� W d � n1 sw Y | |kr/t�|| � d S d S )Ns %s.tmp�wb)�open�writer �rename)r �content�
write_path�fr
r
r �
write_file# s
��r"