-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/changegroup.pyc


\,Tc@sddlZddlmZddlmZmZmZmZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddlZddlZdZdZdZdZdZd	efd
YZidefd6defd6d
dfd6ddfd6ZdddgZddZdZdefdYZ defdYZ!defdYZ"dZ#e$dZ%dZ&ddZ'dZ(ddddZ)d Z*d!Z+e$d"Z,dS(#iN(t_(tnullrevtnullidthextshortt20s20s20s20scCsM|j|}t||krItjtdt||fn|S(s=read n bytes from stream.read and abort if less was availables5stream ended unexpectedly (got %d bytes, expected %d)(treadtlentutiltAbortR(tstreamtnts((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytreadexactlys
cCsht|d}tjd|d}|dkrW|rStjtd|ndSt||dS(s-return the next chunk from stream as a stringis>lisinvalid chunk length %dt(R
tstructtunpackRR	R(R
tdtl((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytgetchunkscCstjd|dS(s*return a changegroup chunk header (string)s>li(Rtpack(tlength((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytchunkheader$scCstjddS(sBreturn a changegroup chunk header (string) for a zero-length chunks>li(RR(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt
closechunk(st
nocompresscBseZdZdZRS(cCs|S(N((tselftx((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytcompress-scCsdS(NR((R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytflush/s(t__name__t
__module__RR(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyR,s	RtHG10UNtHG10cCs
tjS(N(tbz2t
BZ2Compressor(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt<lambda>7stHG10BZtHG10GZcCs
tjS(N(tzlibtcompressobj(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyR#8scCsBd}d}z|rB|r0|j|d}qrt|d}n0tjdddd\}}tj|d}|}t|\}}|j||}	x*|jD]}
|j|	j	|
qW|j|	j
d}|SWd|dk	r|jn|dk	r=|r-|r-|j|q=tj|nXdS(sWrite a bundle file and return its filename.

    Existing files will not be overwritten.
    If no filename is specified, a temporary file is created.
    bz2 compression can be turned off.
    The bundle file will be deleted in case of errors.
    twbtprefixs
hg-bundle-tsuffixs.hgN(
tNonetopenttempfiletmkstemptostfdopentbundletypestwritet	getchunksRRtclosetunlink(tcgtfilenamet
bundletypetvfstfhtcleanuptfdtheadert
compressortztchunk((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytwritebundle>s0	
	
cCsf|dkr|S|dkr(d}n+|dkr@d}ntjd|tj||S(NtUNtGZcss8tj}x%tj|D]}|j|VqWdS(N(R&t
decompressobjRt
filechunkitert
decompress(tftzdR@((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt	generatorpstBZcssHtj}|jdx(tj|dD]}|j|Vq,WdS(NRJi(R!tBZ2DecompressorRFRRE(RGRHR@((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRIus
sunknown bundle compression '%s'(RR	tchunkbuffer(R:talgRI((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytdecompressorlst
unbundle10cBseZeZejeZdZdZdZ	dZ
dZdZdZ
dZdZd	Zd
ZdZdZRS(
cCs(t|||_||_d|_dS(N(RNt_streamt_typeR+tcallback(RR:RM((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt__init__s	cCs
|jdkS(NRB(RQ(R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt
compressedscCs|jj|S(N(RPR(RR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRscCs|jj|S(N(RPtseek(Rtpos((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRUscCs
|jjS(N(RPttell(R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRWscCs
|jjS(N(RPR4(R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyR4scCsxt|jd}tjd|d}|dkrZ|rVtjtd|ndS|jrp|jn|dS(Nis>lisinvalid chunk length %d(R
RPRRRR	RRR(RRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytchunklengths	
cCsiS(s*v10 does not have a changelog header chunk((R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytchangelogheaderscCsiS(s)v10 does not have a manifest header chunk((R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytmanifestheaderscCs3|j}|siSt|j|}i|d6S(sBreturn the header of the filelogs chunk, v10 only has the filenameR7(RXR
RP(RRtfname((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt
filelogheaders
cCs@|\}}}}|dkr'|}n|}|||||fS(N(R+(Rtheadertupletprevnodetnodetp1tp2tcst	deltabase((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt_deltaheaders
	cCs|j}|siSt|j|j}tj|j|}t|j||j}|j||\}}}}	}
i|d6|d6|d6|
d6|	d6|d6S(NR_R`RaRbRctdelta(RXR
RPtdeltaheadersizeRRtdeltaheaderRd(RR^Rt
headerdataR=ReR_R`RaRcRb((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt
deltachunks!ccst}d}x|s"|dkrt}|d7}xrtrt|}|sQPnt}tt|Vd}x2|t|kr|d}|||!V|}qqWq5WtVqWdS(s"returns all the chunks contains in the bundle

        Used when you need to forward the binary stream to a file or another
        network API. To do so, it parse the changegroup data, otherwise it will
        block in case of sshrepo because it don't know the end of the stream.
        iiiiNi(tFalsetTrueRRRR(RtemptytcountR@RVtnext((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyR3s"

	
(RRt_BUNDLE10_DELTA_HEADERRgRtcalcsizeRfRSRTRRURWR4RXRYRZR\RdRiR3(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRO~s												theaderlessfixupcBseZdZdZRS(cCs||_||_dS(N(t_ht_fh(RR:th((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRSs	cCsp|jr`|j| |j|}|_t||kr\|t|j|t|7}n|St|j|S(N(RrRR
Rs(RRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRs	#(RRRSR(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRqs	tbundle10cBsheZeZd	dZdZdZd	d	dZdZ	dZ
dZdZdZ
RS(
cCs|dkrt}n||_|j|_|j|_|jjddd}|dkrfd}nt	j
|}||_||_|jj
|_dS(sGiven a source repo, construct a bundler.

        bundlecaps is optional and can be used to specify the set of
        capabilities which can be used to build the bundle.
        tbundletreordertautoN(R+tsett_bundlecapst	changelogt
_changelogtmanifestt	_manifesttuitconfigRt	parseboolt_repot_reordertprogresst	_progress(Rtrepot
bundlecapsRw((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRSs				cCstS(N(R(R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyR4scCstt||S(N(RR(RR[((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt
fileheadersc#st|dkr!|jVdSjr6|tk	s<|rytj}tfd|D}|j|}n(tg|D]}j	|^q}j
|dd}	|jd|	t|d}
td}xt
t|dD]}|dk	r0|j||dd|d|
n||||d}
}|j|}x%|j||
|D]}|VqwWqW|jVdS(spCalculate a delta group, yielding a sequence of changegroup chunks
        (strings).

        Given a list of changeset revs, return a set of deltas and
        metadata corresponding to nodes. The first delta is
        first parent(nodelist[0]) -> nodelist[0], the receiver is
        guaranteed to have this parent as it has all history before
        these changesets. In the case firstparent is nullrev the
        changegroup starts with a full revision.

        If units is not None, progress detail will be generated, units specifies
        the type of revlog that is touched (changelog, manifest, etc.).
        iNc3s|]}j|VqdS(N(trev(t.0R(trevlog(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pys	<genexpr>sitbundlingtunitttotal(RR4t
_generaldeltaRjtdagutilt	revlogdagRyt	linearizetsortedRt
parentrevstinsertRtxrangeR+RR_trevchunk(RtnodelistRtlookuptunitsRwtdagtrevsRtpRtmsgbundlingtrtprevtcurrtlinknodetc((Rs9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytgroups((#
cCsB|j|j}}g|D]$}||||kr|^qS(N(Rtlinkrev(RRtmissingt
commonrevstsourcetrrtrlR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytprune0sc#s|j}|j|j|j}|j}td}iitfd}	fd}
x4|j||	dtdd|D]}|VqW||dxD]}i|<qW|j	||}
x4|j|
|
dtdd|D]}|VqW||dj
tfd|Dfd	}x%|j|||D]}|VqW|jV||d|r|j
d
dt|dd
|ndS(s0yield a sequence of changegroup chunks (strings)Rcs8j|}j|dj|d||S(Nii(Rtupdatet
setdefault(RR(tchangedfilestcltmfs(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytlookupclFscsf|}sbj|}x@|jD]/\}}|kr,|j||q,q,Wn|S(N(treadfastt	iteritemsR(RtclnodetmdataRGR(RtfastpathlinkrevtfnodestmfR(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytlookupmfPs
Rt
changesetsRwt	manifestsc3s|]}j|VqdS(N(R(RR(R(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pys	<genexpr>iscsMr=jfd}t||<nj|iS(Nc3sMxFD]>}|}|krj|j|fVqqWdS(N(R_(RR(Rt
filerevlogtllrtneeded(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytgenfilenodesns
(Rtdicttget(RR[R(RRRR(RRs9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt	linknodesks
	toutgoingR_iRN(RR|R~RRRRyRR+Rtcleart
generatefilesR4thookR(RRtclnodesRRRRwRRRRR@RGtmfnodesR((RRRRRRRs9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytgenerate4s@						
!
	

!
	


	
c
#s2|j}|j}|j}td}t|}	td}
xtt|D]\}}|j|}
|
stj	td|n||
|fd}|j
|
||}|rR|||dd|d|
d|	|j|Vx+|j||
|d	|D]}|VqWqRqRWdS(
NRtfilessempty or missing revlog for %scs|S(N((R(tlinkrevnodes(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt
lookupfilelogsititemRRRw(
RRRRRt	enumerateRtfileRR	RRR(RRRRRRRRwRRtmsgfilestiR[RRt	filenodesR@((Rs9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRs(			
ccs|j|}|j|\}}|}d}	|tkrc|j|}
tjt|
}	n|j||}
|j|\}}|j|}
|j	||||
|}||	7}t|t|
}t
|V|V|
VdS(NR(R_RRtrevisiontmdiffttrivialdiffheaderRtrevdifftparentstbuilddeltaheaderR(RRRRRR_R`RatbaseR)Retp1ntp2ntbasenodetmetaR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRs 
cCstj|j||||S(N(RRRg(RR_RRRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRsN(RRRoRgR+RSR4RRRRRRR(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRus		.		L		cCs|jjs|dkr;|jjtdt|n|jjr|jjdx+|D] }|jjdt|q^WndS(NRvs%d changesets found
slist of changesets:
s%s
(RtverbosetstatusRRt	debugflagtdebugR(RtnodesRR_((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt_changegroupinfos#
c
Cs|j}|j}|j}|j}|j|p[|jdko[|t|jk}|j	ddt
d|t||||j||||}	t
tj|	dS(NtpreoutgoingtthrowRRB(t
unfilteredtcommonRtmissingheadstsortt
filternameR+RtheadsRRkRRRORRL(
RRtbundlerRtfastpathRtcsetsRRtgengroup((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt	getsubsets			
'cCs|j}|stg}n|j||\}}}g}xC|D];}|jg|j|D]}|tkr_|^q_qCWtj|||}	t|}
t||	|
|S(sCompute a changegroup consisting of all the nodes that are
    descendants of any of the roots and ancestors of any of the heads.
    Return a chunkbuffer object whose read() method will return
    successive changegroup chunks.

    It is fairly complex as determining which filenodes and which
    manifest nodes need to be included for the changeset to be complete
    is non-trivial.

    Another wrinkle is doing the reverse, figuring out which changeset in
    the changegroup a particular filenode or manifestnode belongs to.
    (	R{RtnodesbetweentextendRt	discoveryRRuR(RtrootsRRRRt	discbasesRRRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytchangegroupsubsets
	
9cCs/|js
dSt||}t||||S(sLike getbundle, but taking a discovery.outgoing as an argument.

    This is only implemented for local repos and reuses potentially
    precomputed sets in outgoing.N(RR+RuR(RRRRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytgetlocalbundles	cCsq|j}|r@|j}g|D]}||r|^q}n	tg}|s^|j}ntj|||S(sComputes which revs are outgoing given a set of common
    and a set of heads.

    This is a separate function so extensions can have access to
    the logic.

    Returns a discovery.outgoing object.
    (R{thasnodeRRRR(RRRRRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt_computeoutgoings			(	cCs(t|||}t|||d|S(s6Like changegroupsubset, but returns the set difference between the
    ancestors of heads and the ancestors common.

    If heads is None, use the local heads. If common is None, use [nullid].

    The nodes in common might not all be known locally due to the way the
    current discovery protocol works.
    R(RR(RRRRRR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt	getbundles	cCst|||j|S(N(RR(Rt	basenodesR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytchangegroupscCsd}d}x4trB|j}|s+Pn|d}	|jjd|	||j|	}
t|
}|
j|||stjt	dn|t|
|7}|d7}|	|kr||	}x]t
|t|
D]F}
|
j|
}||kr|j|qtjt	dqW|s?||	=q?qqW|jj
t	ddx|jD]y\}	}|j|	}
x[|D]S}y|
j|Wqtjk
rtjt	d|	t|fqXqWqiW||fS(	NiR7sadding %s revisions
s#received file revlog group is emptyis#received spurious file revlog entryRs+missing file data for %s:%s - run hg verify(RkR\RRRRtaddgroupRR	RRR_tremoveRR+RRterrortLookupErrorR(RRtrevmapttrptprt	needfilest	revisionsRt	chunkdataRGtfltotneedstnewR((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytaddchangegroupfilessH	



	"c sjfd}fd}|s7dSjddtddd}}}	t}
jjjjdjt	j
gztj}j
jtd	td
tffdY}|}
|
|_|jj|||}|p=|sXt	jtdnt}|}x.t|D]}|
j|jq~Wt|
}
j
jtd
d$j
jtdtd|
_d|
_||
_|jjj|||j
jtdd$i}j
j dddt!rxt|D]s}jj"jj#|d}jj$|}x6|j%D](\}}|j&|tj'|qWqeWnj
jtdtd|
_d|
_|
|
_d$|_t(||||
|\}}|	|7}	||7}d}rj}t|t}x:|D]/}|kr|j)r|d8}qqWnd}|rtd|}nj
jtd||	||fj*|dkrfd}dj+krZt,j#j+d<njddtddd|j+ngt|D]}j#|^qj
j ddt}d%kr%|rt-j.t-j/|qJt-j.t-j0|t-j1t-j0n%d!krJt-j1t-j0nj2|j3|dkrd!krt4j5j6d"nfd#}j7|nWd$j8X|dkr|dS|dSd$S(&sAdd the changegroup returned by source.read() to this repo.
    srctype is a string like 'push', 'pull', or 'unbundle'.  url is
    the URL of the repo where this changegroup is coming from.

    Return an integer summarizing the change to this repo:
    - nothing changed or no source: 0
    - more heads than before: 1+added heads (2..n)
    - fewer heads than before: -1-removed heads (-2..-n)
    - number of heads stays the same: 1
    cs$jjdt|tS(Nsadd changeset %s
(RRRR(R(RR(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytcsmapHscs
j|S(N(R(R(R(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRLsitprechangegroupRRturls
sadding changesets
tprogcs2eZedZdZjZdZdZRS(RicSsA|jj|j|jdtdd|j|jd7_dS(NRtchunksRi(RRtstepRmRR(R((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt__call__hs$
N(	RRRRRmRR+RR((R(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyRcs
	s!received changelog group is emptyRsadding manifests
Ritservertvalidatetdefaultsadding file changes
RRs (%+d heads)s2added %d changesets with %d changes to %d files%s
csjrjpdS(NR(twritependingtroot((RR(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyR#sR_tpretxnchangegrouptpendingtphasestpublishtpushtservetstriptservedc
stkrdSjjdjdddjx3D]+}jddt|ddqLWgjD]}|kr|^q}jjddtdjg|D]}t|d	 ^qdS(
Nsupdating the branch cache
RRRtincomingR_s$%s incoming changes - new heads: %s
s, i(	RRRRthookargsRRtlogtjoin(RRttnewheadsR(taddedtclstarttoldheadsRtsrctypettrR(s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytrunhookss

+	N(RR(9RRRkRyR{tdelayupdateRttransactionR#RthidepasswordtweakreftproxyRRRRtobjectRRRYRR	RRRRR+RRmRRZR}t
configboolRjRR_t	readdeltaRRtaddRtclosesbranchtinvalidatevolatilesetsR!RRtadvanceboundarytpublictdrafttretractboundarytfinalizeR4t	branchmaptupdatecachetfilteredt
_afterlocktrelease( RRR(RtemptyokRRRRRtefilesRRRt
srccontenttclendRRtcsettmfestRGRtnewrevstnewfilestdhRRtthtextRRt
publishingR*((R%RR&R'RR(R)Rs9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pytaddchangegroup<s		
'			

		
"'			



+

!(-R.ti18nRR_RRRRRRRRR/R!R&R-RRRR;RoR
RRRR0RR1tbundlepriorityR+RARNRORqRuRRjRRRRRRRRK(((s9/usr/lib/python2.7/dist-packages/mercurial/changegroup.pyt<module>s>"$<0			
		

.	\		
			)

Copyright © 2017 || Recoded By Mr.Bumblebee