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

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


��c@sJdZddlmZddlmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZdejfd��YZdeejfd��YZd	eejfd
��YZdee
j
fd��YZd
e
jfd��YZde
jfd��YZd�ZdS(s~Repository class for "in-memory pull" of one local repository to another,
allowing operations like diff and log with revsets.
i�(tnullid(t_NtunionrevlogcBsYeZd�Zd�Zd�Zd�Zdddd�Zd�Zd�Z	d�Z
RS(	c	Cs�tj|�}tjj|||�||_t|�}|d|_t�|_x,|jD]!}|jj	|}|\}}	}
}}}
}}|dkr�||ks�t�|}n||�}||jkr�jj
|j|�q]n|jj|
�}|jj|�}dddd||j|�|j|�|f}|j	jd|�||j|<|jj
|�|d7}q]WdS(Nii�(tscmutiltreadonlyvfstrevlogt__init__trevlog2tlent
repotiprevtsett
bundlerevstindextNonetAssertionErrortnodemaptaddtnodetrevtinsert(tselftopenert	indexfileRt
linkmappertntrev2Rt_startt_csizet_rsizet_basetlinkrevtp1revtp2revRtlinktp1nodetp2nodete((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRs0	
	$
cCs;||jkr"tjj||�S|jj|j|��S(N(R	Rt_chunkRR(RR((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR%=scCs�||jkr[||jkr[|jj|jj|j|��|jj|j|���S||jkr�||jkr�tjj|||�Stj|j|j|��|j|j|���S(s1return or calculate a delta between two revisions(	R	RtrevdiffRRRtmdiffttextdifftrevision(Rtrev1R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR&Bs	cCs�t|t�r'|}|j|�}n|}|j|�}|tkrLdS||jkr�|jj|�}|||f|_nt	j	j||�}|S(sTreturn an uncompressed revision of a given node or revision
        number.
        t(
t
isinstancetintRRRR	RR)t_cacheR(Rt	nodeorrevRRttext((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR)NscCs
t�dS(N(tNotImplementedError(RR0ttransactionR!tp1tp2td((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytaddrevisiondscCs
t�dS(N(R1(RtrevsRR2((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytaddgroupfscCs
t�dS(N(R1(RRtminlink((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytstriphscCs
t�dS(N(R1(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyt	checksizejsN(t__name__t
__module__RR%R&R)R
R6R8R:R;(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRs	(					tunionchangelogcBseZd�ZRS(cCsHtjj||�d}tj|�}tj|||j||�dS(N(t	changelogRR
RR(RRtopener2Rt
changelog2((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRns
(R<R=R(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR>mst
unionmanifestcBseZd�ZRS(cCsBtjj||�tj|�}tj|||j||�dS(N(tmanifestRRR(RRR@Rt	manifest2((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRvs(R<R=R(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRBustunionfilelogcBseZd�Zd�ZRS(cCsQtjj|||�tj||�}tj|||j||�||_dS(N(tfilelogRRRt_repo(RRtpathR@Rtrepotfilelog2((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR}s
cCs|jj|�dS(N(RGtfile(Rtf((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyt_file�s(R<R=RRM(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRE|s	t	unionpeercBseZd�ZRS(cCstS(N(tFalse(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytcanpush�s(R<R=RP(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRN�stunionrepositorycBsteZd�Zejd��Zd�Zejd��Zd�Zd�Z	d�Z
d�Zd�Zd	�Z
RS(
cCsjtjj|||�|jjddt�dtj|�tj|�f|_tj||�|_	dS(Ntphasestpublishsunion:%s+%s(
t	localrepotlocalrepositoryRtuit	setconfigROtutilt
expandpatht_urltrepo2(RRVRHtpath2((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR�s
cCst|j|jj�S(N(R>tsopenerR[(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR?�scCs%|jjj|�}|jj|�S(s?map from repo2 changelog rev to temporary rev in self.changelog(R[R?RR(RRR((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyt_clrev�scCst|j|jj|j�S(N(RBR]R[R^(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRC�scCs|jS(N(RZ(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyturl�scCs"t|j||jj|j|�S(N(RER]R[R^(RRL((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRK�scCs|jj�dS(N(R[tclose(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyR`�scCstS(N(RO(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytcancopy�scCs
t|�S(N(RN(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytpeer�scCs
tj�S(N(tostgetcwd(R((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRd�s(R<R=RRTtunfilteredpropertycacheR?R^RCR_RKR`RaRbRd(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyRQ�s							cCsJ|rtjtd���n|jddd�}|sftjtj��}|dkrfd}qfn|r�tj�}||kr�d}q�tj	j
|d�}|j|�r�|t|�}q�n|jd�r-|j
dd�dj
dd�}t|�dkr||d	}}q:|\}}n
||}}t|||�S(
Ns"cannot create new union repositorytbundletmainreporootR+sunion:t:it+i(RXtAbortRtconfigtcmdutiltfindrepoRcRdR
RHtjoint
startswithRtsplitRQ(RVRHtcreatet
parentpathtcwdtstrepopatht	repopath2((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pytinstance�s*	"
(t__doc__RRti18nRRcRXR'RlRRTR?RCRFRRR>RBREt	localpeerRNRURQRw(((s7/sys/lib/python2.7/site-packages/mercurial/unionrepo.pyt<module>s0<Y*

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.