Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��c@s�ddlZddlmZddlZddlZddlZdefd��YZd�Zdej	fd��YZ
e
ZdS(i�N(t_t
remotelockcBs#eZd�Zd�Zd�ZRS(cCs
||_dS(N(trepo(tselfR((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt__init__
scCs|jj�d|_dS(N(RtunlocktNone(R((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pytreleases
cCs|jr|j�ndS(N(RR(R((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt__del__s	(t__name__t
__module__RRR(((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyRs		cCs*tjd|�r|Sd|jdd�S(s=quote a string for the remote shell ... which we assume is shs[a-zA-Z0-9@%_+=:,./-]*$s'%s't's'\''(tretmatchtreplace(ts((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt_serverquotestsshpeercBs�eZed�Zd�Zd�Zd�Zd�Zd�Zd�Z	e	Z
d�Zd�Zd	�Z
d
�Zd�Zed�Zd
�Zd�Zdd�ZRS(c
Cs�||_||_d|_|_|_tj|dtdt�}|j	dksl|j
sl|jdkr�|jt
jtd�|��n|j|_|jdk	r�|jt
jtd���n|j
|_
|j|_|jp�|_|jjddd�}|jjddd	�}tj||j
|j|j�}|r�d
||tjdt|�t|j�f�f}|jtd�|�tj|�}	|	d
kr�|jt
jtd���q�n|j||||�dS(Nt
parsequeryt
parsefragmenttsshscouldn't parse location %sspassword in URL not supportedt.tuit	remotecmdthgs%s %s %ss
%s init %ssrunning %s
iscould not create remote repo(t_urlRRtpipeotpipeitpipeetutilturltFalsetschemethosttpatht_abortterrort	RepoErrorRtusertpasswdtporttconfigtsshargst
shellquoteRtnotetsystemt
validate_repo(
RRR"tcreatetutsshcmdRtargstcmdtres((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyRs0		(#!		#"cCs|jS(N(R(R((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR=sc
Cs�|j�d||tjdt|�t|j�f�f}|jtd�|�tj|�}tj|�\|_	|_
|_|_|j
d�|j
ddddd	dd	f�}d
dg}d}x�|d
rN|rN|j�}	|j�|d
dkr|	dkrPn|	r4|jd|	�n|j|	�|d8}q�W|jtjtd���t�|_xNt|�D]@}	|	jd�r�|jj|	d
 jd�dj��Pq�q�WdS(Ns%s %s %ss%s -R %s serve --stdiosrunning %s
thellotbetweentpairss%s-%st0i(ttdummyi�i�s1
s
sremote: is#no suitable response from remote hgs
capabilities:t:(tcleanupRR+RR"R,Rtquotecommandtpopen4RRRt
subprocesst_callstreamtreadlinetreaderrtdebugtappendR#R$R%tsett_capstreversedt
startswithtupdatetsplit(
RRR1R2RR3trtlinest	max_noisetl((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR.@s4
		#'
'

'cCs|jS(N(RF(R((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt
_capabilitiesfscCs�x~tr�tj|j�j}|dkr.Pn|jj|�}|sJPnx0|j�D]"}|jjt	d�|d�qWWqWdS(Nisremote: s
(
tTrueRtfstatRtst_sizetreadt
splitlinesRtstatusR(RtsizeRRN((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyRBis	cCs|j�|�dS(N(R<(Rt	exception((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR#ts
cCs�|jdkrdS|jj�|jj�y1x*|jD]}|jjtd�|�q:WWntt	fk
rwnX|jj�dS(Nsremote: (
RRtcloseRRRRURtIOErrort
ValueError(RRN((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR<xs

!cKsS|jjd|�|jjd|�tj|\}}|j�}i}x=|D]5}|dkrt||d<PqT||||<||=qTWx�t|j��D]�\}}|jjd|t	|�f�t
|t�r+x]|j�D]<\}	}
|jjd|	t	|
�f�|jj|
�q�q�|jj|�q�W|jj�|j
S(Nssending %s command
s%s
t*s%s %d
(RRCRtwritet	wireprototcommandsRJtsortedt	iteritemstlent
isinstancetdicttflushR(RR3R2t_functnamestkeystwireargstktvtdktdv((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR@�s(

  
cKs|j||�|j�S(N(R@t_recv(RR3R2((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt_call�scKs�|j||�}|r"d|fSx0trT|jd�}|sDPn|j|�q%W|jddt�|j�}|r�d|fS|j�dfS(NR9iRd(RnRPRSt_sendRm(RR3tfpR2RKtd((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt	_callpush�s
	
cCs|S(N((Rtstream((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt_decompress�scCs�|jj�}|dkr�g}x9tr\|jj�}|dkrIPn|j|g�q$Wt|�dkr�|dd |d<n|jtj|��n|j	�yt
|�}Wn0tk
r�|jtjt
d�|��nX|jj|�S(Ns
s-
ii�sunexpected response:(RRARPRtextendRaR#R$tOutOfBandErrorRBtintRZt
ResponseErrorRRS(RRNterrtline((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyRm�s"	

#cCsW|jjdt|��|r3|jj|�n|rI|jj�n|j�dS(Ns%d
(RR\RaRdRB(RtdataRd((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyRo�scCs|jd�t|�S(Ntlock(RnR(R((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR|�s
cCs|jd�dS(NR(Rn(R((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR�scCs�|jd�}|r8|jtjtd�|��nx=trw|jd�}|sZPn|jj|�|j	�q;W|jj
�|j	�|j�}|s�dSyt|�SWn0t
k
r�|jtjtd�|��nXdS(s�Send a changegroup to the remote server.  Return an integer
        similar to unbundle(). DEPRECATED, since it requires locking the
        remote.taddchangegroupspush refused: %siisunexpected response:N(RnR#R$R%RRPRSRR\RBRdRmRwRZRx(RtcgtsourceRR|RqRK((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyR}�s$#	


N(R	R
RRRR.RORBR#R<RR@RnRrRtRmRoR|RRR}(((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyRs" 		&				
							(Rti18nRRR$R]tobjectRRtwirepeerRtinstance(((s5/sys/lib/python2.7/site-packages/mercurial/sshpeer.pyt<module>s$
	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.