Plan 9 from Bell Labs’s /usr/web/sources/contrib/bichued/root/sys/lib/python/mercurial/sshrepo.pyc

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


�
�c
@s�ddklZlZddklZddkZddkZddkZddkZddk	Z	de
fd��YZdeifd��YZ
e
ZdS(i�(tbinthex(t_Nt
remotelockcBs#eZd�Zd�Zd�ZRS(cCs
||_dS(N(trepo(tselfR((s$/sys/lib/python/mercurial/sshrepo.pyt__init__scCs|ii�d|_dS(N(RtunlocktNone(R((s$/sys/lib/python/mercurial/sshrepo.pytreleases
cCs|io|i�ndS(N(RR	(R((s$/sys/lib/python/mercurial/sshrepo.pyt__del__s
(t__name__t
__module__RR	R
(((s$/sys/lib/python/mercurial/sshrepo.pyR
s		t
sshrepositorycBs�eZdd�Zd�Zd�Zd�Zd�Zd�ZeZd�Z	d�Z
d	�Zed
�Z
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(ic
Cs�||_||_tid|�}|p$|ititd�|��n|id�|_	|id�|_
|id�|_|id�pd|_|ii
dd	d	�}|ii
dd
d�}ti||i
|i	|i�}|ovd}|||||if}|itd
�|�ti|�}	|	djo |ititd���qln|i||||�dS(Ns,^ssh://(([^@]+)@)?([^:/]+)(:(\d+))?(/(.*))?$scouldn't parse location %siiiit.tuitssht	remotecmdthgs%s %s "%s init %s"srunning %s
iscould not create remote repo(t_urlRtretmatchtabortterrort	RepoErrorRtgrouptuserthosttporttpathtconfigtutiltsshargstnotetsystemt
validate_repo(
RRRtcreatetmtsshcmdRtargstcmdtres((s$/sys/lib/python/mercurial/sshrepo.pyRs(		$!
$cCs|iS(N(R(R((s$/sys/lib/python/mercurial/sshrepo.pyturl5sc
Cs�|i�d}|||||if}ti|�}|itd�|�ti|�\|_|_|_	|i
d�|i
dddddddf�}d	d
g}d}x�|do||ou|i�}	|i�|dd
jo|	djoPn|	o|i
td�|	�n|i|	�|d8}q�W|ititd���t�|_xPt|�D]B}	|	id�o,|ii|	d id�di��PqvqvWdS(Ns%s %s "%s -R %s serve --stdio"srunning %s
thellotbetweentpairss%s-%st0i(ttdummyi�i�s1
s
sremote: is#no suitable response from remote hgs
capabilities:t:(tcleanupRRtquotecommandR!Rtpopen3tpipeotpipeitpipeetdo_cmdtreadlinetreaderrtdebugtappendRRRtsettcapabilitiestreversedt
startswithtupdatetsplit(
RRR&R'RR(trtlinest	max_noisetl((s$/sys/lib/python/mercurial/sshrepo.pyR#8s4
!
'


'cCsex^ti|i�i}|djoPn|ii�}|pPn|iitd�|�qdS(Nisremote: (RtfstatR7tst_sizeR9RtstatusR(RtsizeRF((s$/sys/lib/python/mercurial/sshrepo.pyR:ZscCs|i�|�dS(N(R2(Rt	exception((s$/sys/lib/python/mercurial/sshrepo.pyRbs
cCsfyX|ii�|ii�x*|iD]}|iitd�|�q'W|ii�WnnXdS(Nsremote: (R5tcloseR6R7RRIR(RRF((s$/sys/lib/python/mercurial/sshrepo.pyR2fs


cKs�|iitd�|�|iid|�xJ|i�D]<\}}|iid|t|�f�|ii|�q;W|ii�|iS(Nssending %s command
s%s
s%s %d
(	RR;RR5twritet	iteritemstlentflushR6(RR(R'tktv((s$/sys/lib/python/mercurial/sshrepo.pyR8ss
 
cKs|i||�|i�S(N(R8t_recv(RR(R'((s$/sys/lib/python/mercurial/sshrepo.pytcall}scCsb|ii�}|i�yt|�}Wn&|ititd�|��nX|ii|�S(Nsunexpected response:(	R6R9R:tintRRt
ResponseErrorRtread(RRF((s$/sys/lib/python/mercurial/sshrepo.pyRS�s
#cCs[|iidt|��|o|ii|�n|o|ii�n|i�dS(Ns%d
(R5RMRORPR:(RtdataRP((s$/sys/lib/python/mercurial/sshrepo.pyt_send�scCs|id�t|�S(Ntlock(RTR(R((s$/sys/lib/python/mercurial/sshrepo.pyRZ�s
cCs|id�dS(NR(RT(R((s$/sys/lib/python/mercurial/sshrepo.pyR�scCs||idtd��|idd|�}|d idd�\}}t|�ot|�Sn|iti|��dS(Ntlookupslook up remote revisiontkeyi�t i(	t
requirecapRRTRBRURRRR(RR\tdtsuccessRX((s$/sys/lib/python/mercurial/sshrepo.pyR[�s
cCsZ|id�}ytt|d id��SWn&|ititd�|��nXdS(Ntheadsi�R]sunexpected response:(RTtmapRRBRRRVR(RR_((s$/sys/lib/python/mercurial/sshrepo.pyRa�s
c
Cs�|id�}y|h}xk|i�D]]}|id�}ti|d�}g}|dD]}|t|�q\~}|||<q%W|SWntitd�|��nXdS(Nt	branchmapR]iisunexpected response:(	RTt
splitlinesRBturllibtunquoteRRRVR(RR_Rct
branchparttbranchheadst
branchnamet_[1]tx((s$/sys/lib/python/mercurial/sshrepo.pyRc�s
+cCs�ditt|��}|idd|�}yGg}|i�D]%}|ttt|id���qA~}|SWn&|it	i
td�|��nXdS(NR]tbranchestnodessunexpected response:(tjoinRbRRTRdttupleRRBRRRVR(RRmtnR_Rjtbtbr((s$/sys/lib/python/mercurial/sshrepo.pyRl�s?cCs�dig}|D]}|ditt|��q~�}|idd|�}yOg}|i�D]-}||ott|id��pgqe~}|SWn&|iti	t
d�|��nXdS(NR]t-R,R-sunexpected response:(RnRbRRTRdRRBRRRVR(RR-RjtpRpR_t_[2]RF((s$/sys/lib/python/mercurial/sshrepo.pyR,�s<GcCs+ditt|��}|idd|�S(NR]tchangegrouptroots(RnRbRR8(RRmtkindRp((s$/sys/lib/python/mercurial/sshrepo.pyRv�scCs_|idtd��ditt|��}ditt|��}|idd|d|�S(Ntchangegroupsubsetslook up remote changesR]tbasesRa(R^RRnRbRR8(RRzRaRx((s$/sys/lib/python/mercurial/sshrepo.pyRy�scCs|iddditt|���}|o$|ititd�|��nx+|id�}|pPn|i	|�qU|i	ddt
�|i�}|o$|ititd�|��n|i�}yt|�SWn&|iti
td	�|��nXdS(
NtunbundleRaR]spush refused: %siR/RPspush failed: %ssunexpected response:(RTRnRbRRRRRRWRYtTrueRSRURV(RtcgRatsourceR_RC((s$/sys/lib/python/mercurial/sshrepo.pyR{�s"'$$cCs�|id�}|o$|ititd�|��nx8|id�}|pPn|ii|�|i�q=|ii	�|i�|i
�}|pdSnyt|�SWn&|ititd�|��nXdS(Ntaddchangegroupspush refused: %siisunexpected response:(
RTRRRRRWR5RMR:RPRSRURV(RR}R~R*R_RC((s$/sys/lib/python/mercurial/sshrepo.pyR�s$$


cCs
|id�S(Nt
stream_out(R8(R((s$/sys/lib/python/mercurial/sshrepo.pyR�s(RRRR*R#R:RR2R
R8RTRStFalseRYRZRR[RaRcRlR,RvRyR{RR�(((s$/sys/lib/python/mercurial/sshrepo.pyR
s.		"				
									
								(tnodeRRti18nRRRRRRetobjectRt
repositoryR
tinstance(((s$/sys/lib/python/mercurial/sshrepo.pys<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 [email protected].