https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/hook.cpython-310.pyc
o

�]Lb.�@s�ddlmZddlZddlZddlZddlZddlmZddlm	Z	ddl
mZmZm
Z
mZmZmZddlmZmZmZdd	�Zd
d�Ze�Zdd
�Zddd�Zdadd�Zdd�Zddd�Zejdd��Zddd�Z dS)�)�absolute_importN�)�_)�getattr)�demandimport�encoding�error�
extensions�pycompat�util)�procutil�resourceutil�
stringutilc
Cspt|�r|}t�|jd|j�}n�|�d�}|dkr&t�td�||f��|d|�}	t	j
}
t��rLt
j
�|	�\}}|rL|rLt	j
dd�|gt	_
|}	t���oz	tt�|	��}Wn]ttfy�t	��}
ztdt�|	��}WnBttfy�t	��}|jr�|�td��|�|
�|jr�|�td��|�|�|js�td	�}nd}tjtd
�||	f|d��wYnwWd�n1s�wY|
t	_
z|�d�dd�D]}t||�}q�Wnty�t�td
�||f��wt|�s�t�td�||f��|�td�||f�t��}z}z|d|||d�t�|���}Wn[t�yz}zNt |tj!��r>|�td�||j"df�n|�td�|t#�$|�f�|�rP�|j�s[|�td��|��WYd}~Wt��|}|�%dd|||�dSd}~wwWt��|}|�%dd|||�nt��|}|�%dd|||�w|�r�|�r�t�&td�|��|�td�|�|dfS)a�call python hook. hook is callable object, looked up as
    name in python module. if callable returns "true", hook
    fails, else passes. if hook raises exception, treated as
    hook failure. exception propagates if throw is "true".

    reason for "true" meaning "hook failed" is so that
    unmodified commands (e.g. mercurial.commands.update) can
    be run as hooks without wrappers to convert return values.�.�.���s(%s hook is invalid: "%s" not in a moduleNzhgext_%ss,exception from first failed import attempt:
s-exception from second failed import attempt:
s$run with --traceback for stack traces)%s hook is invalid: import of "%s" failed��hintrs'%s hook is invalid: "%s" is not defineds(%s hook is invalid: "%s" is not callablescalling hook %s: %s
)�ui�repo�hooktypeserror: %s hook failed: %s
rs'error: %s hook raised an exception: %s
s'(run with --traceback for stack trace)
s
pythonhooks,pythonhook-%s: %s finished in %0.2f seconds
)TTs%s hook failedswarning: %s hook failed
F�)'�callabler
�sysbytes�
__module__�__name__�rfindr�
HookLoadErrorr�sys�pathr
�
mainfrozen�os�splitr�deactivated�
__import__�sysstr�ImportError�SyntaxError�exc_info�
tracebackflag�warn�	tracebackr�AttributeError�noter�timer�	strkwargs�	Exception�
isinstance�Abort�argsr�forcebytestr�log�	HookAbort)rr�htype�hname�funcnamer3�throw�obj�d�modname�oldpaths�modpath�modfile�e1�e2�
tracebackhint�p�	starttime�r�exc�durationrr�0/usr/lib/python3/dist-packages/mercurial/hook.py�
pythonhook s�

��
��
��
��������&������ ���������rJcCs�t��}i}|dur|��}	|j�|	�|	r|	��r|j|d<||d<||d<|�dd|�dkr6|��}
n|�	dd|�}
|
rEd|d<nd	|d<t
�|�D]$\}}|d
krWqNt|�r^|�}t
|ttf�rjt�|�}||d|��<qN|�	dd|d
�r�|}
t�||�}||
kr�|�td�|�|�td�||f�|r�|j}nt��}|j|||d|fd�}t��|}|�dd|||�|r�t�|�}|r�t�td�||f��|�td�||f�|S)Ns
HG_PENDINGsHG_HOOKTYPEsHG_HOOKNAME�hookss%s:run-with-plainsauto�1sHGPLAIN�schangessHG_stonative.%sFsconverting hook "%s" to native
srunning hook %s: %s
s
exthook-%s)�environ�cwd�
blockedtagsexthooks)exthook-%s: %s finished in %0.2f seconds
s
%s hook %sswarning: %s hook %s
)rr.�currenttransaction�dirstate�write�writepending�root�config�plain�
configboolr
�	iteritemsrr1�dict�listr�pprint�upperr�
shelltonativer-rr�getcwd�systemr5�explainexitrr6r*)rrr7�name�cmdr3r:rE�env�trrW�k�v�oldcmdrOrFrH�descrrrI�_exthook�s^



�
rjc
Cstt|�}t|dd�}|��D] \}}|�|dd|tf�}||kr.|\}}}}	|||tf||<qdd�t|���D�S)z8return a list of (hook-id, cmd) pairs sorted by priorityT)�
_untrustedrcSsg|]
\}}}}||f�qSrr)�.0rD�orfrgrrrI�
<listcomp>�sz_allhooks.<locals>.<listcomp>)�
_hookitems�items�get�_fromuntrusted�sorted�values)
r�hooks�untrustedhooksrb�value�trustedvalue�lp�lo�lk�lvrrrI�	_allhooks�s�r}FcCsji}|jd|d�D])\}}|�d�s|�d�sd|vrq	|�dd|d�}|ft|�f||f||<q	|S)z)return all hooks items ready to be sortedrK)�	untrusteds	priority.s	tonative.�:spriority.%sr)�configitems�
startswith�	configint�len)rrkrurbrc�priorityrrrIro�s��rocCs|adS)N)�	_redirect)�staterrrI�redirect�sr�cCs<|jsdSt|�D]\}}|�d�d|kr|rdSq	dS)z/return True if a hook is configured for 'htype'FrrT)�	callhooksr}r")rr7r8rcrrrI�hashook�s�r�c
Ks�|jsdSg}t|�D]\}}|�d�d|kr!|r!|�||f�qt||||fd|i|��}d}	|D]\}}||dp>|	}	q3|	S)NFrrr:)r�r}r"�append�runhooks)
rrr7r:r3rur8rc�resrFrrrI�hook	s�r�ccs �d}z�tr6z$tj��}tj��}|dkr)|dkr)tj��t�|�}t�||�Wnt	t
fy5YnwdVWztj��Wn"tyc}z|jtj
tjtjfvrYt�|��WYd}~nd}~wwtr�|dkr�ztj��Wn"ty�}z|jtj
tjtjfvr�t�|��WYd}~nd}~wwt�||�t�|�dSdSdSztj��Wn"ty�}z|jtj
tjtjfvr�t�|��WYd}~nd}~wwt�r|dk�rztj��Wn#t�y}z|jtj
tjtjfvr�t�|��WYd}~nd}~wwt�||�t�|�www)z(Redirects stdout to stderr, if possible.rrN)r�r�stdout�fileno�stderr�flushr!�dup�dup2�OSErrorr,�IOError�errno�EPIPE�EIO�EBADFr�
StdioError�close)�	oldstdout�stdoutno�stderrno�errrrrI�redirect_stdiosp�



��
���
�����
���
����r�c
Ks�t�|�}i}t���|D]�\}}|tur2|r$tjtd�|td�d��|�td�|�d}	d}
n{t|�rCt	|||||||�\}	}
nj|�
d�r�|�d�d	kr�|d
d��dd�\}}t
�|�}|rjtj�|j|�}z
t�|d|�}Wnty�|�td�|��wt||�}
n|d
d���}
t	|||||
||�\}	}
nt|||||||�}	d}
|	|
f||<q
Wd�|S1s�wY|S)
Nsuntrusted hook %s not executedssee 'hg help config.trusted'rs(warning: untrusted hook %s not executed
rFspython:r��s	hghook.%ssloading %s hook failed:
)r
�byteskwargsr�rrrr6rr*rrJr��count�rsplitr�
expandpathr!r�joinrUr	�loadpathr0rSr�striprj)rrr7rur:r3r�r8rcrF�raisedr�mod�hookfnrrrIr�BsP

�

�
��
�$�$r�)F)!�
__future__r�
contextlibr�r!r�i18nrr
r�rrrr	r�utilsrr
rrJrj�objectrrr}ror�r�r�r��contextmanagerr�r�rrrrI�<module>s* t@



(

https://t.me/RX1948 - 2025