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

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


�
�c@smdZddklZddklZddkZddkZddkZddkZddk	Z	ddk
Z
ddkZddkZddk
Z
ddkZddkZddkZddkZddkZddkZdeifd��YZdeeifd��YZd	eeifd
��YZdeeifd��YZd
eifd��YZd�ZdS(s�Repository class for viewing uncompressed bundles.

This provides a read-only repository interface to bundles as if they
were part of the actual repository.
i�(tnullid(t_NtbundlerevlogcBsteZdd�Zd�Zd�Zddd�Zd�Zd�Zdddd�Z	d�Z
d	�Zd
�ZRS(c
s�tii|||��|_h|_�fd�}t|�}d}x�|�D]�\}}	t|�}
|
djotitd���n|	d7}	|
d8}
t	i
d|d �\}}}
}||ijo
|}qSnxF||
fD]8}||ijo"ti
||itd���q��djo
|}n
||�}|p
|}nti|	d�|
dd||i|�|i|
�|f}||i|<|iid|�||i|<|}|d7}qSWdS(	Nc3s?x8ti��D]'}�i�}||t|�fVqWdS(N(tchangegroupt	chunkiterttelltlen(tchunktpos(t
bundlefile(s'/sys/lib/python/mercurial/bundlerepo.pytchunkpositer#siPsinvalid changegroupt20s20s20s20ssunknown parentii�i(trevlogt__init__R	tbasemapRtNonetutiltAbortRtstructtunpacktnodemapterrortLookupErrort	indexfiletoffset_typetrevtindextinsert(tselftopenerRR	t
linkmapperR
tntprevRtstarttsizetnodetp1tp2tcstptlinkte((R	s'/sys/lib/python/mercurial/bundlerepo.pyR
sD		



"



!

cCs"|djotSn||ijS(sis rev from the bundlei(tFalseR(RR((s'/sys/lib/python/mercurial/bundlerepo.pytbundleGs
cCs|i|S(N(R(RR((s'/sys/lib/python/mercurial/bundlerepo.pyt
bundlebaseLsicCs\|i|�ptii|||�Sn|ii|i|��|ii|i|��S(N(R+RRR	tseekR!treadtlength(RRtdftcachelen((s'/sys/lib/python/mercurial/bundlerepo.pyRMscCs�|i|�oJ|i|�o:|i|i|��}||jo|i|�Sq�n=|i|�o+|i|�otii|||�Snti|i|i	|��|i|i	|���S(s1return or calculate a delta between two revisions(
R+RR,RRtrevdifftmdiffttextdifftrevisionR#(Rtrev1trev2trevb((s'/sys/lib/python/mercurial/bundlerepo.pyR2Vs 
"c	Cs�|tjodSnd}g}|}|i|�}xp|i|�o_|io&|id|jo|id}Pn|i|�|i|�}|i|�}q9W|djotii||�}nx6|o.|i	|i
��}ti||g�}q�W|i
|�\}}|ti|||�jo/titd�|i|i|�f��n||i|�|f|_|S(s*return an uncompressed revision of a giventiisintegrity check failed on %s:%dN(RRRR+t_cachetappendR,RR5RtpopR3tpatchestparentsthashRtRevlogErrorRtdatafile(	RR#ttexttchaint	iter_nodeRtdeltaR$R%((s'/sys/lib/python/mercurial/bundlerepo.pyR5cs.



 cCs
t�dS(N(tNotImplementedError(RRBttransactionR(R$R%td((s'/sys/lib/python/mercurial/bundlerepo.pytaddrevision�scCs
t�dS(N(RF(RtrevsRRG((s'/sys/lib/python/mercurial/bundlerepo.pytaddgroup�scCs
t�dS(N(RF(RRtminlink((s'/sys/lib/python/mercurial/bundlerepo.pytstrip�scCs
t�dS(N(RF(R((s'/sys/lib/python/mercurial/bundlerepo.pyt	checksize�sN(
t__name__t
__module__RR
R+R,RR2R5RIRKRMRN(((s'/sys/lib/python/mercurial/bundlerepo.pyRs1				
			tbundlechangelogcBseZd�ZRS(cCs0tii||�ti|||i|�dS(N(t	changelogR
RR(RRR	((s'/sys/lib/python/mercurial/bundlerepo.pyR
�s(RORPR
(((s'/sys/lib/python/mercurial/bundlerepo.pyRQ�stbundlemanifestcBseZd�ZRS(cCs3tii||�ti|||i||�dS(N(tmanifestR
RR(RRR	R((s'/sys/lib/python/mercurial/bundlerepo.pyR
�s(RORPR
(((s'/sys/lib/python/mercurial/bundlerepo.pyRS�st
bundlefilelogcBseZd�ZRS(cCs6tii|||�ti|||i||�dS(N(tfilelogR
RR(RRtpathR	R((s'/sys/lib/python/mercurial/bundlerepo.pyR
�s(RORPR
(((s'/sys/lib/python/mercurial/bundlerepo.pyRU�stbundlerepositorycBs�eZd�Zeid��Zeid��Zeid��Zeid��Zd�Z	d�Z
d�Zd�Zd	�Z
d
�ZRS(c
s^d|_ytii|||�WnTtij
oEti�|_ti	||id�tii|||i�nX|od|d||_
nd||_
d|_t|d�|_|ii
d���id�ptitd�|��nQ�id�ptitd	�|��n$�d
jp
�djo�tidd
ddd|i�\}}||_ti|d�}�fd�}|ti|id��}z/|id�x|D]}	|i|	�q�WWd|i�|ii�Xt|id�|_|iid�n+�djontitd�|��h|_dS(Nisbundle:t+trbitHGs%s: not a Mercurial bundle filetHG10s%s: unknown bundle versiontHG10BZtHG10GZtprefixs
hg-bundle-tsuffixs.hg10untdirtwbc3sj�djoti�}|id�n�djoti�}nx|D]}|i|�VqNWdS(NR]tBZR^(tbz2tBZ2Decompressort
decompresstzlibt
decompressobj(tftzdR(theader(s'/sys/lib/python/mercurial/bundlerepo.pyt	generator�s

itHG10UNs#%s: unknown bundle compression type(Rt_tempparentt	localrepotlocalrepositoryR
Rt	RepoErrorttempfiletmkdtemptinstancet_urltopenR	R.t
startswithRRRtmkstempRWtostfdopent
filechunkitertwritetcloseR-tbundlefilespos(
RtuiRWt
bundlenametfdtempttemptfptempRltgenR((Rks'/sys/lib/python/mercurial/bundlerepo.pyR
�sL	
		



cCs+t|i|i�}|ii�|_|S(N(RQtsopenerR	Rtmanstart(Rtc((s'/sys/lib/python/mercurial/bundlerepo.pyRR�scCsG|ii|i�t|i|i|ii�}|ii�|_|S(N(	R	R-R�RSR�RRRRt	filestart(Rtm((s'/sys/lib/python/mercurial/bundlerepo.pyRT�scCs|i|iS(N(RRR�(R((s'/sys/lib/python/mercurial/bundlerepo.pyR��scCs|i|iS(N(RTR�(R((s'/sys/lib/python/mercurial/bundlerepo.pyR��scCs|iS(N(Ru(R((s'/sys/lib/python/mercurial/bundlerepo.pyturl�scCs�|ipn|ii|i�xXti|i�}|pPn|ii�|i|<xti|i�D]}qgWq n|ddjo|d}n||ijo:|ii|i|�t|i	||i|i
i�Snti|i	|�SdS(Nit/i(
R~R	R-R�RtgetchunkRRRUR�RRRRV(RRiRR�((s'/sys/lib/python/mercurial/bundlerepo.pytfile�s"
cCs|ii�dS(s'Close assigned bundle file immediately.N(R	R}(R((s'/sys/lib/python/mercurial/bundlerepo.pyR}scCs�t|dd�}|o|io|i�nt|dd�}|dj	oti|�n|ioti|it	�ndS(NR	Rr(
tgetattrRtclosedR}RytunlinkRntshutiltrmtreetTrue(RR	Rr((s'/sys/lib/python/mercurial/bundlerepo.pyt__del__s

cCstS(N(R*(R((s'/sys/lib/python/mercurial/bundlerepo.pytcancopyscCs
ti�S(N(Rytgetcwd(R((s'/sys/lib/python/mercurial/bundlerepo.pyR�s(RORPR
Rt
propertycacheRRRTR�R�R�R�R}R�R�R�(((s'/sys/lib/python/mercurial/bundlerepo.pyRX�s	8				
	cCs7|otitd���n|iddd�}|o`ti�}||jo
d}q�tii|d�}|i|�o|t	|�}q�nti
d|�}|id�o\ti
d|�}|idd�}t	|�djo||d	}}q'|\}}n||}}t|||�S(
Ns#cannot create new bundle repositoryR+tmainreporootR9R�sbundle:RYii(
RRRtconfigRyR�RWtjoinRwRtdrop_schemetsplitRX(RRWtcreatet
parentpathtcwdtstrepopathR�((s'/sys/lib/python/mercurial/bundlerepo.pyRts&


(t__doc__R#Rti18nRRyRRdRgRrR�RRR3RoRRRTRVRRRRQRSRURpRXRt(((s'/sys/lib/python/mercurial/bundlerepo.pys<module>sH$Hw{

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.