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/commandserver.pyc
�
1�3\c@@s�ddlmZddlZddlZddlZddlZddlZddlZddlZddl	Z	yddl
Z
e
jWn!ek
r�ddl
mZ
nXddlmZddlmZmZmZddlmZdad�Zd	efd
��YZdefd��YZd
efd��YZdefd��YZd�Zd�Z defd��YZ!defd��YZ"dS(i(tabsolute_importNi(t
selectors2(t_(tencodingterrortutil(tprocutilcG@s<ts
dSx!|D]}tjt|��qWtj�dS(N(tlogfiletwritetstrtflush(targsta((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytlog%s

tchanneledoutputcB@s8eZdZd�Zed��Zd�Zd�ZRS(s^
    Write data to out in the following format:

    data length (unsigned int),
    data
    cC@s||_||_dS(N(touttchannel(tselfRR((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt__init__5s	cC@sd|jS(Ns<%c-channel>(R(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytname9scC@sG|s
dS|jjtjd|jt|��|�|jj�dS(Ns>cI(RRtstructtpackRtlenR
(Rtdata((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR=s,cC@s+|dkrt|��nt|j|�S(Ntisattytfilenottelltseek(RRRR(tAttributeErrortgetattrR(Rtattr((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt__getattr__Ds(t__name__t
__module__t__doc__RtpropertyRRR(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR.s
		tchanneledinputcB@sneZdZdZd�Zed��Zdd�Zd�Zdd�Z	d	�Z
d
�ZeZd�Z
RS(
s/
    Read data from in_.

    Requests for input are written to out in the following format:
    channel identifier - 'I' for plain input, 'L' line based (1 byte)
    how many bytes to send at most (unsigned int),

    The client replies with:
    data length (unsigned int), 0 meaning EOF
    data
    iicC@s||_||_||_dS(N(tin_RR(RR%RR((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyRXs		cC@sd|jS(Ns<%c-channel>(R(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR]si����cC@sw|dkr`|j}|j||j�}|}x)|r[|j||j�}||7}q3W|S|j||j�SdS(Ni(tmaxchunksizet_readR(Rtsizetstbuf((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytreadas		cC@s�|s
dS|dkst�|jjtjd||��|jj�|jjd�}tjd|�d}|szdS|jj|�SdS(Ntis>cIis>I(	tAssertionErrorRRRRR
R%R+tunpack(RR(Rtlength((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR'ps
cC@s~|dkrj|j}|j|d�}|}x6|re|ddkre|j|d�}||7}q0W|S|j|d�SdS(NitLi����s
(R&R'(RR(R)R*((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytreadline�s	cC@s|S(N((R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt__iter__�scC@s|j�}|st�n|S(N(R1t
StopIteration(Rtl((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytnext�s	cC@s+|dkrt|��nt|j|�S(NRRRR(RRRR(RRR%(RR((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�si(R R!R"R&RR#RR+R'R1R2R5t__next__R(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR$Is				tservercB@sseZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
ied	6e	d
6Zd�ZRS(sm
    Listens for commands on fin, runs them and writes the output on a channel
    based stream to fout.
    cC@s�tj�|_|jdd�}|rW|dkrEt|d�aqWt|d�an|r�|j|_||_	|j|_
n||_d|_	|_
t|d�|_t|d�|_
t||d�|_t|d	�|_||_dS(
Nt	cmdserverR
t-tdRtetotItr(RtgetcwdtcwdtconfigRRtopentbaseuituitrepotrepouitNonetcerrtcoutR$tcintcresulttclient(RRDREtfintfouttlogpath((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�s"		cC@sdS(s9release and restore resources taken during server sessionN((R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytcleanup�R,cC@s/|s
dS|jj|�}|s+t�n|S(NR,(RLR+tEOFError(RR(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR'�s	cC@s6tjd|jd��d}|s)dS|j|�S(s[read a string from the channel

        format:
        data length (uint32), data
        s>IiiR,(RR.R'(RR/((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt_readstr�scC@s'|j�}|r|jd�SgSdS(s6read a list of NULL separated strings from the channelsN(RRtsplit(RR)((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt	_readlist�s
c	C@stddlm}|j�}|jj�}|g}|jr�||j_|jj|j�}|j|_|j	|�||j_|jj
_|jj�nxF|D]>}|j
�tj|jd�s�|jdddd�q�q�W|j|||j|j|j|j�}z9|j|�d@}|jjtjd	t|���Wd
d|krotj|j�nXd
S(sk reads a list of  terminated arguments, executes
        and writes the return code to the result channel i(tdispatchRRDtnonttyttruet
commandserveri�s>iNs--cwd(R,RURTRDtcopyRERCRFt	__class__tappendtdirstatet_uit
invalidateallt
resetstateRtsafehasattrRJt	setconfigtrequestRIRHRKRRRtinttostchdirR@(	RRURtcopieduituisRFRDtreqtret((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt
runcommand�s,		


&cC@s|jjtj�dS(s3 writes the current encoding to the result channel N(RKRR(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytgetencodingscC@sd|jj�d }|rZ|jj|�}|r>||�qZtjtd�|��n|dkS(Ni����sunknown command %sR,(RLR1tcapabilitiestgetRtAbortR(Rtcmdthandler((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytserveones
RjRkcC@s�ddjt|j��}|d7}|dtj7}|d7}|dtj�7}tjtd�r�|d7}|dtj	d�7}n|j
j|�yx|j�r�q�WWnt
k
r�d	SXdS(
Nscapabilities: t s
s
encoding: spid: %dtgetpgidspgid: %dii(tjointsortedRlRRtgetpidRR`RdRsRIRRqRQ(Rthellomsg((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytserves



(
R R!R"RRPR'RRRTRjRkRqRlRx(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR7�s						'		

tpipeservicecB@s#eZd�Zd�Zd�ZRS(cC@s||_||_dS(N(RDRE(RRDREtopts((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR7s	cC@sdS(N((R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytinit;sc	C@sh|j}tj|j|j��A\}}z&t||j||�}|j�SWd|j�XWdQXdS(N(	RDRtprotectedstdioRMRNR7RERxRP(RRDRMRNtsv((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytrun>s	!(R R!RR{R~(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyRy6s		cC@stjdd�tj�dS(Ni(Rdtsetpgidtrandomtseed(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt_initworkerprocessIsc	C@sc|jd�}|jd�}d}z�y�|||||�}z|y|j�Wngtjk
r}|jtd�|�n;tk
r�}|jtjkr��q�nt	k
r�nXWd|j
�XWnG|r�|j}nt|d�}|j
tjtj����nXWd|j�y|j�Wn+tk
r]}|jtjkr^�q^nXXdS(Ntrbtwbs
abort: %s
R;(tmakefileRGRxRRnRtIOErrorterrnotEPIPEtKeyboardInterruptRPRHRRRt
strtolocalt	tracebackt
format_exctclose(	RDREtconntcreatecmdserverRMRNR}tinstRH((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt
_serverequestZs:	

tunixservicehandlercB@sJeZdZdZd�Zd�Zd�Zd�Zd�Z	d�Z
RS(s�Set of pluggable operations for unix-mode services

    Almost all methods except for createcmdserver() are called in the main
    process. You can't pass mutable resource back from createcmdserver().
    cC@s
||_dS(N(RD(RRD((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�scC@sKtj||�|jtj�|jjtd�|�|jj�dS(Nslistening at %s
(	Rtbindunixsockettlistentsockett	SOMAXCONNRDtstatusRR
(Rtsocktaddress((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt
bindsocket�scC@stj|�dS(N(Rdtunlink(RR�((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pytunlinksocket�scC@stS(s9True if server should shut down; checked per pollinterval(tFalse(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt
shouldexit�scC@sdS(s/Called when main process notices new connectionN((R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt
newconnection�R,cC@st|j|||�S(shCreate new command server instance; called in the process that
        serves for the current connection(R7RD(RRER�RMRN((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR��sN(R R!R"RGtpollintervalRR�R�R�R�R�(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�~s					tunixforkingservicecB@sbeZdZd
d�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�ZRS(sG
    Listens on unix domain socket and forks server per connection
    cC@s�||_||_|d|_tjtd�sItjtd���n|jsjtjtd���n|pyt	|�|_
d|_d|_
t�|_d|_dS(NR�tAF_UNIXsunsupported platforms'no socket path specified with --address(RDRER�RR`R�RRnRR�t_servicehandlerRGt_sockt_oldsigchldhandlertsett_workerpidst_socketunlinked(RRDRERzRp((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�s		
			cC@s�tjtj�|_|jj|j|j�tjtd�rStj	t
j�nt
j
t
j|j�}||_
t|_dS(Nt
unblocksignal(R�R�R�R�R�R�RR`RR�tsignaltSIGCHLDt_sigchldhandlerR�R�R�(RR<((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR{�s	cC@s,|js(|jj|j�t|_ndS(N(R�R�R�R�tTrue(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt
_unlinksocket�s	cC@s>tjtj|j�|jj�|j�|jd�dS(Ni(R�R�R�R�R�R�t_reapworkers(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt_cleanup�s

cC@s z|j�Wd|j�XdS(N(t	_mainloopR�(R((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR~�sc	C@s�t}|j}tj�}|j|jtj�x�tr�|r`|j�r`|j	�t}ny|j
d|j�}Wn1tk
r�}|j
t
jkr��ng}nX|s�|r4Pq4q4ny|jj�\}}Wn5tjk
r}|jdt
jkr
q4n�nXtj�}|riz2|jjd|�|jj|�|j�Wd|j�Xq4y?|j�|jj�|j|�|j�tjd�Wq4z|jjdt�Wdtjd�Xq4Xq4W|j�dS(Nttimeoutisforked worker process (pid=%d)
tforcei�(R�R�t	selectorstDefaultSelectortregisterR�t
EVENT_READR�R�R�tselectR�tOSErrorR�t	ETIMEDOUTtacceptR�RRtEINTRRdtforkRDtdebugR�taddR�R�t
_runworkert_exitR�(	RtexitingthtselectortreadyR�R�t_addrtpid((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR��sT		
	




cC@s|jtj�dS(N(R�RdtWNOHANG(RR�tframe((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�scC@s�x�|jr�ytjd|�\}}WnQtk
r{}|jtjkrRqn|jtjkrj�n|jj�dSX|dkr�dS|jj	d|�|jj
|�qWdS(Ni����isworker process exited (pid=%d)
(R�RdtwaitpidR�R�R�tECHILDtclearRDR�tdiscard(RtoptionsR�t_statusR�((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�	s
cC@sXtjtj|j�t�|j}z t|j|j||j�Wdt	j
�XdS(N(R�R�R�R�R�R�RDRER�tgctcollect(RR�R�((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR�s	 N(
R R!R"RGRR{R�R�R~R�R�R�R�(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyR��s						9		(#t
__future__RR�R�RdR�R�R�RR�R�tBaseSelectortImportErrort
thirdpartyRti18nRR,RRRtutilsRRGRR
tobjectRR$R7RyR�R�R�R�(((s=/usr/lib64/python2.7/site-packages/mercurial/commandserver.pyt<module>s4
		V�		$!