HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/self/root/lib64/python2.7/site-packages/mercurial/lock.pyo
�
1�3\c@@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	m
Z
ddlmZm
Z
mZmZddlmZd�Zejd��Zd	�Zd
efd��YZd�ZdS(
i(tabsolute_importNi(t_(tencodingterrortpycompattutil(tprocutilcC@s�tjtj��}tjjd�r�y|dtjd�j	7}Wq�t
k
r�}|jtjtj
tjfkr��q�q�Xn|S(s
Return a string which is used to differentiate pid namespaces

    It's useful to detect "dead" processes and remove stale locks with
    confidence. Typically it's just hostname. On modern linux, we include an
    extra Linux-specific pid namespace identifier.
    tlinuxs/%xs/proc/self/ns/pid(Rt
strtolocaltsockettgethostnameRtsysplatformt
startswithtoststattst_inotOSErrorterrnotENOENTtEACCEStENOTDIR(tresulttex((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt_getlockprefixs!
c#@s<g�t�i}d�����fd�}z�xWdddddgD]@}tt|d�}|rI||krItj|�||<qIqIWy%x|D]}tj||�q�WWntk
r�nXt�dVWdt�y1x*|j�D]\}}tj||�q�WWntk
rnXX�r8��d	�ndS(
s@Block signal interrupt while doing something critical

    This makes sure that the code block wrapped by this context manager won't
    be interrupted.

    For Windows developers: It appears not possible to guard time.sleep()
    from CTRL_C_EVENT, so please don't use time.sleep() to test if this is
    working.
    cS@sF|ttdd�ks0|ttdd�kr9t�n	tj�dS(NtSIGINTtCTRL_C_EVENT(tgetattrtsignaltNonetKeyboardInterruptRtSignalInterrupt(tnum((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pytraiseinterrupt>s	c@s$�r�j|�n
�|�dS(N(tappend(Rtframe(tassertedsigstblockedR (s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt	catchtermDsRRtSIGBREAKtSIGHUPtSIGTERMNi(tFalseRRRt	getsignalt
ValueErrortTruetitems(torighandlersR%tnameRthandler((R#R$R s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt_delayedinterrupt/s2	

	
c@s��fd�}t||ddt||��|r?|r?dnd}d}	|sZd}	n|ri|}	nd}
x�tr1y�j�PWqrtjk
r-}|
|kr�||j|j�n|
|	kr�||j|j�n||
krtjt	j
|j�j|j��nt
jd�|
d7}
qrXqrW|
�_�jr�d|	ko^�jknr�|jtd��j�q�|jd�j�n�jr��j�n�S(s�return an acquired lock or raise an a LockHeld exception

    This function is responsible to issue warnings and or debug messages about
    the held lock while trying to acquires it.c@s�d|kr^|jdd�\}}td�tj�j�tj|�tj|�f}n"td��jtj|�f}||�dS(s=issue the usual "waiting on lock" message through any channelt:is5waiting for lock on %s held by process %r on host %r
s"waiting for lock on %s held by %r
N(tsplitRRtbytestrtdesc(tprintertlockerthosttpidtmsg(tl(s4/usr/lib64/python2.7/site-packages/mercurial/lock.pytprintwarningos		itdolocki����isgot lock after %d seconds
(tlockR)R,t_trylockRtLockHeldtdebugR7twarnRt	ETIMEDOUTtfilenameR5ttimetsleeptdelayRt	acquirefn(tuitvfstlocknamettimeouttwarntimeouttargstkwargsR<tdebugidxt
warningidxRGtinst((R;s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyttrylockis>
			

			
R>c	B@s�eZdZdZddddddeed�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
d
�Zd�Zejd��Zd
�ZRS(s�An advisory lock held by one process to control access to a set
    of files.  Non-cooperating processes or incorrectly written scripts
    can ignore Mercurial's locking scheme and stomp all over the
    repository, so don't do that.

    Typically used via localrepository.lock() to lock the repository
    store (.hg/store/) or localrepository.wlock() to lock everything
    else under .hg/.i����cC@s�||_||_d|_||_||_||_||_||_||_t	|_
t	|_|	rut|_
ntj|_
g|_|j�|_|
r�|j�|_|jr�|j�q�ndS(Ni(RJtftheldRLt	releasefnRHR5t_inheritcheckert
parentlockR)t_parentheldt
_inheritedR1t_maybedelayedinterruptRtnullcontextmanagertpostreleaset_getpidR9R>RG(tselfRJtfnameRLRVRHR5tinheritcheckerRXt
signalsafeR=((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt__init__�s(													cC@s|S(N((R_((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt	__enter__�scC@s|j�dS(N(trelease(R_texc_typet	exc_valuetexc_tb((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt__exit__�scC@s<|jr.tjddtdd�d|_n|j�dS(Ns$use lock.release instead of del locktcategoryt
stacklevelii(RUtwarningsRBtDeprecationWarningRe(R_((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt__del__�s	cC@s
tj�S(N(Rtgetpid(R_((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyR^�scC@s�|j}x�tr�y|j�|j|SWqtjk
r�}|dkrxtjd�|dkr|d8}qqntjtj|j	|j
|j��qXqWdS(Nii(RLR,R?RR@RERFRRCRDR5R7(R_RLRR((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyR>�s		


cC@s�|jr|jd7_dStjdkr:t�t_ndtj|jf}d}x7|jr�|r�|d8}y6|j��$|jj||j	�d|_WdQXWqYt
tfk
r�}|jtj
krd|j�}|dkr�qYn||jkrt|_d|_dS|j|�}|dk	r�tjtj|jj|j	�|j|��q�q�tj|j|j|j|j��qYXqYW|js�tjtj|jj|j	�|jd��ndS(Nis%s:%dit(RUR>t_hostRRR9R[RJtmakelockRTRtIOErrorRtEEXISTt	_readlockRXR,RYt	_testlockRR@tEAGAINtjoinR5tLockUnavailabletstrerrorRD(R_RKtretrytwhyR7((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyR?�s@	

			cC@sPy|jj|j�SWn2ttfk
rK}|jtjkrEdS�nXdS(s�read lock and return its value

        Returns None if no lock exists, pid for old-style locks, and host:pid
        for new-style locks.
        N(RJtreadlockRTRRsRRR(R_R|((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyRuscC@s�|dkrdSy|jdd�\}}Wntk
r@|SX|tjkrT|Syt|�}Wntk
rx|SXtj|�r�|Sy@t|j|j	ddd�}|jj
|j	�|j�Wntj
k
r�|SXdS(NR2is.breakRLi(RR3R+R>RqtintRttestpidRJRTtunlinkReRt	LockError(R_R7R8R9R;((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyRv)s(

cC@s|j�}|j|�S(soreturn id of locker if lock is valid, else None.

        If old-style lock, we cannot tell what machine locker is on.
        with new-style lock, if locker is on this machine, we can
        see if locker is alive.  If locker is on this machine but
        not alive, we can safely break lock.

        The lock file is only deleted when None is returned.

        (RuRv(R_R7((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyttestlockAscc@s�|jstjd��n|jr6tjd��n|jdk	rR|j�n|jrh|j�n|jr}|j}ndt	j
|jf}t|_z	|VWd|j
r�|j
�nt|_XdS(scontext for the lock to be inherited by a Mercurial subprocess.

        Yields a string that will be recognized by the lock in the subprocess.
        Communicating this string to the subprocess needs to be done separately
        -- typically by an environment variable.
        s-inherit can only be called while lock is helds8inherit cannot be called while lock is already inheriteds%s:%dN(RURt LockInheritanceContractViolationRZRWRRVRYRXR>RqR9R,RHR)(R_RK((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pytinheritOs&		
	
				
cC@s�|jdkr!|jd8_n�|jdkr�d|_|j�|jkrRdSz|jrk|j�nWd|js�y|jj|j�Wq�tk
r�q�XnX|js�x|j	D]
}|�q�Wd|_	q�ndS(s�release the lock and execute callback function if any

        If the lock has been acquired multiple times, the actual release is
        delayed to the last release call.iiN(RUR^R9RVRYRJR�RTRR]R(R_tcallback((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyRems$			
	N(t__name__t
__module__t__doc__RRqR,RcRdRiRnR^R>R?RuRvR�t
contextlibtcontextmanagerR�Re(((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyR>�s 
								+	
		cG@s.x'|D]}|dk	r|j�qqWdS(N(RRe(tlocksR>((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyRe�s
(t
__future__RR�RR
RR	RERlti18nRRpRRRRtutilsRRR�R1RStobjectR>Re(((s4/usr/lib64/python2.7/site-packages/mercurial/lock.pyt<module>s"	:	6�