-=[ Mr. Bumblebee ]=-
_Indonesia_

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


\,Tc@sddlmZddlmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddlZddl
Z
ddlZddlZddlZddlZddZdefdYZededZdZd	Zd
ZegZdZdZd
ZdZe
j dZ!dZ"dZ#defdYZ$dedZ%dZ&dZ'dZ(dZ)dZ*dZ+dZ,dZ-ddddZ.ddddZ/dZ0d Z1dS(!i(t_(thextnullidNcCsHtj|d}d}|sgd}|jdr|jdrtj||}d}d}qn|r|j|}n|dd!|dd!}}|dkrtjtd	|n|d
kr|dkrtj|d}ntj	||S|dkr%t
j||d||Stjtd
||fdS(NitstreamtHGttHG10tUNiis%s: not a Mercurial bundlet10t2Xtheaders%s: unknown bundle version %s(tchangegrouptreadexactlytNonet
startswiththeaderlessfixuptjointutiltAbortRt
unbundle10tbundle2t
unbundle20(tuitfhtfnametvfsR
talgtmagictversion((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyt
readbundles(t
pushoperationcBs eZdZededZRS(sA object that represent a single push operation

    It purpose is to carry push related state and very common operation.

    A new should be created at the beginning of each push and discarded
    afterward.
    cCs||_|j|_||_||_||_||_d|_t|_	d|_
d|_d|_d|_
d|_dS(N(trepoRtremotetforcetrevst	newbranchR
tlocallockedtsett	stepsdonetrettoutgoingtremoteheadstincomingtcommonheads(tselfRR R!R"R#((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyt__init__2s										N(t__name__t
__module__t__doc__tFalseR
R-(((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyR)scCst|||||}|jjrt|jj|jjj}|rtddjt	|}t
j|qn|jjst
jtdnd}y|jj}t|_WnNtk
r}	t|_|	jtjkrnd|	}|jj|nXz|jj|d}
|jjd}|s`|jj}
nzpt||jjjddtr|jjdrt|nt|t|t|t|Wd|
dk	r|
j nXWd|dk	r
|j nXt!||j"S(	sWPush outgoing changesets (limited by revs) from a local
    repository to remote. Return an integer:
      - None means nothing to push
      - 0 means HTTP error
      - 1 means we pushed and remote head count is unchanged *or*
        we have outgoing changesets but refused to push
      - other values as described by addchangegroup()
    s:required features are not supported in the destination: %ss, s!destination does not support pushs"cannot lock source repository: %s
tunbundletexperimentalsbundle2-expN(#RR tlocalR%Rtrequirementst	supportedRRtsortedRRtcanpushR
tlocktTrueR$tIOErrorR1terrnotEACCESRtdebugt	checkpushtcapablet_pushdiscoveryt
configboolt_pushbundle2t_pushchangesett_pushcomputecommonheadst_pushsyncphaset
_pushobsoletetreleaset
_pushbookmarkR'(RR R!R"R#tpushoptmissingtmsgt	locallockterrR9R2((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytpushSsT		

	

	




c		Cs|jj}tj}|||jd|j}|\}}}tj}|||jd|jd|d|j}||_||_	||_
dS(NR!t	onlyheadst	commoninc(Rt
unfilteredt	discoverytfindcommonincomingR R!tfindcommonoutgoingR"R(R)R*(	RJtunfitfciRQtcommontincR)tfcoR(((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRAs				cCsH|j}|jj}|js>tj|j||jtS|j	sD|j
rtd}d}tdtdtdxx|jD]j}||}|j
rtj||q|jrtjt||jd|fqqWn|jjdd}tj||j||j|jt|j|ntS(	Ns%push includes obsolete changeset: %s!spush includes %s changeset: %s!s%push includes unstable changeset: %s!s#push includes bumped changeset: %s!s&push includes divergent changeset: %s!it	bookmarkstpushing(R(RRRRKtscmutiltnochangesfoundRtexcludedR1R!tobsstoreRtmissingheadstobsoleteRRttroubledttroublest
configlistRSt
checkheadsR R)R#tboolR*R:(RJR(RVtmsotmsttnodetctxtnewbm((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyt_pushcheckoutgoings6				





csdjkrdSjjdjjdtsCdSjjjjjjs|jddt	j
ntjjdj}|jdd|j
fd}|S(srhandle changegroup push through bundle2

    addchangegroup result is stored in the ``pushop.ret`` attribute.
    t
changesetsNsB2X:CHECK:HEADStdataROsB2X:CHANGEGROUPcsJ|jjj}t|ddks1t|ddd_dS(s.extract addchangroup returns from server replyRiitreturnN(trecordst
getrepliestidtlentAssertionErrorR'(topt	cgreplies(tcgpartRJ(s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pythandlereplys(R&taddRmRtprepushoutgoinghooksR R(R!tnewparttiterR)Rtgetlocalbundlet	getchunks(RJtbundlertcgRy((RxRJs6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyt
_pushb2ctxs
	cCsbtj|jtj|j}tj|jj}|jdd|g}x9tD]1}|||}t	|rV|j
|qVqVW|jdkrdStj
|j}y|jj|dgd}Wn)tjk
r}tjd|nXytj|j|}	Wn)tjk
rB}tjd|nXx|D]}
|
|	qJWdS(spush data to the remote using bundle2

    The only currently supported type of data is changegroup but this will
    evolve in the future.s
b2x:replycapsRoiNR!ROsmissing support for %s(Rtbundle20Rtbundle2capsR t
encodecapsRR|tbundle2partsgeneratorstcallabletappendtnbpartsRtchunkbufferRR2terrortBundleValueErrorRt
processbundle(RJRtcapsblobt
replyhandlerstpartgenR'RtreplytexcRvtrephand((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRCs*!

cCsbd|jkrdS|jjdt|s3dS|jj|j|j|j|j}|jjd}d}|j	dkr|j
p|jjjrt
j|j|}t
j|j||ddt}nt
j|jd||}|r:|jr
dg}n	|j}|jj|||jj|_n$|jj|d|jj|_dS(s7Make the actual push of changeset bundle to remote repoRnNR2ROtfastpathR!(R&RzRmRR{R R(R@R
R"R_t	changelogtfilteredrevsRtbundle10t	getsubsetR:R~R!R)R2turlR'taddchangegroup(RJR(R2t
bundlecapsRRR)((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRDs8
				cCs|jj}|jr'|jj}n|jdkrE|jj}nt|jj	}|jj
j}g|jD]}|||krp|^qp}|jd|jj|jj}|j
d|D||_dS(Ns%ln and parents(roots(%ln))css|]}|jVqdS(N(Rj(t.0tc((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pys	<genexpr>Us(RRRR'R(RaR"R
R+R%RXRtnodemapRKtextend(RJRVtcheadsRXtnmRjtrevset((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRE6s	,		cCs|jj}|j}|jjd}|jjddtry|ry|jdkry|j
dtryidd6}n|st||ntj
|j||}|\}}|j
dtrt||n t||t||tj|jd||}tj|j}d|krBtj|j|}	tj|jj}
|	jdd	|
g}tj}x|D]}
|	jd}|jd
|d|jd||
j|jd|ttj|jd
|ttj|j|j|
fq{Wtj|	j}y4|jj |dgd}tj!|j|}Wn)t"j#k
r}tj$d|nXx|D]\}}|j%j&|}|d}t'|dkst(d}|st)d|}n't*|ddst)d|}n|dk	r|jj+|qqWngxd|D]\}
|jjd|
jttjttj}|sI|jj+t)d|
qIqIWdS(s2synchronise phase information locally and remotelytphasesRt_usedassubrepot
publishingR:sheads((%ln::%ln) and public())sb2x:pushkeys
b2x:replycapsRot	namespacetkeytoldtnewR!ROsmissing support for %stpushkeyis'server ignored update of %s to public!
iRpsupdating %s to public failed!
N(,RRRR+R tlistkeysRRBR1R'R
tgett_localphasemoveRtanalyzeremotephasestdraftR%RRRRR|RtencodetaddparamRtstrtpublicRRsRRRR2RRRRRqRrRtRuRtinttwarn(RJRVRtremotephasestanatpheadstdrootstoutdatedtb2capsRRt	part2nodetenct
newremoteheadtpartRRRvRtpartidRjtpartreptresultsRLtr((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRFXst	
	
		


	cCs|jr"tj|j||nbg|D]%}||j|jkr)|^q)}tj|}|r|jjtd|ndS(s0move <nodes> to <phase> in the local source repos8cannot lock source repo, skipping local %s phase update
N(	R$RtadvanceboundaryRtphaset
phasenamesRtstatusR(RJtnodesRtntactualmovestphasestr((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRs	2
c	Cs|jjd|j}|j}tjr|jrd|jdkrg}|jd}xCt|dt	D]/}||}|j
|jd|d|qqWg|D]}|s|^qrtd}|jj
|qndS(s5utility function to push obsolete markers to a remotes'try to push obsolete markers to remote
Rbt
namespacestreversets&failed to push some obsolete markers!
N(RR>RR Rbt_enabledR`RR7R:RRRR(	RJRR trsltst
remotedataRRoRRL((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRGs		
#cCs<|j}|jj}|j}|jdt|jj|jpFg}g|jj	|dt
D]}|^qe}tj||j
|jddt\}}}	}
}}}
x|	D]z\}}}|r||j|krqn|jd|||r|jtd|q|jtd|qWdS(s"Update bookmark position on remoteschecking for updated bookmarks
t	inclusiveR[tsrchexsupdating bookmark %s
supdating bookmark %s failed!
N(RRRRR R>tmapRtrevR"t	ancestorsR:R[tcomparet
_bookmarksRRRRRR(RJRRR trevnumstaRtaddsrctadddsttadvsrctadvdsttdivergetdiffertinvalidtbtscidtdcid((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRIs		
+t
pulloperationcBsJeZdZdedZejdZdZ	dZ
dZRS(sA object that represent a single pull operation

    It purpose is to carry push related state and very common operation.

    A new should be created at the beginning of each pull and discarded
    afterward.
    cCs||_||_||_||_dtj|j|_d|_	d|_
d|_d|_d|_
tdddg|_dS(Nspull
RRt
obsmarkers(RR theadsR!RthidepasswordRt_trnameR
t_trRXtrheadstfetchtcgresultR%t	todosteps(R,RR RR!((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyR-s									cCsl|jdkrat|j}t|j}x-|jD]"}||kr7|j|q7q7W|S|jSdS(s0heads of the set of changeset target by the pullN(RR
R%RXtlistRR(R,RR'R((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytpulledsubsetscCs1|jdkr*|jj|j|_n|jS(s7get appropriate pull transaction, creating it if neededN(RR
RttransactionR(R,((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytgettransactionscCs#|jdk	r|jjndS(sclose transaction if createdN(RR
tclose(R,((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytclosetransactionscCs#|jdk	r|jjndS(srelease transaction if createdN(RR
RH(R,((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytreleasetransaction sN(R.R/R0R
R1R-Rt
propertycacheRRRR(((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRs		cCsNt||||}|jjrzt|jj|jj}|rztddjt	|}t
j|qzn|jj}zt
||jjjddtr|jjdrt|nd|jkrt|nd|jkrt|nd|jkr$t|n|jWd|j|jX|jS(Ns:required features are not supported in the destination: %ss, R3sbundle2-expRRR(RR R4R%R5RR6RRR7RRR9t_pulldiscoveryRRBR1R@t_pullbundle2Rt_pullchangesett
_pullphaset
_pullobsoleteRRRHR(RR RR!tpullopRKRLR9((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytpull%s.	





cCsLtj|jj|jd|jd|j}|\|_|_|_	dS(s~discovery phase for the pull

    Current handle changeset discovery only, will change handle all discovery
    at some point.RR!N(
RSRTRRRR RR!RXRR(Rttmp((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRBs
		cCstj|j}it|jd6}|jjd|j|d<|jpT|j	|d<d|krwdg|d<n|j
s|jjjt
dd	|_nC|jdkrt|jtgkr|jjjt
d
nt|||jdgkrdS|jjd
|}ytj|j||j}Wn)tjk
rm}tjd|nX|j
rt|jddkst|jdd	d|_nx7|jdD](\}}|dkrt||qqWdS(sNpull data using bundle2

    For now, the only supported data are changegroup.RRRXRsb2x:listkeysRRsno changes found
isrequesting all changes
tformatNRsmissing support for %siRpR(RRR t
caps20to10RRtremoveRXRRRRRRRR
RRt_pullbundle2extrapreparetkeyst	getbundleRRRRRRRtRqRut_pullapplyphases(Rt
remotecapstkwargstbundleRvRRtvalue((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRMs4
	'
	cCsdS(s>hook function so that extensions can extend the getbundle callN((RR((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRrscCs|jjd|js?|jjjtdd|_dS|j|j	dkrt|jt
gkr|jjjtdn0|j	dkr|jjdr|j|_	n|jjdr|jjdd	|jd
|j	p|j}nr|j	dkr(|jj|jd}nH|jjdsRtjtdn|jj|j|j	d}tj|j|d|jj|_dS(s0pull changeset from unbundle into the local repoRsno changes found
iNsrequesting all changes
tchangegroupsubsetRRRXRsWpartial pull cannot be done because other repository doesn't support changegroupsubset.(RRRRRRRRRRR
RRXRR R@RRRRRR
RR(RR((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRvs(		
'!cCs#|jjd}t||dS(NR(R RR(RR((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRscCs|jjdt|jdt}|r|rtj|j|j|\}}tj	|jtj
|tj	|jtj|jntj	|jtj
|jdS(s/apply phase movement from observed remote stateRRN(RRRgRR1RRRRRRR(RRRRt_dr((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRs

cCs|jjdd}tjr|jjjd|jj	d}d|kr|j
}xUt|dtD]A}|j
drotj||}|jjj||qoqoW|jjqn|S(sVutility function to pull obsolete markers from a remote

    The `gettransaction` is function that return the pull transaction, creating
    one if necessary. We return the transaction to inform the calling code that
    a new transaction have been created (when applicable).

    Exists mostly to allow overriding for experimentation purposeRs!fetching remote obsolete markers
Rbtdump0RtdumpN(RRR
RbRRRR>R RRR7R:Rtbase85t	b85decodeR`tmergemarkerstinvalidatevolatilesets(Rttrt	remoteobsRRo((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRs	cCs?tdg}tj|j}|jdtj||S(sFreturn a set with appropriate options to use bundle20 during getbundletHG2Xsbundle2=(R%RRRRzturllibtquote(RtcapsR((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRscKstj||d|d|d|}|d
ks<d|krt|rpttddjt|jn|Si}xO|D]G}|jdrt	j
|td}	|jt
j|	qqWt
j|j|}
|r|
jdd	|jn|jd
d}xT|D]L}|
jd}
|
jd||j|j}tj||
_qWt|
||d|d|d||tj|
jS(sfreturn a full bundle (with potentially multiple kind of parts)

    Could be a bundle HG10 or a bundle HG2X depending on bundlecaps
    passed. For now, the bundle can contain only changegroup, but this will
    changes when more part type will be available for bundle2.

    This is different from changegroup.getbundle that only returns an HG10
    changegroup bundle. They may eventually get reunited in the future when we
    have a clearer idea of the API we what to query different data.

    The implementation is at a very early stage and will get massive rework
    when the API of bundle is refined.
    RRXRRs#unsupported getbundle arguments: %ss, sbundle2=sb2x:changegroupRoRsb2x:listkeysRN((RRR
t
ValueErrorRRR7RRRtunquoteRttupdateRt
decodecapsRRR|RRRRtitemsRt
encodekeysRot_getbundleextrapartRR(RtsourceRRXRRRRtbcapstblobRRRRR((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRs0"


cKsdS(sAhook function to let extensions add parts to the requested bundleN((RRRRRXRR((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyRscCsw|j}tjdjt|j}|dgkpZ||kpZ|d|gksstjd|ndS(sVcheck if the heads of a repo have been modified

    Used by peer for unbundling.
    RR!thasheds.repository changed while %s - please try againN(RRtsha1RR7tdigestRt	PushRaced(Rttheir_headstcontextRt
heads_hash((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pytcheck_headss$	c
sed}d|j}z"t||dtj|dr!y|jddjd<tj||fdj	}|j
j}|jr|j
pd}|jd	d
td|d|d
|jj|jdd|d|jWq9tk
r}	t|	_q9Xntj||||}Wddk	rVjn|jX|S(sApply a bundle to a repo.

    this function makes sure the repo is locked during the application and have
    mechanism to check that no push race occurred between the creation of the
    bundle and its application.

    If the push was raced as PushRaced exception is raised.isuploading changestparamsR2t1sbundle2-expcsS(N(((R(s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyt<lambda>sRsb2x-pretransactionclosetthrowRRtpendingsb2x-transactioncloseN(R
R9R)RtsafehasattrRthookargsRRRRRRtwritependingtrootthookR:Rt	Exceptiontduringunbundle2RRRH(
RRRRRRR9tcltpR((Rs6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyR2s2
!
	

(2ti18nRRjRRR<RRR]RRRRSRRbR[RRR
RtobjectRR1RORARmRRRCRDRERFRRRGRIRRRRRRRRRRRRR)R2(((s6/usr/lib/python2.7/dist-packages/mercurial/exchange.pyt<module>sB<H*E	
	'				0	"	W		C		%		 				+	

Copyright © 2017 || Recoded By Mr.Bumblebee