\x89\x50\x4E\x47\x0D\x0A\x1A\x0A PNG  \x89\x50\x4E\x47\x0D\x0A\x1A\x0A  13\c@@sddlmZddlZddlmZddlmZddlmZm Z mZm Z m Z m Z e j Z e jZdZdZed Zed Zd Zedddd Zd ZdZdZdddZdZdZedZdZedZdZ ej!de"de"de#fdYZ$ej!de"de"de#fdYZ%dZ&dZ'dZ(ddd Z)d%d!Z*d"Z+ddd#Z,d$Z-dS(&i(tabsolute_importNi(tnullrev(tattr(terrortmdifftnodetpatchtpycompattsmartsetIcc@s|dkrd}n|dkr*t}n|dkr:dS|dkrXtjdn|rgd}nd }|j|t|}g}t|d}|dk rtj|||dfnd} x|rtj |\} } || } | |kr:t|d}|dk r:tj|||dfq:n| | k} | rf| |krf| } | Vn| d} | r| |krxC|| D]2}|t j krtj|||| fqqWqqWdS(s(Walk DAG using 'pfunc' from the given 'revs' nodes 'pfunc(rev)' should return the parent/child revisions of the given 'rev' if 'reverse' is True/False respectively. Scan ends at the stopdepth (exlusive) if specified. Revisions found earlier than the startdepth are omitted. iNsnegative stopdepthii( tNonet _maxlogdepthRtProgrammingErrortsorttitertnexttheapqtheappushtheappopRR(tpfunctrevst startdeptht stopdepthtreversetheapsigntirevst pendingheaptinputrevtlastrevtcurrevtcurdepthtfoundnewtpdepthtprev((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt _walkrevtree!sD                 c#@sigfd}|r-d}nd}x|D]}||q:Wxjrtj }j|}||fVx3|D]+}x"|j| D]}||qWqWqQWdS(sLike filectx.ancestors(), but can walk from multiple files/revisions, and includes the given fctxs themselves Yields (rev, {fctx, ...}) pairs in descending order. c@sN|j}|kr9t|zstiterasc(R1t generatorsettFalse(R+R,tgen((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytfilerevancestorstsc@s|rdndjfddkrH}n*fd}|jfd}t||||dtS(Nic@sIyj| SWn-tjk rDd|j DSXdS(Ncs@s|]}|jVqdS(N(R"(R2tpctx((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pys s(t parentrevsRtWdirUnsupportedR*(R"(tclR-trepo(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt plainpfuncsc@s)g|D]}|s |^q S(N((R"tr(tcutfuncR>(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytsc@s | S(N((R"(R@(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyRAsR(R t changelogtfilterR!tTrue(R=RR,RRR@R((R<R-R@R>R=s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_genrevancestors}s    cC@s+t||||||}t|dtS(sLike revlog.ancestors(), but supports additional options, includes the given revs themselves, and returns a smartset Scan ends at the stopdepth (exlusive) if specified. Revisions found earlier than the startdepth are omitted. If cutfunc is provided, it will be used to cut the traversal of the DAG. When cutfunc(X) returns True, the DAG traversal stops - revision X and X's ancestors in the traversal path will be skipped. This could be an optimization sometimes. Note: if Y is an ancestor of X, cutfunc(X) returning True does not necessarily mean Y will also be cut. Usually cutfunc(Y) also wants to return True in this case. For example, D # revancestors(repo, D, cutfunc=lambda rev: rev == B) |\ # will include "A", because the path D -> C -> A was not cut. B C # If "B" gets cut, "A" might want to be cut too. |/ A R4(RER5R6(R=RR,RRR@R7((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt revancestorss c c@s|rd}nd}|j}|j}tj}||kr]|Vx|D] }|VqKWnt|}xz|j|D]i}||kr|VqynxI|j|| D]4} | |kr| |kr|j||VPqqWqyWdS(Ni( R RBtminRRR#RR:R$( R=RR,R-R<tfirstRtitseentx((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_genrevdescendantss(          c C@s|j}tj}gtj|t|D] }g^q+}x|j|dD]v}|j|\}} ||kr|||j|n| rQ| |krQ| |krQ|| |j|qQqQW|S(s6Build map of 'rev -> child revs', offset from startrevi( RBRRRtxrangetlenRR:tappend( R=tstartrevR,R<Rt_revtdescmapRtp1revtp2rev((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_builddescendantsmaps  + c@sI|jt||fd}t||||dtS(Nc@s |S(N((R"(RRRP(s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyRsR(RGRUR!R6(R=RR,RRR((RRRPs5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_genrevdescendantsofdepths cC@sU|dkr-|dkr-t|||}nt|||||}t|dtS(sLike revlog.descendants() but supports additional options, includes the given revs themselves, and returns a smartset Scan ends at the stopdepth (exlusive) if specified. Revisions found earlier than the startdepth are omitted. R4N(R RLRVR5RD(R=RR,RRR7((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytrevdescendantss   cc@st|}|tkr5x|D] }|Vq"WdSt|}x`|d|dD]K}xB||D]4}|tkrh||krh|j||VPqhqhWqUWdS(skGenerate revision number descendants in revision order. Yields revision numbers starting with a child of some rev in ``revs``. Results are ordered by revision number and are therefore topological. Each revision is not considered a descendant of itself. ``revsfn`` is a callable that with no argument iterates over all revision numbers and with a ``start`` argument iterates over revision numbers beginning with that value. ``parentrevsfn`` is a callable that receives a revision number and returns an iterable of parent revision numbers, whose values may include nullrev. Ntstarti(RGRR#R$(Rtrevsfnt parentrevsfnRHR"RJR ((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pytdescendantrevss     cC@s?|s gS|jj}t|}t|}t}i}|j} |j} |j} x|r| } | |kr| | |sq[qn|| } | || and ::)) If includepath is True, return (::).( RBR:R#tlistR$ROR)tbasesettsorted(R=tminroottrootstheadst includepathR:R&t reachableRJtreachedtdovisitt nextvisitR"R*R0((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt_reachablerootspures<                cC@s|s tS|j}t|}t|}y|jj||||}Wn)tk r{t|||||}nXt|}|j|S(s_return (heads(:: and ::)) If includepath is True, return (::).(R]RGR\RBtreachablerootstAttributeErrorRgR (R=R`RaRbR_R((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyRh,s      cC@sYtj|j|j|}tj||\}}td|D}||fS(sReturn `(diffinrange, linerange1)` where `diffinrange` is True if diff from fctx2 to fctx1 has changes in linerange2 and `linerange1` is the new line range for fctx1. cs@s!|]\}}|dkVqdS(t!N((R2t_tstype((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pys Ds(Rt allblockstdatat blocksinrangetany(tfctx1tfctx2t linerange2tdiffoptstblockstfilteredblockst linerange1t diffinrange((s5/usr/lib64/python2.7/site-packages/mercurial/dagop.pyt _changesrange=s!c c@sKtj|jj}|j}i|||ff|j|jf6}x|rF|jt|\}}|j }|r|d }n|s||fVqOnt } x|D]x} t | |||\} } | p| } | d| dkrqn|j | _ | | f|| j| jfsF .   4      &  ! '   C> $