403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /usr/lib64/python3.9/site-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /usr/lib64/python3.9/site-packages/mercurial/__pycache__/hook.cpython-39.pyc
a

�+�b.�@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
Cs�t|�r&|}t�|jd|j�}�n�|�d�}|dkrNt�td�||f��|d|�}	t	j
}
t��r�t
j
�|	�\}}|r�|r�t	j
dd�|gt	_
|}	t����ztt�|	��}Wn�ttf�y~t	��}
ztdt�|	��}Wn�ttf�yxt	��}|j�r|�td��|�|
�|j�r:|�td��|�|�|j�sVtd	�}nd}tjtd
�||	f|d��Yn0Yn0Wd�n1�s�0Y|
t	_
z(|�d�dd�D]}t||�}�q�Wn*t�y�t�td
�||f��Yn0t|��st�td�||f��|�td�||f�t��}�z�z |f|||d�t�|���}Wn�t�y}z�t |tj!��r�|�td�||j"df�n|�td�|t#�$|�f�|�r��|j�s�|�td��|��WYd}~Wt��|}|�%dd|||�dSd}~00Wt��|}|�%dd|||�n t��|}|�%dd|||�0|�r�|�rtt�&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�repoZhooktypeserror: %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
Zsysbytes�
__module__�__name__�rfindrZ
HookLoadErrorr�sys�pathr
Z
mainfrozen�os�splitrZdeactivated�
__import__Zsysstr�ImportError�SyntaxError�exc_infoZ
tracebackflag�warn�	tracebackr�AttributeError�noter�timerZ	strkwargs�	Exception�
isinstanceZAbort�argsrZforcebytestr�log�	HookAbort)rr�htype�hname�funcnamer)�throw�obj�d�modnameZoldpaths�modpathZmodfile�e1�e2Z
tracebackhint�p�	starttime�r�exc�duration�r;�4/usr/lib64/python3.9/site-packages/mercurial/hook.py�
pythonhook s�

��
��
��
���2��

�� �������r=cCs�t��}i}|dur>|��}	|j�|	�|	r>|	��r>|j|d<||d<||d<|�dd|�dkrl|��}
n|�	dd|�}
|
r�d|d<nd	|d<t
�|�D]H\}}|d
kr�q�t|�r�|�}t
|ttf�r�t�|�}||d|��<q�|�	dd|d
��r&|}
t�||�}||
k�r&|�td�|�|�td�||f�|�rJ|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�cwdZ
blockedtagsexthooks)exthook-%s: %s finished in %0.2f seconds
s
%s hook %sswarning: %s hook %s
)rr&ZcurrenttransactionZdirstate�writeZwritepending�rootZconfig�plainZ
configboolr
Z	iteritemsrr(�dict�listrZpprint�upperrZ
shelltonativer%rr�getcwd�systemr*Zexplainexitrr+r")rrr,�name�cmdr)r/r7�env�trrE�k�vZoldcmdrBr8r:Zdescr;r;r<�_exthook�s^




�
rQc
Cstt|�}t|dd�}|��D]@\}}|�|dd|tf�}||kr|\}}}}	|||tf||<qdd�t|���D�S)z8return a list of (hook-id, cmd) pairs sorted by priorityT)�
_untrustedr;cSsg|]\}}}}||f�qSr;r;)�.0r6�orOrPr;r;r<�
<listcomp>�r@z_allhooks.<locals>.<listcomp>)�
_hookitems�items�get�_fromuntrusted�sorted�values)
r�hooksZuntrustedhooksrK�valueZtrustedvalueZlp�loZlk�lvr;r;r<�	_allhooks�sr`FcCsji}|jd|d�D]R\}}|�d�s|�d�sd|vr8q|�dd|d�}|ft|�f||f||<q|S)z)return all hooks items ready to be sortedr>)Z	untrusteds	priority.s	tonative.�:spriority.%sr)Zconfigitems�
startswithZ	configint�len)rrRr\rKrL�priorityr;r;r<rV�s���rVcCs|adS)N)�	_redirect)�stater;r;r<�redirect�srgcCs<|js
dSt|�D]$\}}|�d�d|kr|rdSqdS)z/return True if a hook is configured for 'htype'FrrT)�	callhooksr`r)rr,r-rLr;r;r<�hashook�sric
Ks�|js
dSg}t|�D],\}}|�d�d|kr|r|�||f�qt||||fd|i|��}d}	|D]\}}||dp||	}	qf|	S)NFrrr/)rhr`r�append�runhooks)
rrr,r/r)r\r-rL�resr8r;r;r<�hook	srmccs$d}�z@trlzHtj��}tj��}|dkrR|dkrRtj��t�|�}t�||�Wnt	t
fyjYn0dVWztj��WnDty�}z,|jtj
tjtjfvr�t�|��WYd}~n
d}~00t�r |dk�r ztj��WnHt�y.}z.|jtj
tjtjfv�rt�|��WYd}~n
d}~00t�||�t�|�n�ztj��WnHt�y�}z.|jtj
tjtjfv�r�t�|��WYd}~n
d}~00t�r|dk�rztj��WnHt�y}z.|jtj
tjtjfv�r�t�|��WYd}~n
d}~00t�||�t�|�0dS)z(Redirects stdout to stderr, if possible.rrN)rer�stdout�fileno�stderr�flushr�dup�dup2�OSErrorr$�IOError�errnoZEPIPEZEIO�EBADFrZ
StdioError�close)Z	oldstdoutZstdoutnoZstderrno�errr;r;r<�redirect_stdiosN



  �  rzc
Ks�t�|�}i}t���p|D�]X\}}|turj|rLtjtd�|td�d��|�td�|�d}	d}
�nt|�r�t	|||||||�\}	}
n�|�
d��rR|�d�d	k�r(|d
d��dd�\}}t
�|�}|r�tj�|j|�}zt�|d|�}Wn(t�y|�td�|��Yn0t||�}
n|d
d���}
t	|||||
||�\}	}
nt|||||||�}	d}
|	|
f||<qWd�n1�s�0Y|S)
Nsuntrusted hook %s not executedssee 'hg help config.trusted'rs(warning: untrusted hook %s not executed
rFspython:ra��s	hghook.%ssloading %s hook failed:
)r
ZbyteskwargsrzrYrr+rr"rr=rb�count�rsplitrZ
expandpathrr�joinrDr	Zloadpathr'rCr�striprQ)rrr,r\r/r)rlr-rLr8Zraisedr�modZhookfnr;r;r<rkBsF


�
�
.rk)F)F)F)!Z
__future__r�
contextlibrvrrZi18nrr
r�rrrr	rZutilsrr
rr=rQ�objectrYr`rVrergrirm�contextmanagerrzrkr;r;r;r<�<module>s( t@



(

Youez - 2016 - github.com/yon3zu
LinuXploit