\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlmZddlmZmZmZddl m Z m Z m Z m Z mZmZmZmZdeddZdefd YZdeded Zd Zed Zd ZdZdZdZdS(i(tabsolute_importNi(t_(thextnullidtshort(t bookmarkst branchmapterrortphasestscmutilt setdiscoveryt treediscoverytutilc @s|jds%tj||||S|rc|jjtfd|Drc|t|fSntj|j ||d| d|}|\}}}t |||pt |fS(sReturn a tuple (common, anyincoming, heads) used to identify the common subset of nodes between repo and remote. "common" is a list of (at least) the heads of the common subset. "anyincoming" is testable as a boolean indicating if any nodes are missing locally. If remote does not support getbundle, this actually is a list of roots of the nodes that would be incoming, to be supplied to changegroupsubset. No code except for pull should be relying on this fact any longer. "heads" is either the supplied heads, or else the remote's heads. "ancestorsof" if not None, restrict the discovery to a subset defined by these nodes. Changeset outside of this set won't be considered (and won't appears in "common") If you pass heads and they are all known locally, the response lists just these heads in "common" and in "heads". Please use findcommonoutgoing to compute the set of outgoing nodes to give extensions a good hook into outgoing. t getbundlec3@s|]}|VqdS(N((t.0th(t knownnode(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys 9stabortwhenunrelatedt ancestorsof( tcapableR tfindcommonincomingt changelogthasnodetalltFalseR tfindcommonheadstuitlist( trepotremotetheadstforceRtrestcommontanyinctsrvheads((Rs9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyRs  toutgoingcB@sMeZdZddddZdZejdZejdZ RS(s Represents the set of nodes present in a local repo but not in a (possibly) remote one. Members: missing is a list of all nodes present in local but not in remote. common is a list of all nodes shared between the two repos. excluded is the list of missing changeset that shouldn't be sent remotely. missingheads is the list of heads of missing. commonheads is the list of heads of common. The sets are computed on demand from the heads, unless provided upfront by discovery.c C@s|j}|dkr$|j}n|rg}xC|D];}|jg|j|D]}|tkrS|^qSq7W|j||\} } } t| } | }g|D]}|| kr|^q}n|stg}n||_||_ ||_ d|_ d|_ g|_ dS(N(RtNoneRtextendtparentsRt nodesbetweentsett commonheadst missingheadst_revlogt_commont_missingtexcluded( tselfRR*R+t missingrootstclt discbasestntptcsetstrootsRtincluded((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyt__init__Qs&   9 (      cC@s1|jj|j|j}|\|_|_dS(N(R,tfindcommonmissingR*R+R-R.(R0tsets((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyt_computecommonmissingls cC@s#|jdkr|jn|jS(N(R-R%R<(R0((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyR!qs cC@s#|jdkr|jn|jS(N(R.R%R<(R0((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pytmissingws N( t__name__t __module__t__doc__R%R9R<R t propertycacheR!R=(((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyR$Bs    c@sHt|dd}|dkr<t||d|d|}n|\|_}}|jjtjpg|j} | s|p|j |_ n+|dkr|j dj |_ g|j dD]} | j ^q|_n|jj|j|} | \|_} g|_} g|_}xV| D]N}||} | jtjksS| jrc|j|q"| j|q"Wt| t| kr|}ntj|||}||_ |rD|j|jt fd|jD}t j|||_t |j}g|j D]}||kr |^q |_ n|S(sOReturn an outgoing instance to identify the nodes present in repo but not in other. If onlyheads is given, only nodes ancestral to nodes in onlyheads (inclusive) are included. If you already know the local repo's heads, passing them in onlyheads is faster than letting them be recomputed here. If commoninc is given, it must be the result of a prior call to findcommonincoming(repo, other, force) to avoid recomputing it here. If portable is given, compute more conservative common and missingheads, to make bundles created from the instance more portable.RRtservedssecret() or extinct()c3@s|]}j|VqdS(N(trev(RR4(R2(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sN(R$R%RR*t _phasecachet phaserootsRtsecrettobsstoreRR+tfilteredR)tnodeR/RR:R-R.tphasetextincttappendtlentnewheadsR<t ancestors(Rtothert onlyheadsRt commoninctportabletogt_anyt_hdst mayexcludetctxR;t allmissingR=R/RIR+t missingrevsR*R((R2s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pytfindcommonoutgoing}s@   .    !    .c@sh|jj|j}|j}j}i}tfd|jD}|j}|jdij }WdQX|t|}|j |t} x|j D]\} } | j | g} g} |j }x7| D]/}||r| j|q| j|qW| t| | f|| sRNc3@s|]}|VqdS(N((RR4(R(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys scs@s5|]+\}}|ddk r||dfVqdS(iiN(R%(RR\R((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys s cs@s|]}|jVqdS(N(RC(RRX((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sic3@s|]}|VqdS(N((RR(ttorev(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sc3@s|]}|VqdS(N((RR(R](s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys st inclusivei(Rt unfilteredRR$RR)R=tcommandexecutort callcommandtresulttdifference_updatet iteritemstaddRRLRR\R%Rt branchcachetupdatetsortRGRCR+R*ROtTruetsortedt_postprocessobsolete(tpushopRR$R2theadssumtbranchestet remotemapt newbranchestremotebranchesR\RtknowntunsyncedRRt missingctxttouchedbranchesRXtnewmapRNtitemstlt futureheadstallfuturecommont remoteheadst unsyncedheadst placeholderRb((RR]s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyt _headssummarysf                     #c@s|jjtfd|D}|jd||j}td|D}|rhdg}ng}i|||gfd6S(s;Compute branchmapsummary for repo without branchmap supportc3@s!|]}|r|VqdS(N((RR(R(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys ssheads(%ln + %ln)cs@s|]}|jVqdS(N(RI(Rtc((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sN(RRRjR)R=R%(RR|R$tinctoldheadstrRNRt((Rs9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyt_oldheadssummary s  c C@s9|jj}|j}|j}|j&}|jdidd6j}WdQXt}g|jj ddD]}|j |^qt}x|D]} |j | } | r| |kr|j | || } } t j|| | r1|j| jq1q| |kr| |kr|j|| qqW|S(NtlistkeysRt namespacetpushing(RR_Rt _bookmarksR`RaRbR)Rt configlistt expandnametgett changectxRt validdestReRI( RlRRtlocalbookmarksRotremotebookmarkstbookmarkedheadstbt newbookmarkstbmtrnodetlctxtrctx((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyt _nowarnheads s$    . cC@s&|jj}|j}|j}|j}|j}t|j}|tgkrUdS|j drst |}nt ||||}||_ g|j D]"\}} | ddkr|^q} | r| rdjt| } tjtd| dtdnt|} d} xt|j D]\}} | \}}}}|dkrkt}n t|}|j|d}t|}|j||rAd|krd} ntj||} | dkr|jjtdqA|dkr|jjtd | qA|jjtd || fn|dkrt|d krt|}| dkrtd |} td }qqn/t|t|krt|| |}n|r5| dkr|dkr tdt|d|f} nc||djrUtdt|d||djdf} ntdt|d} |rtd}qtd }n|dkr|jjtdn|jjtd|x+|D] }|jjdt|qWq5q5W| r"tj| d|ndS(skCheck that a push won't add any outgoing head raise Abort error and display ui message as needed. NRis, s%push creates new remote branches: %s!thints8use 'hg push --new-branch' to create new remote branchess,remote has heads that are not known locally s0remote has heads that are not known locally: %s s?remote has heads on branch '%s' that are not known locally: %s is0push creates new branch '%s' with multiple headss?merge or see 'hg help push' for details about pushing new headstdefaults/push creates new remote head %s on branch '%s'!s3push creates new remote head %s with bookmark '%s'!s push creates new remote head %s!sHpull and merge or see 'hg help push' for details about pushing new headssnew remote heads: s!new remote heads on branch '%s': s %s (RN( RR_RR$R|t newbranchtbooltincomingRRRRt pushbranchmapRdR%tjoinRjRtAbortRRR)RgR t nodesummariesRtstatusRMRRRtnote(RlRRR$R|RRRmR\RRqt branchnamest nowarnheadsterrormsgRNR}tdiscardedheadstoldhstdhstnewhsRR((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyt checkheads=s                          ,   %c@s^|j}|jjj}jjjtjjj fdfd}t j t j |j j}t}t}t} t} xo|D]g} | kr| j| q|j| d k rd} |jj| t| n| j| qWt| dkrO| t|BtfSx| rI| j} | ks| r|j| qRnjd| | |}g|D]}||^q}tfd|Ds)tfd|Ds)tfd|Dr9|j| qR|j| qRW|| O}||fS( spost process the list of new heads with obsolescence information Exists as a sub-function to contain the complexity and allow extensions to experiment with smarter logic. Returns (newheads, discarded_heads) tuple c@s|kS(N((R(tgetphasetpublictunfi(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pytsc@s|kS(N((R4(t futurecommonR](s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyRss=checkheads: remote head unknown locally has local marker: %s isonly(%n, (%ln+%ln))c3@s|]}|VqdS(N((RR(tispublic(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sc3@s!|]}|kVqdS(N((RR4(RR](s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sc3@s|]}| VqdS(N((RR4(t hasoutmarker(s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pys sN(RR_RRItnodemapRRRRDRJt functoolstpartialtpushingmarkerforRGt successorsR)ReR%RtdebugRRMtpoptrevstany(RlRtcandidate_newhsRttonodetispushedtsuccessorsmarkersRt discardedtlocalcandidatet unknownheadsRtmsgtnht branchrevsRt branchnodes((RRRRRR]Rs9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyRksL              $   c C@s|j}|g}t|}x|r|j}||rCtS|j|d}xk|D]c}|d} | s|dpd} nx7| D]/} | |kr|j| |j| qqWq\Wq!WtS(strue if some markers are to be pushed for node We cannot just look in to the pushed obsmarkers from the pushop because discovery might have filtered relevant markers. In addition listing all markers relevant to all changesets in the pushed set would be too expensive (O(len(repo))) (note: There are cache opportunity in this function. but it would requires a two dimensional stack.) ii(((RR)RRiRReRLR( RGRRIRtstacktseentcurrenttmarkerstmtnextsR4((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyRs"           (t __future__RRti18nRRIRRRtRRRRR R R R R%RRtobjectR$R[RRRRRkR(((s9/usr/lib64/python2.7/site-packages/mercurial/discovery.pyts : $;< P   p L