File: //usr/lib/python3/dist-packages/mercurial/__pycache__/txnutil.cpython-310.pyc
o
�]Lb � @ s4 d dl mZ d dlZddlmZ dd� Zdd� ZdS ) � )�absolute_importN� )�encodingc C s | t j�d�kS )z[return whether 'root' may have pending changes, which are
visible to this process.
s
HG_PENDING)r �environ�get)�root� r �3/usr/lib/python3/dist-packages/mercurial/txnutil.py�mayhavepending s r
c
K sj t | �r+z
|d| fi |��dfW S ty* } z
|jtjkr � W Y d}~nd}~ww ||fi |��dfS )z�Open file to be read according to HG_PENDING environment variable
This opens '.pending' of specified 'filename' only when HG_PENDING
is equal to 'root'.
This returns '(fp, is_pending_opened)' tuple.
s
%s.pendingTNF)r
�IOError�errno�ENOENT)r �vfs�filename�kwargs�instr r r �
trypending s ���r )�
__future__r r � r r
r r r r r �<module> s