HEX
Server: Apache
System: Linux p102.lithium.hosting 4.18.0-553.141.1.el8_10.x86_64 #1 SMP Fri Jul 10 17:48:02 UTC 2026 x86_64
User: bvzmoamr (9955)
PHP: 8.1.34
Disabled: syslog
Upload Files
File: //proc/thread-self/root/lib64/python2.7/site-packages/mercurial/exchange.pyc
�
1�3\c	@@s�ddlmZddlZddlZddlmZddlmZmZm	Z	m
Z
ddlmZddl
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZm Z m!Z"m#Z#ddl$m%Z%e#j&Z&e#j'Z'd	Z(id
d6dd
6dd6dd6Z)iie*d6d
d6e+d6e+d6e+d6e+d6d6ie*d6dd6e+d6e+d6e*d6e*d6d
6idd6d6Z,e,d
e,d<iie+d6e*d6e+d6e+d6d6Z-dddhZ.ej/de0fd��Y�Z1e*d�Z2dd�Z4d�Z5d �Z6d!�Z7d"e0fd#��YZ8ied$�ed%�fd&6ed'�ed(�fd)6ed*�ed+�fd,6Z9e+de+d�dd-�Z:gZ;iZ<d.�Z=d/�Z>e=d0�d1��Z?e=d2�d3��Z@e=d4�d5��ZAe=d6�d7��ZBd8�ZCd9�ZDgZEiZFdd:�ZGd;�ZHd<�ZIeGd=�d>��ZJeGd?�d@��ZKeGd0�dA��ZLeGd2�dB��ZMdC�ZNdD�ZOeGdE�dF��ZPeGd6�dG��ZQdH�ZRdI�ZSdJ�ZTeGdKdLd�dM��ZUdN�ZVdO�ZWdP�ZXejYdQ�ZZdR�Z[dS�Z\dTe0fdU��YZ]dVe#j^fdW��YZ_dX�Z`dY�Zade+d�ddddddZ�ZbgZciZdd[�Zed\�Zfeed]�d^��Zgeed�d_��Zhd`�Zida�Zjdb�Zkdc�Zldd�Zmde�Zndf�Zodg�Zpddh�Zqdi�ZrgZsiZtddj�Zudk�Zvddddl�Zweudm�dn��Zxeud�dddddo��Zyeud6�dddp��Zzeudq�dddr��Z{eudE�dddds��Z|eud�ddddt��Z}eudu�dddddv��Z~eudw�dddddx��Zdy�Z�dz�Z�d{�Z�d|�Z�d}�Z�e+d~�Z�de0fd���YZ�d��Z�d��Z�dS(�i(tabsolute_importNi(t_(tbinthextnullidtnullrev(tattr(t	bookmarkstbundle2tchangegroupt	discoveryterrort
exchangev2tlocktlogexchanget
narrowspectobsoletetphasestpushkeytpycompatt
repositorytscmutiltsslutiltstreamcloneturltutil(t
stringutiltnarrowhgaclt01tv1t02tv2ts1tpacked1RR	s
cg.versiontobsolescenceRttagsfnodescachetrevbranchcachetstreamv2tgziptbzip2tnonet
bundlespeccB@sPeZej�Zej�Zej�Zej�Zej�Zej�Z	RS((
t__name__t
__module__Rtibtcompressiontwirecompressiontversiontwireversiontparamstcontentopts(((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR)[scC@s�d�}|r7d|kr7tjtd�|��nd|kr�|jdd�\}}|tjjkr�tjtd�|��n||�\}}|tkr|tjtd�|��q|n�|s�t	�||�\}}|tjjkr3|}d}d|j
krd	}n|tkr|d	}q|nI|tkrc|d
krTd}nd}|}ntjtd
�|��|dkr�|tkr�tjtd�|��n|d
kr"d|kr"t|djd��}||j
}|r"tjtd�djt|����q"ntj|i�j�}	d|krp|dd	krptd}
|	j|
�ntjj|�}|j�\}}t|}
t||||
||	�S(s�Parse a bundle string specification into parts.

    Bundle specifications denote a well-defined bundle/exchange format.
    The content of a given specification should not change over time in
    order to ensure that bundles produced by a newer version of Mercurial are
    readable from an older version.

    The string currently has the form:

       <compression>-<type>[;<parameter0>[;<parameter1>]]

    Where <compression> is one of the supported compression formats
    and <type> is (currently) a version string. A ";" can follow the type and
    all text afterwards is interpreted as URI encoded, ";" delimited key=value
    pairs.

    If ``strict`` is True (the default) <compression> is required. Otherwise,
    it is optional.

    Returns a bundlespec object of (compression, version, parameters).
    Compression will be ``None`` if not in strict mode and a compression isn't
    defined.

    An ``InvalidBundleSpecification`` is raised when the specification is
    not syntactically well formed.

    An ``UnsupportedBundleSpecification`` is raised when the compression or
    bundle type/version is not recognized.

    Note: this function will likely eventually return a more complex data
    structure, including bundle2 part information.
    cS@s�d|kr|ifSi}|jdd�\}}x|jd�D]n}d|krrtjtd�|��n|jdd�\}}tj|�}tj|�}|||<qDW||fS(Nt;it=s:invalid bundle specification: missing "=" in parameter: %s(tsplitRtInvalidBundleSpecificationRturlreqtunquote(tsR1R/tparamstrtptkeytvalue((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytparseparams�s
	
t-sCinvalid bundle specification; must be prefixed with compression: %sis%s compression is not supporteds%%s is not a recognized bundle versionRtgeneraldeltaRR!R(R's+%s is not a recognized bundle specifications4compression engine %s is not supported on v1 bundlestrequirementst,s+missing support for repository features: %ss, tstreamR%(RR6RR5RtcompenginestsupportedbundlenamestUnsupportedBundleSpecificationt_bundlespeccgversionstAssertionErrorRAt_bundlespecv1compenginestsettsupportedformatstjointsortedt_bundlespeccontentoptstgettcopyt_bundlespecvariantstupdatet
forbundlenamet
bundletypeR)(trepotspectstrictR>R-R/R1RAtmissingreqsR2tvarianttengineR.R0((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytparsebundlespecdsd!		

				

	

cC@sdtj|d�}d}|sgd}|jd�r|jd�rtj||�}d}d}qn|r|j|�}n|dd!|dd!}}|dkr�tjtd	�|��n|d
kr�|dkr�tj|d�}ntj	||�S|jd�r(t
j||d||�S|d
krAtj
|�Stjtd�||f��dS(NiRCtHGstHG10tUNiis%s: not a Mercurial bundlet10t2tmagicstringtS1s%s: unknown bundle version %s(R	treadexactlytNonet
startswiththeaderlessfixupRLRtAbortRtcg1unpackerRtgetunbundlerRtstreamcloneapplier(tuitfhtfnametvfstheadertalgtmagicR/((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
readbundle�s,
cC@s5d�}t||d�}t|tj�r�|j}|dkrKd}n||�}|sytjtd�|��nd|St|t	j
�r�d|jkr�||jd�}|s�tjtd�|��q�nd}d}x�|j�D]�}|j
dkrR|jd	}|dkr*d}q�tjtd
�|dtd���q�|j
dkr�|dkr�d}tj|jd�}|j�}	t	j|	�}
d|
Sq�W|s�tjtd���nd||fSt|tj�rtj|�d}t	j|�}d|Stjtd�|��dS(s�Infer the bundlespec from a bundle file handle.

    The input file handle is seeked and the original seek position is not
    restored.
    cS@s7ytjj|�j�dSWntk
r2dSXdS(Ni(RRDt
forbundletypeRTtKeyErrorRd(Rp((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytspeccompressions
t_truncatedBZtBZs!unknown compression algorithm: %ss%s-v1tCompressionR(R	R/RRRs7changegroup version %s does not have a known bundlespecthints#try upgrading your Mercurial clienttstream2RAsnone-v2;stream=v2;%ss0could not identify changegroup version in bundles%s-%sisnone-packed1;%ssunknown bundle type: %sN(RR(RrRdt
isinstanceR	Rht_typeRRgRRt
unbundle20R1t	iterpartsttypeR7R8R5t_formatrequirementsparamsRRjtreadbundle1header(RkRlRutbRptcompR/tpartRAtsplittedR1t	formatted((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
getbundlespecsN			
	cC@sq|j}|r@|j}g|D]}||�r|^q}n	tg}|s^|j�}ntj|||�S(s�Computes 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.
    (t	changelogthasnodeRtheadsR
toutgoing(RUR�tcommontclR�tn((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_computeoutgoing=s			(	cC@sM|jj}|jdd�}d|ko3d|k}|pL|jjd�S(ssreturn true if a pull/push must use bundle1

    This function is used to allow testing of the older bundle versiontdevelslegacy.exchangeRtbundle1(RURkt
configlisttremotetcapable(topRktexchangetforcebundle1((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
_forcebundle1Pst
pushoperationcB@sYeZdZededdd�Zejd��Zejd��Z	e
d��ZRS(s�A object that represent a single push operation

    Its purpose is to carry push related state and very common operations.

    A new pushoperation should be created at the beginning of each push and
    discarded afterward.
    cC@s�||_|j|_||_||_||_||_||_t�|_d|_
d|_d|_d|_
d|_d|_d|_d|_d|_t�|_g|_d|_i|_||_dS(N(RURkR�tforcetrevsRt	newbranchRJt	stepsdoneRdtcgresulttbkresultR�tremoteheadst
pushbranchmaptincomingtremotephasestoutdatedphasestfallbackoutdatedphasest
outobsmarkerstoutbookmarkst	trmanagertpkfailcbtpushvars(tselfRUR�R�R�R�RR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__init__hs,										
								cC@s
|jjS(s2future remote heads if the changeset push succeeds(R�tmissingheads(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytfutureheads�scC@s�|jdkr|jjS|jj�}|jj}|jjj}g|jD]}|||krM|^qM}|j	d|jj|jj
�}|jd�|D��|S(s/future remote heads if the changeset push failss%ln and parents(roots(%ln))cs@s|]}|j�VqdS(N(tnode(t.0tc((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>�sN(R�RdR�tcommonheadsRUt
unfilteredR�R�tnodemapRJtmissingtextend(R�tunfiR�tnmR�tcheadstrevset((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
fallbackheads�s
,		cC@s|jr|jS|jSdS(s3set of all common heads after changeset bundle pushN(R�R�R�(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s	N((R*R+t__doc__tFalseRdR�Rt
propertycacheR�R�tpropertyR�(((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�_s	? supdating bookmark %s
supdating bookmark %s failed!
RRsexporting bookmark %s
sexporting bookmark %s failed!
texportsdeleting remote bookmark %s
s$deleting remote bookmark %s failed!
tdeletecC@s�|d
kri}nt||||||tj|��}|jj�r�t|jj�|jj�j	}|r�t
d�djt|��}	t
j|	��q�n|jj�s�t
jt
d���n|jjd�s�t
jt
d���nd
}
}yn|jjdd�}t|�r?|r?|jj�}
n|jj�}t|jd|jj��|_Wn9t
jk
r�}
d	tj|
�}	|jj|	�nX|
p�tj���|p�tj��||jp�tj��`|jj|�t |�t|�st!|�nt"|�t#|�t$|�t%|�Wd
QXWd
QXWd
QX|jjdd�r}t&j'||�n|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 pushtunbundlesLcannot push: destination does not support the unbundle wire protocol commandtexperimentalsbundle2.pushbacks
push-responses"cannot lock source repository: %s
Ntremotenames((RdR�Rt	strkwargsR�tlocalRJRURAt	supportedRRLRMRRgtcanpushR�Rkt
configboolR�twlockR
ttransactionmanagerRR�tLockUnavailableRtforcebytestrtdebugRtnullcontextmanagert	checkpusht_pushdiscoveryt_pushbundle2t_pushchangesett_pushsyncphaset
_pushobsoletet
_pushbookmarkRtpullremotenames(RUR�R�R�R�RtopargstpushopR�tmsgR�R
tmaypushbackterr((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytpush�sT
		
	




c@s�fd�}|S(s|decorator for function performing discovery before push

    The function is added to the step -> function mapping and appended to the
    list of steps.  Beware that decorated function will be added in order (this
    may matter).

    You can only use this decorator for a new step, if you want to wrap a step
    from an extension, change the pushdiscovery dictionary directly.c@s-�tkst�|t�<tj��|S(N(tpushdiscoverymappingRHtpushdiscoveryordertappend(tfunc(tstepname(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytdec3s

((R�R�((R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
pushdiscovery*s	cC@s)x"tD]}t|}||�qWdS(sRun all discovery stepsN(R�R�(R�R�tstep((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�:s

t	changesetc	C@s�tj}|jr<||j|jd|jd|j�}n||j|jd|j�}|\}}}tj}||j|jd|jd|d|j�}||_||_||_	dS(s-discover the changeset that need to be pushedR�tancestorsoft	onlyheadst	commonincN(
R
tfindcommonincomingR�RUR�R�tfindcommonoutgoingR�R�R�(R�tfciR�R�tincR�tfcoR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushdiscoverychangeset@s					tphasecC@sj|j}|jj�}t|jd�}|jjdd�rz|rz|jjrz|jdt	�rzg|_
g|_dStj
|j|j|�|_|jj}d}|jjs�d}nd|}t|j|||j��}|js�|}n[t|jd	|j|��}	g|	D]}
|
j�^q}	t|j||	|j��}||_
||_dS(
spdiscover the phase that needs to be pushed

    (computed for both success and failure case for changesets push)RRkt_usedassubrepot
publishingNts
 and public()sheads((%%ln::%%ln) %s)sroots(%ln  + %ln::)(R�RUR�tlistkeysR�RkR�R�ROR�R�R�RtremotephasessummaryR�R�t
draftrootsR�tlistRJR�R�(R�R�R�R�tdrootst	extracondR�tfallbacktfuturetfdrootstf((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushdiscoveryphaseQs6	

			
			t	obsmarkercC@s�tj|jtj�sdS|jjs,dSdt|jd�krHdS|j}d�|jd|j�D�}|jjj	|�|_
dS(NRt
namespacescs@s|]}|j�VqdS(N(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>�ss::%ln(Rt	isenabledRUtexchangeopttobsstoreR�R�RJR�trelevantmarkersR�(R�RUtnodes((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushdiscoveryobsmarkers�s	Rc@s$|j}|jj�}|j}|jd�d}|jrstj|jj	|j�}|jj
|dt�}nt|d�}t
g|jD]}|jj|�^q��}tj|�}tj||j|�}	d���fd�}
g|	D]}|
|�^q�}	t|||||	�S(Nschecking for updated bookmarks
t	inclusiveRcS@s|dkr|St|�S(N(RdR(tx((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytsafehex�sc@s5g|D]*\}}}|�|��|�f^qS(N((RR�tscidtdcid(R	(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pythexifycompbookmarks�s((RkRUR�R�R�R�RtmaplistR�trevt	ancestorstTrueR�RJRt
_bookmarkst
expandnametbookmodtunhexlifybookmarkstcomparebookmarkst_processcompared(R�RkRUR�RtrevnumstremotebookmarktbookmarktexplicitR�Rtmarks((R	s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushdiscoverybookmarks�s"		
	(	cC@s |\}}}}}	}
}}|j}
xl|D]d\}}}||krY|j|�n|sv|
|j�|kr.|jj|||f�q.q.WxL|D]D\}}}||kr�|j|�|jj|d|f�q�q�Wxft|�t|	�t|
�D]D\}}}||kr|j|�|jj|||f�qqWxL|D]D\}}}||krU|j|�|jj||df�qUqUWx3|D]+\}}}||kr�|j|�q�q�W|rt|�}|jjt	d�|d�d|_
n|jj�dS(s~take decision on bookmark to pull from the remote bookmark

    Exist to help extensions who want to alter this behavior.
    R�s>bookmark %s does not exist on the local or remote repository!
iiN(RUtremoveRR�R�R�RMRktwarnRR�tsort(R�tpushedRt	remotebmsR�taddsrctadddsttadvsrctadvdsttdivergetdiffertinvalidtsameRUR�R
R((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s8	 
 0
 
 c	C@s|j}|jj�}|js>tj|j||j�tS|j	s|j
rtd�}td�}td�}itd�d6|d6|d6}xp|jD]b}||}|j
�r�tj||��q�|j�r�tj||j�d|��q�q�Wntj|�ntS(	Ns%push includes obsolete changeset: %s!s,push includes phase-divergent changeset: %s!s.push includes content-divergent changeset: %s!s#push includes orphan changeset: %s!torphansphase-divergentscontent-divergenti(R�RUR�R�RtnochangesfoundRktexcludedR�R�RRR�RRRgt
isunstablet
instabilitiesR
t
checkheadsR(	R�R�R�tmsotmspdtmscdtmstR�tctx((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushcheckoutgoing�s*				

+c@s��fd�}|S(swdecorator for function generating bundle2 part

    The function is added to the step -> function mapping and appended to the
    list of steps.  Beware that decorated functions will be added in order
    (this may matter).

    You can only use this decorator for new steps, if you want to wrap a step
    from an extension, attack the b2partsgenmapping dictionary directly.c@sL�tkst�|t�<�dkr8tj��ntj���|S(N(tb2partsgenmappingRHRdtb2partsgenorderR�tinsert(R�(tidxR�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s
((R�R9R�((R9R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytb2partsgenerator
s	c
C@s|jr|jjrd|jjdd�k}|jdk}|sM|rl|jddt|j	��qt
�}xr|jj�D]a\}}|\}}}	}
|dk	r�t
|�}|t
|
�|@O}||t
|�O}q�q�W|rtt|��}|jdd|�qndS(sdGenerate race condition checking parts

    Exists as an independent function to aid extensions
    trelatedR/scheck:headstdatascheck:updated-headsN((
R�R�R�tcapabilitiesROR�RdtnewparttiterR�RJt	iteritemsRM(
R�tbundlertallowunrelatedtemptyremotetaffectedtbranchR�R�tnewheadst
unsyncedheadstdiscardedheadsR�R<((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushb2ctxcheckheads s
	cC@s+t|jjp'|jp'|jp'|j�S(s&return True if we are pushing anything(tboolR�R�R�R�R�(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushing8s		scheck-bookmarksc	C@s�t|�s|jrdStj|j�}d|k}|joD|sKdSg}x9|jD].\}}}t|�}|j||f�q[Wtj	|�}|j
dd|�dS(sinsert bookmark move checkingNRscheck:bookmarksR<(RKR�Rtbundle2capsR�R�RR�RtbinaryencodeR>(	R�RAtb2capsthasbookmarkcheckR<tbooktoldtnewt	checkdata((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushb2checkbookmarks?sscheck-phasescC@s�t|�s|jrdStj|j�}d|jdd�k}|jdk	r�|r�gtj	D]}g^qc}|tj
j|jj�|tj
j|jj�t|�r�x|D]}|j�q�Wtj|�}|jdd|�q�ndS(sinsert phase move checkingNR�Rscheck:phasesR<((RKR�RRLR�ROR�RdRt	allphasestpublicR�tpublicheadstdraftR�tanyRRMR>(R�RARNt
hasphaseheadsR;tchecksRRS((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushb2checkphasesOs
c@s_d�jkrdS�jjd�t��s3dS�jj��t�|�tj�j�}d}|j	d�}|r�g|D]$}|t
j�j�kr�|^q�}|s�tt
d���nt|�}nt
j�j�j|d�}|jdd|��|r$�jd|�nd	�jjkrI�jd	d
�n��fd�}|S(swhandle changegroup push through bundle2

    addchangegroup result is stored in the ``pushop.cgresult`` attribute.
    t
changesetsNRR	sno common changegroup versionR�R<R/ttreemanifestt1c@sJ|jj�j�}t|d�dks1t�|ddd�_dS(s0extract addchangegroup returns from server replyR	iitreturnN(trecordst
getrepliestidtlenRHR�(R�t	cgreplies(tcgpartR�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pythandlereply�s(R�taddR5RUtprepushoutgoinghooksRIRRLR�ROR	tsupportedoutgoingversionst
ValueErrorRtmaxt
makestreamR�R>taddparamRA(R�RARNR/t
cgversionstvtcgstreamRg((RfR�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
_pushb2ctxas4

		cC@s�d|jkrdStj|j�}|jj}d|jdd�k}d|k}d|jdd�k}|r�|r�t||�S|r�t	||�SdS(s!handle phase push through bundle2RNR�slegacy.exchangeRR�((
R�RRLR�RURkR�ROt_pushb2phaseheadst_pushb2phasespushkey(R�RARNRktlegacyphaset
haspushkeyRZ((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
_pushb2phases�s

cC@s||jjd�|jrxgtjD]}g^q#}|djd�|jD��tj|�}|jdd|�ndS(s6push phase information through a bundle2 - binary partRics@s|]}|j�VqdS(N(R�(R�th((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>�ssphase-headsR<N(R�RhR�RRUR�RMR>(R�RAR;tupdatest	phasedata((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRs�s	c@s��jjd�g��fd�}tj}x��jD]�}|jd�}|jd|d��|jd||j���|jd|dtj	��|jd|dtj
���j|j|f�|�j
|j<q8W��fd	�}|S(
s7push phase information through a bundle2 - pushkey partRc@sRt|j�}x<�D]4\}}||krtjtd�|��qqWdS(Nsupdating %s to public failed(tinttpartidRRgR(R�texcttargetidR|R�(t	part2node(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
handlefailure�sRt	namespaceR<RQs%dRRc@s�x��D]�\}}|jj|�}|d}t|�dksGt�d}|sftd�|}n't|dd�s�td�|}n|dk	r�jj|�qqWdS(NRis'server ignored update of %s to public!
iR`supdating %s to public failed!
(	RaRbRdRHRdRR{RkR(R�R|R�tpartreptresultsR�(RR�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRg�s
(R�RhRtencodeR�R>RnRRRXRVR�RcR�(R�RAR�tenct
newremoteheadR�Rg((RR�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRt�s	t
obsmarkerscC@s}d|jkrdStj|j�}tj|�dkr>dS|jjd�|jryt	|j�}tj
||�ndS(NR�(R�RtobsmarkersversionR=Rt
commonversionRdRhR�RMtbuildobsmarkerspart(R�RAtremoteversionstmarkers((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushb2obsmarkers�s	cC@s�d|jkrdStj|j�}|jjjdd�}d|k}|rid|krit||�Sd|kr�t||�SdS(s$handle bookmark push through bundle2RNR�slegacy.exchangeR(	R�RRLR�RURkR�t_pushb2bookmarkspartt_pushb2bookmarkspushkey(R�RARNtlegacytlegacybooks((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pushb2bookmarks�s
cC@s|s
dS|sdSdS(s"small utility for bookmark pushingR�R�RR((RQRR((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt	_bmaction�s
c@s��jjd��jsdSg�g}xU�jD]J\}}}t|�}|j||f��j|t||�f�q3Wtj|�}|jdd|���fd�}|S(NRR<c@s=�j}x-�D]%\}}|jt|d|�qWdS(Ni(Rktstatust
bookmsgmap(R�RkRPtaction(t
allactionsR�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRg�s	(	R�RhR�RR�R�RRMR>(R�RAR<RPRQRRRSRg((R�R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s	 c
@s�jjd�g�tj}�fd�}x��jD]�\}}}|jd�}|jd|d��|jd||��|jd||��|jd||��d}|s�d	}n|s�d
}n�j|j||f�|�j	|j<q8W��fd�}	|	S(NRc@sit|j�}xG�D]?\}}}||krtjt|dj�|��qqWtset�dS(Ni(R{R|RRgR�trstripR�RH(R�R}R~R|RPR�(t	part2book(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s
(RR�R<RQRRRRR�R�c@s��j}x��D]�\}}}|jj|�}|d}t|�dksSt�|sv�jjtd�|�qt|dd�}|r�|jt	|d|�q|jt	|d|��j
dk	rd�_
qqWdS(NRis"server ignored bookmark %s update
iR`(RkRaRbRdRHRRR{R�R�R�Rd(R�RkR|RPR�R�R�tret(R�R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRgs	
(
R�RhRR�R�R>RnR�RcR�(
R�RAR�R�RPRQRRR�R�Rg((R�R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s&			R�R9cC@s�|j}|r�i}xX|D]P}d|krJd}tj||��n|jdd�\}}|||<qW|jd�}x3|j�D]"\}	}
|j|	|
dt�q�WndS(ssend shellvars via bundle2R4sIunable to parse variable '%s', should follow 'KEY=VALUE' or 'KEY=' formatiR�t	mandatoryN(R�RRgR5R>R@RnR�(R�RAR�t	shellvarstrawR�tkRpR�R<R=((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlesendvars,s	
c	C@s�tj|jtj|j��}|jo<|jjdd�}tjtj|j	d|dd��}|j
dd|�g}xCtD];}t|}|||�}t
|�r�|j|�q�q�W|jdkr�d	Stj|j��}ykyU|jj��@}	|	jd
i|d6dgd
6|jj�d6�j�}
Wd	QXWn/tjk
rv}tjtd�|��nXy7d	}|r�|jj}ntj|j	|
|�}
Wn�tjk
r�}tjtd�|��nxtjk
rV}|jjtd�|�|j d	k	r>|jjtd�d|j �ntjtd���nXWnNtj!k
r�}t"|j#�}||j$kr��n|j$|||�nXx|D]}||
�q�Wd	S(s�push data to the remote using bundle2

    The only currently supported type of data is changegroup but this will
    evolve in the future.R�sbundle2.pushbackt
allowpushbacktroletclientt	replycapsR<iNR�tbundleR�R�Rsmissing support for %ssremote: %s
s(%s)spush failed on remote(%Rtbundle20RkRLR�R�R�t
encodecapstgetrepocapsRUR>R7R6tcallableR�tnbpartsRtchunkbuffert	getchunkstcommandexecutortcallcommandRtresultRtBundleValueErrorRgRRdttransactiont
processbundlet
AbortFromPartR�Ryt
PushkeyFailedR{R|R�(R�RAtpushbacktcapsblobt
replyhandlerstpartgennametpartgenR�RCtetreplyR}ttrgetterR�R|trephand((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�?sX!	


&$
c	C@s#d|jkrdS|jjd�t|�s3dS|jjd�sKt�|jj|�|j}d}|j
dkr�|jp�|jjj
r�tj|j|dddtd|�}n!tj|j|ddd|�}|jr�dg}n	|j}|jj|||jj��|_dS(	s7Make the actual push of changeset bundle to remote repoR]NR�RR�tfastpatht
bundlecapsR�(R�RhR5R�R�RHRURiR�RdR�R,R�tfilteredrevsR	tmakechangegroupRR�R�R�RR�(R�R�R�tcgR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�us(			c
C@s�|j}t|jd�}|jjdd�rg|rg|jdkrg|jdt�rgidd6}n|s}t	||�nft
j|j||�}|\}}|jdt�r�t	||�n t	||�t	||t
j
�|jrd|jkr�dS|j}n	|j}|jjd�g|D]}|j�|kr+|^q+}x�|D]�}|jj��O}	|	jdidd6|j�d	6d
t
j
d6d
t
jd6�j�}
WdQX|
sV|jjtd
�|�qVqVWdS(s2synchronise phase information locally and remotelyRRkR�R�RNRR�R<s%dRQRRsupdating %s to public failed!
(R�R�R�RkR�R�RdROR�t_localphasemoveRtanalyzeremotephasesRURXR�R�R�RhR�R�R�RRVR�RR(R�R�R�tanatpheadsR�toutdatedR�R�R�tr((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��sB	
	
		+

 cC@s�|jr.tj|j|jj�||�nbg|D]%}||j|j�kr5|^q5}tj|}|r�|jjt	d�|�ndS(s0move <nodes> to <phase> in the local source repos8cannot lock source repo, skipping local %s phase update
N(
R�RtadvanceboundaryRUR�R�t
phasenamesRkR�R(R�RR�R�tactualmovestphasestr((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s	
2
c	C@s�d|jkrdS|j}|j}|jjd�|jr�|jjd�g}tjt	|j��}xCt	|dt
�D]/}||}|j|jd|d|��qWg|D]}|s�|^q�r�t
d�}|jj|�q�ndS(s5utility function to push obsolete markers to a remoteR�Ns'try to push obsolete markers to remote
treverseRR�s&failed to push some obsolete markers!
(R�RUR�RhR�RkR�Rt_pushkeyescapeRMRR�RRR(	R�RUR�trsltst
remotedataR<R<R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s			
#c	
C@s(|jdksd|jkr"dS|jjd�|j}|j}x�|jD]�\}}}d}|srd}n|s�d}n|j��;}|jdidd6|d	6|d
6|d6�j�}WdQX|r�|j	t
|d|�qN|jt
|d|�|jdk	rNd|_qNqNWdS(
s"Update bookmark position on remoteiRNRRR�R�RR�R<RQRRi(R�R�RhRkR�R�R�R�R�R�R�RR�Rd(	R�RkR�R�RQRRR�R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s,				t
pulloperationc	B@sneZdZdeddddddd�Zejd��Zejd��Z	ejd��Z
d�ZRS(s�A object that represent a single pull operation

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

    A new should be created at the beginning of each pull and discarded
    afterward.
    cC@s�||_||_||_g|D]}|jj|�^q"|_||_||_d|_	d|_
d|_d|_||_
d|_t�|_t|_||_|	|_|
|_dS(N(RUR�R�RRtexplicitbookmarksR�tstreamclonerequestedRdR�R�trheadstfetchtremotebookmarksR�RJR�R�tclonebundleattemptedtincludepatstexcludepatstdepth(R�RUR�R�R�RR�R�R�R�R�R((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�%s$			%											cC@sl|jdkrat|j�}t|j�}x-|jD]"}||kr7|j|�q7q7W|S|jSdS(s0heads of the set of changeset target by the pullN(R�RdRJR�R�R�R�(R�R�R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytpulledsubsetLscC@st|�S(N(R�(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
canusebundle2^scC@stj|j�S(N(RRLR�(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytremotebundle2capsbscC@s
|jj�S(N(R�R�(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytgettransactionfsN((R*R+R�RdR�R�RR�R�R�R�R�(((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s	%R�cB@s2eZdZd�Zd�Zd�Zd�ZRS(s�An object to manage the life cycle of a transaction

    It creates the transaction on demand and calls the appropriate hooks when
    closing the transaction.cC@s(||_||_||_d|_dS(N(RUtsourceRRdt_tr(R�RUR�R((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�os			cC@sm|jsfd|jtj|j�f}|jj|�|_|j|jjd<|j|jjd<n|jS(s<Return an open transaction object, constructing if necessarys%s
%sR�R(R�R�RthidepasswordRRUR�thookargs(R�ttrname((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�us	cC@s#|jdk	r|jj�ndS(sclose transaction if createdN(R�Rdtclose(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�~scC@s#|jdk	r|jj�ndS(srelease transaction if createdN(R�Rdtrelease(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s(R*R+R�R�R�R�R�(((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�js
				c	C@s6|j��$}|jdi|d6�j�SWdQXdS(NR�R�(R�R�R�(R�R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��sc@s�|j���j��fd�}�fd�}x�tr��j�}t��}t|�tj|jkrtPn|t��kr�Pnt	�fd�|j
D��r�Pn|�j�|�}|||j�|_t|j
�|j|_
q6WdS(Nc@s)�jd||�}td�|D��S(sReturns heads(h1 % h2)sheads(%ln %% %ln)cs@s|]}|j�VqdS(N(R�(R�R4((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>�s(RJ(th1th2tres(R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytheadsofdiff�sc@s)�jd||�}td�|D��S(sReturns heads((h1 + h2) - null)sheads((%ln + %ln - null))cs@s|]}|j�VqdS(N(R�(R�R4((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>�s(RJ(R�R�R�(R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytheadsofunion�sc3@s|]}�j|�VqdS(N(R�(R�R�(tunficl(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>�s(
R�R�RR�Rdt_pullbundle2RtNARROW_REQUIREMENTRAtallR�R�RJ(RUtpullopR�R�t	old_headstclstartt	new_heads((R�R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_fullpullbundle2�s"
		
c
C@s|d
kri}n|s!|rB|p-t�}|p<t�}n|j\}}tj|�tj|�t||||d|d|d|d|d|	tj|��}
|
jj	�}|rt|j
�|
jj}|rt
d�djt|��}
tj|
��qnt|d|j��|
_|j���|j���|
j��|jd	�rptj|
�nbt|
�tj|
�t|
�|
jr�t||
�nt |
�t!|
�t"|
�t#|
�Wd
QXWd
QXWd
QX|j$j%dd�rt&j'||�n|
S(
sjFetch repository data from a remote.

    This is the main function used to retrieve data from a remote repository.

    ``repo`` is the local repository to clone into.
    ``remote`` is a peer instance.
    ``heads`` is an iterable of revisions we want to pull. ``None`` (the
    default) means to pull everything from the remote.
    ``bookmarks`` is an iterable of bookmarks requesting to be pulled. By
    default, all remote bookmarks are pulled.
    ``opargs`` are additional keyword arguments to pass to ``pulloperation``
    initialization.
    ``streamclonerequested`` is a boolean indicating whether a "streaming
    clone" is requested. A "streaming clone" is essentially a raw file copy
    of revlogs from the server. This only works when the local repository is
    empty. The default value of ``None`` means to respect the server
    configuration for preferring stream clones.
    ``includepats`` and ``excludepats`` define explicit file patterns to
    include and exclude in storage, respectively. If not defined, narrow
    patterns from the repo instance are used, if available.
    ``depth`` is an integer indicating the DAG depth of history we're
    interested in. If defined, for each revision specified in ``heads``, we
    will fetch up to this many of its ancestors and data associated with them.

    Returns the ``pulloperation`` created for this pull.
    RR�R�R�R�s:required features are not supported in the destination: %ss, tpullscommand-changesetdataNR�R�((RdRJt
narrowpatsRtvalidatepatternsR�RR�R�R�RARUR�RRLRMRRgR�RR�R�R
R�RR�t_maybeapplyclonebundleRtmaybeperformlegacystreamclonet_pulldiscoveryR�R�t_pullchangesett
_pullphaset_pullbookmarkst
_pullobsoleteRkR�RR�(RUR�R�R�RR�R�R�R�R�R�t	peerlocalR�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��sL	

	





	


c@s�fd�}|S(s|decorator for function performing discovery before pull

    The function is added to the step -> function mapping and appended to the
    list of steps.  Beware that decorated function will be added in order (this
    may matter).

    You can only use this decorator for a new step, if you want to wrap a step
    from an extension, change the pulldiscovery dictionary directly.c@s-�tkst�|t�<tj��|S(N(tpulldiscoverymappingRHtpulldiscoveryorderR�(R�(R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s

((R�R�((R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt
pulldiscoverys	cC@s)x"tD]}t|}||�qWdS(sRun all discovery stepsN(R�R�(R�R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s

sb1:bookmarkscC@sW|jdk	rdS|jr/d|jkr/dSt|jd�}tj|�|_dS(s�fetch bookmark data in bundle1 case

    If not using bundle2, we have to fetch bookmarks before changeset
    discovery to reduce the chance and impact of race conditions.NR�R(R�RdR�R�R�R�RR(R�tbooks((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pullbookmarkbundle1"scC@s�tj|j|jd|jd|j�}|\}}}|jj�jj}|r�|r�t	|�}x9|D]1}||krm||kr�|j
|�q�qmqmWt	|�jt	|��r�g}q�n||_||_
||_dS(s~discovery phase for the pull

    Current handle changeset discovery only, will change handle all discovery
    at some point.R�R�N(R
R�RUR�R�R�R�R�R�RJR�tissubsetR�R�R�(R�ttmpR�R�R�R�tscommonR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_pulldiscoverychangegroup2s"		

		c	C@swit|jdd�d6}|jj}tj|dt�d}|j|d<|jp]|j|d<|r�t	|d<t|d	<|j
jd
�|j
jd�n�|j
jd
�|j|d<d|j
dd
�k}d|jjdd#�k}|r|rt|d<|j
jd�nd|jkrLd|j
krLdg|d<qLnt	}d|j
dd
�k}d|jk}|jd k	r�|j
jd�nd|j
kr�|jd kr�|r�|r�t|d<t}nd|jkr&d|j
kr&|j
jd�|jdg�jd�q&n|jjd�ro|jd krot|j�tgkro|j|d<n|r�|jjjtd��nq|js�|jjjtd��d|_nC|jd krt|j�tgkr|jjjtd��ntj|jtj�ratj |j�}	tj!|	�d k	rat|d<|j
jd�qant"||�|jj#���}
t$|�}d|d<|
j%d|�j&�}yHtj'|j|j(dd�}
d|
j)d<tj*|j|d|
�Wntj+k
rI}|jjjtd�|�t,j-td�d|j.��n/t,j/k
rw}t,j-td�|��nXWd QX|jr�tj0|
�|_nx7|
j1dD](\}}|dkr�t2||�q�q�W|ri}x'|
j1dD]}|d!||d"<q�W||_n?x<|
j1dD]-\}}|dkr&t3j4|�|_q&q&W|jd k	rst5|�nd S($sNpull data using bundle2

    For now, the only supported data are changegroup.R�R�R�RiR�R�R�RCR	RR�slegacy.exchangeR�Rsrequest-bookmarkstclonebundlestcbattemptedsstreaming all changes
sno changes found
srequesting all changes
R�R�R�t	getbundleRaR�sremote: abort: %s
spull failed on remoteRysmissing support for %sNR�R((6t
caps20to10RURkRtcanperformstreamcloneRR�R�R�R�R�RhR�R�R�ROR�Rdt
setdefaultR�R�R�R�RR�R�RR�RRRRR�R�t_pullbundle2extraprepareR�tdictR�R�tbundleoperationR�tmodesR�R�RRgRyR�tcombinechangegroupresultsRat_pullapplyphasesRRR�(R�tkwargsRkt	streamingRuthasbinaryphasetbookmarksrequestedtlegacybookmarkt
hasbinarybookR�R�targsR�R�R}R�R=Rtrecord((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�Ss�







	'	'


	
!#	cC@sdS(s>hook function so that extensions can extend the getbundle callN((R�R((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR
�R�c	C@sd|jkrdS|jjd�|jsR|jjjtd��d|_dS|j�}|j	dkr�t|j�t
gkr�|jjjtd��n0|j	dkr�|jjd�r�|j|_	n|jjd�r|jjdd	|jd
|j	p
|j�}n�|j	dkrf|jj��0}|jdi|jd6dd6�j�}WdQXnu|jjd�s�tjtd
���nK|jj��:}|jdi|jd6|j	d
6dd6�j�}WdQXtj|j||d|jj��}tj|�|_dS(s0pull changeset from unbundle into the local repoR	Nsno changes found
isrequesting all changes
tchangegroupsubsetR	R�R�R�RR�sWpartial pull cannot be done because other repository doesn't support changegroupsubset.tbases(R�RhR�RURkR�RR�R�R�RdR�R�RR�R�R�R	R�R�R�RRgRtapplybundleRR(R�ttrR�R�tbundleop((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��s<		'!


cC@s6d|jkrdSt|jd�}t||�dS(NR(R�R�R�R(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��sc
C@s�d|jkrdS|jjd�t|jdt��}|ru|rutj|j|j|�\}}|j}n|j}g}|jj	�}|j
j}|jj
j}tj}	tj}
g|D]'}||||��|	kr�|^q�}|r"|j�}tj|j||	|�ng|D]'}||||��|
kr)|^q)}|r�|j�}tj|j||
|�ndS(s/apply phase movement from observed remote stateRNR�(R�RhRJROR�RR�RUR�R�t_phasecacheR�R�R�RVRXR�R�(
R�R�R�R�t_drtdheadsR�R�RRVRXtpnR((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRs0
			44cC@sjd|jkrdS|jjd�|j}|j}tj|j|||jj�|j	d|j
�dS(s?process the remote bookmark information to update the local oneRNR(R�RhRUR�RtupdatefromremoteRkR�RR�R�(R�RUR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�(s			cC@sd|jkrdS|jjd�d}tj|jtj�r|jjjd�t	|j
d�}d|kr|j�}g}x^t|dt
�D]J}|jd�r�tj||�}tj|�\}}||7}q�q�W|r|jjj||�n|jj�qn|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 purposeR�Ns!fetching remote obsolete markers
Rtdump0R�tdump(R�RhRdRRRURRkR�R�R�R�RMRReRt	b85decodet_readmarkersRtinvalidatevolatilesets(R�Rt	remoteobsR�R<R<R/tnewmarks((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�4s&cC@s�|j}|j|jjd�p*|j��}|jt|d|jtd��}|jt|d|jtd��}|s�tjt	d�j
t|���ng|D]"}|dkr�dnd	|^q�}g|D]"}|dkr�dnd	|^q�}t|jd
g��}t|jdg��}tj
||||�\}}}	|	r}tjt	d�j
||	���ni}
|
j|�t|
d
<t|
d<||
d
<|r�||
d<n|
S(s�Apply narrow fetch access control.

    This massages the named arguments for getbundle wire protocol commands
    so requested data is filtered through access control rules.
    tREMOTE_USERs	.includessdefault.includess	.excludessdefault.excludess%{} configuration for user {} is emptyt*spath:.spath:R�R�s4The following includes are not accessible for {}: {}tnarrowt
narrow_acl(Rkt	shortusertenvironROtusernameR�t_NARROWACL_SECTIONRRgRtformatRJRtrestrictpatternsRRR(RURRkR2t
user_includest
user_excludesR;treq_includestreq_excludestinvalid_includestnew_args((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytapplynarrowaclPs:	'

//




c@s��j}�j}|j��fd�|D�thB}�fd�|D�}	|rgd�|	D�}
ntjt�}tjt�����fd�}�fd����fd��t|jd|d|	��}
t	|
�}t�}g|
D]}|j
|�^q�}t|	�|B}xm|D]e}|j|��g|j|�D]}|tkrL|^qL}|dk	r�|
|}x8|D]-}t|d	|
j||d	��|
|<q�Wnt}|dkp�|
||k}|r�|�jj�}|r�||j|d
�jj�}t|j||��}|r�t|�d	kr�||j|d	�jj�}t|j||��}q�q�t|j|��}n|rx||D]}|||�q�Wx|D]}|j|�q�W|j|j
|��q'|stg}n||krgx||D]}|||�q+WxG|D]}||j|�qIWq'x"|D]}||c||O<qnWq'Wx0|D](}x||D]}|||�q�Wq�W||�fS(sCompute the shape of a narrowed DAG.

    Args:
      repo: The repository we're transferring.
      common: The roots of the DAG range we're transferring.
              May be just [nullid], which means all ancestors of heads.
      heads: The heads of the DAG range we're transferring.
      match: The narrowmatcher that allows us to identify relevant changes.
      depth: If not None, only consider nodes to be full nodes if they are at
             most depth changesets away from one of heads.

    Returns:
      A tuple of (visitnodes, relevant_nodes, ellipsisroots) where:

        visitnodes: The list of nodes (either full or ellipsis) which
                    need to be sent to the client.
        relevant_nodes: The set of changelog nodes which change a file inside
                 the narrowspec. The client needs these as non-ellipsis nodes.
        ellipsisroots: A dict of {rev: parents} that is used in
                       narrowchangegroup to produce ellipsis nodes with the
                       correct parents.
    c@sh|]}�|��qS(((R�R�(tclrev(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<setcomp>�s	c@sh|]}�|��qS(((R�R�(R=(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<setcomp>�s	cS@si|]}d|�qS(i((R�Rx((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys
<dictcomp>�s	c@sZ�|j|�xBt�|�dkrU�|�\}}�|||�|}qWdS(s=Add a root to an ellipsis head, splitting heads with 3 roots.iN(RhRd(theadt	curchangetchildtroots(t
ellipsisrootst	splitheadt
splitroots(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytaddroot�s
c@sH�|j|��|j|��|j|��|j|�dS(N(tdifference_updateRhRRtdiscard(R>R@RA(RB(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRD�sc@s�t�|�\}}}x�||f||f||ffD]�\}}�jd||||�}x\|D]T}||kr�|||ffS|�ks�t�|�dkri|||ffSqiWq;Wtjtd�||||f��dS(Ns%sort(merge() & %d::%d & %d::%d, -rev)is;Failed to split up ellipsis node! head: %d, roots: %d %d %d(RMR�RdRRgR(R>tr1tr2tr3tnr1tnr2tmidtj(RBRU(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyRC�s.	
"R�R�iiN(R�tmanifestlogRRtcollectionstdefaultdictRJR�tfindmissingrevstreversedR�tchangelogrevisiont
parentrevsRdtminROR�tmanifesttreadRJtdiffRdRYtwalkRh(RUR�R�tknowntmatchR�R�tmflt
commonrevst	headsrevstrevdeptht
ellipsisheadsRER�tvisittrelevant_nodestmt
visitnodestrequiredRtprevtpstcurdepthR;tneededtshallow_enoughtcurmftp1mftp2mfR>R�((R=RBRURCRDs8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_computeellipsis}sl			
	"
.

.  



cC@sEdh}tjtj|d|��}|jdtj|��|S(sFreturn a set with appropriate options to use bundle20 during getbundletHG20R�sbundle2=(RR�R�RhR7tquote(RUR�tcapsR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR
�s	c@s��fd�}|S(s�decorator for function generating bundle2 part for getbundle

    The function is added to the step -> function mapping and appended to the
    list of steps.  Beware that decorated functions will be added in order
    (this may matter).

    You can only use this decorator for new steps, if you want to wrap a step
    from an extension, attack the getbundle2partsmapping dictionary directly.c@sL�tkst�|t�<�dkr8tj��ntj���|S(N(tgetbundle2partsmappingRHRdtgetbundle2partsorderR�R8(R�(R9R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�s
((R�R9R�((R9R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytgetbundle2partsgenerator
s	cC@s$|dk	r td�|D��StS(Ncs@s|]}|jd�VqdS(tHG2N(Re(R�tcap((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>s(RdRYR�(R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytbundle2requestedscK@s�tj|�}i}t|�}|s�|rU|jdt�rUttd���n|r�ttd�djt|j	�����nt
|||�}d|d<|tj||d|d|�fSd	|d<i}	xO|D]G}
|
j
d
�r�tj|
td
��}|	jtj|��q�q�Wtj|j|	�}||d<||d<x@tD]8}
t|
}||||d|d
|	tj|��qYW|j|d<||j�fS(sReturn chunks constituting a bundle's raw data.

    Could be a bundle HG10 or a bundle HG20 depending on bundlecaps
    passed.

    Returns a 2-tuple of a dict with metadata about the generated bundle
    and an iterator over raw chunks (of varying sizes).
    R�s-request for bundle10 must include changegroups#unsupported getbundle arguments: %ss, it
bundleversionRR�isbundle2=R�R�RNtprefercompressed(RtbyteskwargsRxRORRkRRLRMtkeysR�R	RmReR7R8RdRRRt
decodecapsR�RkRtRsR�RzR�(RUR�R�R�R�Rtinfot
usebundle2R�RNtbcapstblobRAtnameR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytgetbundlechunks"s8
"








RzcO@stj|||�S(N(Rtaddpartbundlestream2(RARURR((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlestream2Qsc	K@sP|jdt�sdSd}|jd�}	|	r�g|	D]!}
|
tj|�kr8|
^q8}	|	szttd���nt|	�}nt|||�}|js�dS|jdt	�rt
tt|jdg���}t
tt|jdg���}
t
j|jd	|d
|
�}nd}tj||||d|d|�}|jdd
|�}|	ru|jd|�n|jddt|j�dt	�d|jkr�|jdd�n|jdt	�rL|jdt	�rL|s�|
rL|jd�}|r!|jd	dj|�dt�n|
rL|jd
dj|
�dt�qLndS(s.add a changegroup part to the requested bundleR�NRR	sno common changegroup versionR.R�R�tincludetexcludeR�tmatcherR<R/t	nbchangess%dR�R^R_R/snarrow:specs
(RORR	RjRkRRlR�R�R�RMtfilterRJRR\trootRdRmR>RnRdRARL(RARUR�R�RNR�R�RR/RoRpR�R�R�R�RqR�tnarrowspecpart((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlechangegrouppartUsH
!	!!!$cK@su|jdt�sdSd|kr7ttd���ntj|�}tj|�}|rq|jdd|�ndS(s+add a bookmark part to the requested bundleRNs#no common bookmarks exchange methodR<(ROR�RkRRtlistbinbookmarksRMR>(RARUR�R�RNRRR<((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlebookmarkpart�sR�c
K@sm|jdd�}xT|D]L}|jd�}|jd|�|j|�j�}	tj|	�|_qWdS(s@add parts containing listkeys namespaces to the requested bundleR�R�N((ROR>RnR�titemsRt
encodekeysR<(
RARUR�R�RNRR�R�R�R|((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlelistkeysparts�s
c
K@s�|jdt�r�|dkr-|j�}ng|jd|�D]}|j�^q@}|jj|�}	t|	�}	t	j
||	�ndS(s8add an obsolescence markers part to the requested bundleR�s::%lnN(ROR�RdR�RJR�RRRMRR�(
RARUR�R�RNR�RR�tsubsetR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundleobsmarkerpart�s+cK@s�|jdt�r�d|jd�kr<ttd���n|dkrW|j�}ntjt�}|j	�r�||t
j<n
|jj
}|jj}	|jj}
x.|D]&}||||
|��j|�q�Wt|j��}|r
t|�t
jks
t�n|jt
jt��}
|
r�|jt
jt��}d}|j||
|�}x+|D] }|t
jj|	|��qeWng}x(t
jD]}|jt||��q�Wt
j|�}|jdd|�ndS(s,add phase heads part to the requested bundleRR�s no common phases exchange methods"heads(only(%ln, %ln) and public())sphase-headsR<N(ROR�RkRRdR�RPRQRJR�RRVR R�R�R�RRhR�R|RlRXRHR�RUR�RMRMR>(RARUR�R�RNR�RtheadsbyphaseR�R�RRxt
seenphasest
draftheadsRWR�t
extraheadsR�tphasemappingRz((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlephasespart�s8
$
!thgtagsfnodesc	K@sK|jdt�od|ks"dSt|||�}tj|||�dS(s�Transfer the .hgtags filenodes mapping.

    Only values for heads in this bundle will be transferred.

    The part data consists of pairs of 20 byte changeset node and .hgtags
    filenodes raw values.
    R�R�N(RORR�Rtaddparttagsfnodescache(	RARUR�R�RNR�R�RR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundletagsfnodes�sscache:rev-branch-cachec	K@sp|jdt�sCd|ksC|jdt�sC|jjt�rGdSt|||�}tj|||�dS(s�Transfer the rev-branch-cache mapping

    The payload is a series of data related to each branch

    1) branch name length
    2) number of open heads
    3) number of closed heads
    4) open heads nodes
    5) closed heads nodes
    R�srev-branch-cacheR.N(	RORR�Rkthas_sectionR3R�Rtaddpartrevbranchcache(	RARUR�R�RNR�R�RR�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_getbundlerevbranchcache�scC@sw|j�}tjdjt|���j�}|dgkpZ||kpZ|d|gksstjd|��ndS(sVcheck if the heads of a repo have been modified

    Used by peer for unbundling.
    R�R�thasheds.repository changed while %s - please try againN(R�thashlibtsha1RLRMtdigestRt	PushRaced(RUttheir_headstcontextR�t
heads_hash((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytcheck_heads		s$	c@s{d�dddg�d}�jjdd�}�jd�sN�jd�rWt}nz�t�|d�t|tj�s�dj	�t
j��g�}�j��G�j
|��1}tj�||���}	tj|	��WdQXWdQXn?d�y�����fd	�}
�jjdd
�s2|
�ntj�|
d|dd
�}	ztj�|d|	�}	Wd|	j�|r��dk	r��jjdtdt��fd�}nX�ddk	r��dj�nWnVtk
r0}t|_|r*�dk	r*�j��|_�fd�}n�nXWdtj�d�d�d�|dk	rv|�jj��nX�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.iR�sbundle2-output-capturesremote:http:s
remote:https:suploading changess
Nc@s{�dss�j��d<�j��d<�j���d<��djd<��djd<d�djd<n�dS(NiiiR�RR_R(R�R
R�R�((t	lockandtrRUR�R(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�6	s
tbundle2lazylockingt
captureoutputR�R�R�Rtsubprocc@s�jdd|dt�dS(NtoutputR<R�(R>R�(R�(R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt	recordoutN	sic@s,tjdd|dt�}�j|�dS(NR�R<R�(Rt
bundlepartR�R�(R�R�(tparts(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�V	s	i(RdRkR�ReRR�R{RR}RLRR�R
R�RRRR�R�t
pushbufferR�t
BaseExceptiontduringunbundle2t
salvageoutputt_bundle2salvagedoutputtlockmodR�t	popbuffer(RUR�R�R�RR�R�ttxnnameRR�R�R}((R�R�R�RUR�Rs8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�	sP	

			cC@s�|j}|j}|jjdd�s+dSt|�r;dS|jrHdS|jd�s[dS|j��}|jdi�j	�}WdQXt
|_t||�}|s�|jj
td��dSt||d|j�}|s|jjtd��|jjtd��dSt|j|�}|dd	}|jjtd
�|�t|j||�rv|jjtd��nO|jjdd�r�|jjtd
��n!tjtd�dtd���dS(s0Apply a clone bundle from a remote, if possible.RkRNsDno clone bundles available on remote; falling back to regular clone
R�sOno compatible clone bundles available on server; falling back to regular clone
s5(you may want to report this to the server operator)
itURLsapplying clone bundle from %s
sfinished applying clone bundle
tclonebundlefallbacksfalling back to normal clone
serror applying bundleRys}if this error persists, consider contacting the server operator or disable clone bundles via "--config ui.clonebundles=false"(RUR�RkR�RdR�R�R�R�R�RR�tparseclonebundlesmanifesttnoteRtfilterclonebundleentriesR�RtsortclonebundleentriesR�ttrypullbundlefromurlRRg(R�RUR�R�R�tentriesR((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�a	s@				c
C@sg}x|j�D]�}|j�}|s1qni|dd6}x�|dD]�}|jdd�\}}tj|�}tj|�}|||<|dkrMy-t||�}	|	j|d<|	j|d<Wq�tjk
r�q�tj	k
r�q�XqMqMW|j
|�qW|S(s�Parses the raw text of a clone bundles manifest.

    Returns a list of dicts. The dicts have a ``URL`` key corresponding
    to the URL and other keys are the attributes for the entry.
    iR�iR4t
BUNDLESPECtCOMPRESSIONtVERSION(t
splitlinesR5R7R8R[R-R/RR6RFR�(
RUR9RdtlinetfieldstattrstrawattrR<R=R)((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��	s,

cC@sZ|jdkr"|jdkr"tS|jdkrV|jdkrV|jjd�rVtStS(NR^R RR%(R.R0RR2ROR�(R)((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pytisstreamclonespec�	scC@sZg}xM|D]E}|jd�}|r�yJt||dt�}|rqt|�rq|jjd|d�w
nWqtjk
r�}|jjtj	|�d�q
qtj
k
r�}|jjd|dtj	|�f�q
qXn$|r|jjd|d�q
nd|krEtjrE|jjd	|d�q
n|j
|�q
W|S(
suRemove incompatible clone bundle manifest entries.

    Accepts a list of entries parsed with ``parseclonebundlesmanifest``
    and returns a new list consisting of only the entries that this client
    should be able to apply.

    There is no guarantee we'll be able to apply all returned entries because
    the metadata we use to filter on may be missing or wrong.
    R�RWs(filtering %s because not a stream clone
R�s
s1filtering %s because unsupported bundle spec: %s
s?filtering %s because cannot determine if a stream clone bundle
t
REQUIRESNIs'filtering %s because SNI not supported
(ROR[RR�RkR�RR6RR�RFRthassniR�(RUR�R�t
newentriestentryRVR)R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR��	s6



tclonebundleentrycB@sVeZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
RS(	s�Represents an item in a clone bundles manifest.

    This rich class is needed to support sorting since sorted() in Python 3
    doesn't support ``cmp`` and our comparison is complex enough that ``key=``
    won't work.
    cC@s||_||_dS(N(R=tprefers(R�R=R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�
s	cC@s�x�|jD]�\}}|jj|�}|jj|�}|dk	rb|dkrb||krbdS|dk	r�|dkr�||kr�dS|dks
|dkr�q
n||kr�q
n||kr�dS||kr
dSq
q
WdS(Ni����ii(R�R=RORd(R�tothertprefkeyt	prefvaluetavaluetbvalue((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt_cmp
s"$$cC@s|j|�dkS(Ni(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__lt__2
scC@s|j|�dkS(Ni(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__gt__5
scC@s|j|�dkS(Ni(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__eq__8
scC@s|j|�dkS(Ni(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__le__;
scC@s|j|�dkS(Ni(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__ge__>
scC@s|j|�dkS(Ni(R�(R�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt__ne__A
s(R*R+R�R�R�R�R�R�R�R�R�(((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�
s		"					c@s}|jdd���s"t|�Sg�D]}|jdd�^q)�t�fd�|D��}g|D]}|j^qjS(NRktclonebundleprefersR4ic3@s|]}t|��VqdS(N(R�(R�Rp(R�(s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pys	<genexpr>K
s(R�R�R5RMR=(RkR�R;R�ti((R�s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�D
s
%cC@s|j���|jd���}ygtj||�}t||d�}t|tj�rh|j|�nt	j
|||d|�tSWnntj
k
r�}|jtd�tj|��n9tjk
r�}|jtd�tj|j��nXtSWdQXWdQXdS(s%Attempt to apply a bundle from a URL.t	bundleurlRCRsHTTP error fetching bundle: %s
serror fetching bundle: %s
N(R
R�turlmodtopenRrR{RRjtapplyRRRturlerrt	httperrorRRRR�turlerrortreasonR�(RkRURRRlR�R�((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyR�N
s 
(((�t
__future__RRPR�ti18nRR�RRRRt
thirdpartyRR�RRRR	R
RRR
R�RRRRRRRRRRRR�RtutilsRR�R7R3RGRR�RNRQRIR9tobjectR)R[RdRrR�R�R�R�R�R�R�R�R�R�R�R�RRRR5R7R6R:RIRKRTR\RrRwRsRtR�R�R�R�R�R�R�R�R�RVR�R�R�R�t
transactionalR�R�R�R�R�R�RR�RRR�R
R�R�RR�R�R<RoR
RtRsRuRxR�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�(((s8/usr/lib64/python2.7/site-packages/mercurial/exchange.pyt<module>s "|		

	�	<		w		C		5	,	$		(			#			-	6	(	<		N		&	Q		!	z		.		#			-~		/	0				
	-				J	C	#	
0@