Qc@sddlZddlZddlZddlZddlZddlZddlZddlZddlZ ddl m Z ddl Z ddl ZddlZdZdZdZidddfd 6d ddfd6d dddfd6dddfd6ddddfd6ddddfd6ddddfd!6d"dfd#6d"dfd$6dddfd%6dddfd&6d'ddfd(6d'ddfd)6d'ddfd*6d+ddfd-6dd 6d.ddfd/6d.ddfd06dd16Zed%d(d#gZd2Zd3Zd4Zd5Zd6Zd7Zd8Zd9Zd:Zd;Z d<Z!d=Z"d>Z#d?Z$d@Z%dAZ&dBZ'e(dCZ)dDZ*dEZ+dFZ,dGZ-dHZ.dIZ/dJZ0dKZ1dLZ2dMZ3dNZ4dOZ5dPZ6dQZ7dRZ8dSZ9dTZ:dUZ;e(dVZ<dWZ=dXZ>dYZ?dZZ@d[ZAd\ZBd]ZCd^ZDd_ZEe(d`ZFdaZGdbZHdcZIddZJdeZKdfZLdgZMdhZNdiZOdjZPdkZQdlZRdmZSdnZTdoZUdpZVdqZWdrZXdsZ dtZYduZZdvZ[dwZ\dxZ]dyZ^dzZ_d{Z`d|Zad}Zbd~ZcdZddZedZfdZgdZhdZidZjdZkdZldZmdZndZoiAe&d6eId6e'd 6e*d6e+d6e-d6e.d6e/d6e0d6e1d6eUd6e2d6e3d6e6d6e7d6e8d6e9d6e:d6e;d6e=d6e>d6e?d6e@d6eAd6eBd6eCd6eLd6eDd6eEd6eGd6eHd6eJd6eMd6eNd6eOd6eXd6ePd6eRd6eQd6eKd6eSd6eTd6eVd6eWd6e d6eYd6eZd6e[d6e\d6e]d6e_d6e`d6ead6ebd6ecd6eed6efd6ehd6egd6edd6ekd6eld6end6emd6eod6Zpi ed6e d6ed06ed/6e!d%6e"d(6e#d#6e$d,6e%d 6e,d 6e^d6e[d6ZqdZrd dfZsdZtddZudevfdYZwdZxdZydZzdZ{ejeej|Z|dZdZ}dZ~epjZdS(iN(t_ccs|r dpd}|j}tj|}ttjg}x\|rxO|j|j| D]4}||kr_|j ||j ||Vq_q_Wq?WdS(s2Like revlog.ancestors(), but supports followfirst.iN( tNonet changelogtutiltdequetsettnodetnullrevt parentrevstpoplefttappendtadd(trepotrevst followfirsttcuttcltvisittseentparent((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _revancestorss      c cs|r dpd}|j}t|}tj}||krVx|D] }|VqCWdSt|}xg|j|dD]R}xI|j|| D]4} | |kr| |kr|j||VPqqWqvWdS(s3Like revlog.descendants() but supports followfirst.iN( RRtminRRRR RR ( R R RRRtfirstRtiRtx((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_revdescendantss        c Cs$|s gS|jj}|}t}i}t|}t|}x|r|j}||kru|j|n||} | ||>> list(tokenize("@::")) [('symbol', '@', 0), ('::', None, 1), ('end', None, 3)] iR4is::it.s..s ():,-|&+!~^s"'trsr'sr"cSs|S(N((R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytscSs |jdS(Ns string-escape(tdecode(R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRCss\R?sunterminated strings._@is._/@R>s syntax errorR@N(sr'sr"( tlentisspaceRterrort ParseErrorRtisalnumtordtkeywords(tprogramtpostltcRDtstdtsym((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyttokenizeksf   # #            *  *     cCsA|r.|ddks&|ddkr.|dStj|dS(NiR?R>i(RGRH(Rterr((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt getstrings&cCs:|s gS|ddkr3t|d|dgS|gS(NiR<ii(tgetlist(R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRVs cCsRt|}t||ks<|dkrNt||krNtj|n|S(Ni(RVRERGRH(RRtmaxRTRN((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytgetargss 0cCs:|stjtdnt|d|||dS(Nsmissing argumentii(RGRHRtmethods(R tsubsetR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytgetsetscCsa||j}xJdD]B}||kry|||jSWqYtjk rUqYXqqWdS(Ntsourcettransplant_sourcet rebase_source(ssourceR]R^(textraR RGtRepoLookupErrorR(R RBR_tlabel((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _getrevsources   cCsj||j}|dkr;t|t|kr;dgSt|t|ks_||krf|gSgS(Ni(R RE(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt stringsets $$cCs8|tkr(tjtd|nt|||S(Nscan't use %s here(tsymbolsRGRHRRc(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt symbolsets c Cs|j}t|||}t|||}| s;| r?gS|d|d}}||krvt||d}nt||dd}t|}g|D]}||kr|^qS(Niii(RR[R2R( R RZRtyRtmtnRBRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytrangesets   cCset|}t|t|||t|||}t|}g|D]}||krI|^qIS(N(R<R"R[R(R RZRRfRBtxsRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR/s * cCst|t||||S(N(R[(R RZRRf((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytandsetscCsWt|||}t|}t|g|D]}||kr+|^q+|}||S(N(R[R(R RZRRftxlRPRBtyl((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytorsets 1cCs;tt|||}g|D]}||kr|^qS(N(RR[(R RZRRPRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytnotsetscCstjtddS(Ns can't use a list in this context(RGRHR(R RZtatb((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytlistsetscCsY|ddkr8|dtkr8t|d|||Stjtd|ddS(NiR>isnot a function: %s(RdRGRHR(R RZRpRq((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR%s cCs(t|td}t|||dS(sG``adds(pattern)`` Changesets that add a file matching pattern. sadds requires a patterni(RURt checkstatus(R RZRtpat((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytadds sc st|}td}jj}jj}jj}xhfd|DD]M}xD|D]<} |dkr| }qi|||||| }qiWq\W|dk r||kr|gSgS(s``ancestor(*changeset)`` Greatest common ancestor of the changesets. Accepts 0 or more changesets. Will return empty list when passed no args. Greatest common ancestor of a single changeset is that changeset. c3s!|]}t|VqdS(N(R[(t.0R(R trl(s4/sys/lib/python2.7/site-packages/mercurial/revset.pys &sN(RVR<RRR R'R( R RZRRNtancR R'RR RB((R Rws4/sys/lib/python2.7/site-packages/mercurial/revset.pyR's         )cCsgt|t||}|s"gStt|||t|B}g|D]}||krK|^qKS(N(R[R<RR(R RZRRtargsRPRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _ancestors1s "cCst|||S(sP``ancestors(set)`` Changesets that are ancestors of a changeset in set. (Rz(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt ancestors8scCst|||dtS(NR(RztTrue(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_firstancestors>scCsyt|d}Wn,ttfk rBtjtdnXt}|j}xQt|||D]=}x't |D]}|j |d}q{W|j |qhWg|D]}||kr|^qS(sg``set~n`` Changesets that are the Nth ancestor (first parents only) of a changeset in set. is~ expects a numberi( tintt TypeErrort ValueErrorRGRHRRRR[R2RR (R RZRRhtpsRRBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt ancestorspecCs  cCsitjt|td}t|\}}}g|D]+}|tj||jr:|^q:S(s7``author(string)`` Alias for ``user(string)``. sauthor requires a string(tencodingtlowerRURt_substringmatchertuser(R RZRRhtkindtpatterntmatcherRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytauthorTscCsVt|tdj}ttj||}g|D]}||kr:|^q:S(s ``bisect(string)`` Changesets marked in the specified bisect status: - ``good``, ``bad``, ``skip``: csets explicitly marked as good/bad/skip - ``goods``, ``bads`` : csets topologically good/bad - ``range`` : csets taking part in the bisection - ``pruned`` : csets that are goods, bads or skipped - ``untested`` : csets whose fate is yet unknown - ``ignored`` : csets ignored due to DAG topology - ``current`` : the cset currently being bisected sbisect requires a string(RURRRthbisecttget(R RZRtstatuststateRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbisect]s cCst|||S(N(R(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbisectedpscCst|ddtd}|rt|dtd}t|\}}}|dkr|jj|d}|stjtd|n||j }g|D]} | |kr| ^qSt } x9|jj D](\} }|| r| j |qqW| s,tjtd|nt } x%| D]}| j ||j q<Wg|D]} | | krd| ^qdSnt g|jj D]} || j ^q} g|D]} | | kr| ^qS( s``bookmark([name])`` The named bookmark or all bookmarks. If `name` starts with `re:`, the remainder of the name is treated as a regular expression. To match a bookmark that actually starts with `re:`, use the prefix `literal:`. iis"bookmark takes one or no argumentss)the argument to bookmark must be a stringtliteralsbookmark '%s' does not exists"no bookmarks exist that match '%s'N(RXRRUt_stringmatchert _bookmarksRRRtAbortR Rt iteritemsR tvalues(R RZRRytbmRRRtbmrevRBt matchrevstnametbmrevstbms((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbookmarkss2   #     &,c CsHyt|d}Wntjk r)nXt|\}}}|dkr||jkrg|D]"}|||jrd|^qdSn-g|D]"}|||jr|^qSt|t||}t}x%|D]}|j ||jqWt|}g|D].}||ks>||j|kr|^qS(s4``branch(string or set)`` All changesets belonging to the given branch or the branches of the given changesets. If `string` starts with `re:`, the remainder of the name is treated as a regular expression. To match a branch that actually starts with `re:`, use the prefix `literal:`. tR( RURGRHRt branchmaptbranchR[R<RR ( R RZRRqRRRRBRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs  0-   cCsNt|ddtdtj|d}g|D]}||kr2|^q2S(s``bumped()`` Mutable changesets marked as successors of public changesets. Only non-public and non-obsolete changesets can be `bumped`. isbumped takes no argumentstbumped(RXRtobsmodtgetrevs(R RZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscCs\y|jj}Wn&tk r8tjtdnXg|D]}||kr@|^q@S(sZ``bundle()`` Changesets in the bundle. Bundle must be specified by the -R option.s$no bundle provided - specify with -R(Rt bundlerevstAttributeErrorRRR(R RZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbundles  c Csd}g}tj|dk}d}xY|D]Q}||} | sK|rtj|j|j|gd| }|j rt|jdkr|jd}qn|dk r|| jkrq.qn*x'| jD]} || rPqqWq.|j | j j | j |} |dk rQ|| kr|j |qq.x+| D]#} || rX|j |PqXqXWq.W|S(NRtctxii( RtmatchmodtpatkindtmatchtroottgetcwdtanypatsREtfilesRtp1RR ( R RZRttfieldRgRPthassettfnameRBROtfR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRss4   '%   (      cCst}|s|S|jj}t|}xS|D]K}||krJq2nx0||D]"}||krW|j|qWqWWq2W|S(N(RRRRR (R tnarrowt parentsettcstprtminrevRBtp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _childrens      cCsStt|t||}t|||}g|D]}||kr7|^q7S(sA``children(set)`` Child changesets of changesets in set. (RR[R<R(R RZRRPRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytchildrenscCs@t|ddtdg|D]}||jr |^q S(s*``closed()`` Changeset is closed. isclosed takes no arguments(RXRt closesbranch(R RZRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytclosedsc Cst|td}d}g}tj|sdx|D]&}|||kr7|j|q7q7Wnx|D]}||}| stj|dkrtj|j|j|gd|}nx1|j D]#}||r|j|PqqWqkW|S(s``contains(pattern)`` Revision contains a file matching pattern. See :hg:`help patterns` for information about file patterns. scontains requires a patternRRN( RURRRRR RRRtmanifest( R RZRRtRgRPRBROR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytcontains s    *   csxdt|ddtd}|rCt|dtdnfd}g|D]}||r\|^q\S(s``converted([id])`` Changesets converted from the given identifier in the old repository if present, or all converted changesets if no identifier is specified. iis#converted takes one or no argumentssconverted requires a revisioncsA|jjdd}|dk o@dkp@|jS(Ntconvert_revision(R_RRt startswith(RBR\(R R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _matchvalue4sN(RRXRRU(R RZRRNRRB((R R s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt converted$s cCsUt|td}tj|}g|D]&}|||jdr+|^q+S(sQ``date(interval)`` Changesets within the interval, see :hg:`help dates`. sdate requires a stringi(RURRt matchdatetdate(R RZRtdstdmRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR:scCsntjt|td}g}xC|D];}||}|tj|jkr+|j|q+q+W|S(sZ``desc(string)`` Search commit message for string. The match is case-insensitive. sdesc requires a string(RRRURt descriptionR (R RZRRRNRBRO((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytdescCs  cCsgt|t||}|s"gStt|||t|B}g|D]}||krK|^qKS(N(R[R<RR(R RZRRRyRPRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _descendantsPs "cCst|||S(sT``descendants(set)`` Changesets which are descendants of changesets in set. (R(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt descendantsWscCst|||dtS(NR(RR|(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_firstdescendants]scCs|dk r-tt|t||}ntt|t||}t}x|D]}t||}d}xs|dk r|dkrt}n|j|||ks||kr|j|Pn|}t||}qyWq[Wg|D]}||kr|^qS(s``destination([set])`` Changesets that were created by a graft, transplant or rebase operation, with the given revisions specified as the source. Omitting the optional set is the same as passing all(). N(RRR[R<tgetallRbR tupdate(R RZRRytdestsRBtsrctlineage((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt destinationbs" !      cCsNt|ddtdtj|d}g|D]}||kr2|^q2S(sd``divergent()`` Final successors of changesets with an alternative set of final successors. isdivergent takes no argumentst divergent(RXRRR(R RZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscCsTt|ddtd|j}g|D]'}|j||tjkr)|^q)S(s)``draft()`` Changeset in draft phase.isdraft takes no arguments(RXRt _phasecachetphasetphasestdraft(R RZRtpcRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs cCsNt|ddtdtj|d}g|D]}||kr2|^q2S(sJ``extinct()`` Obsolete changesets with obsolete descendants only. isextinct takes no argumentstextinct(RXRRR(R RZRtextinctsRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscst|ddtd}t|dtddt|dkr}t|dtdt\}nfd}g|D]}||r|^qS( s3``extra(label, [value])`` Changesets with the given label in the extra metadata, with the given optional value. If `value` starts with `re:`, the remainder of the value is treated as a regular expression. To match a value that actually starts with `re:`, use the prefix `literal:`. iis.extra takes at least 1 and at most 2 argumentsis(first argument to extra must be a strings)second argument to extra must be a stringcs6|j}|ko5dkp5|S(N(R_R(RBR_(RaRR tvalue(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRsN(RXRRURRER(R RZRRNRRRB((RaRR Rs4/sys/lib/python2.7/site-packages/mercurial/revset.pyR_s c Cs+t|td}tj|j|j|gddd|d}t}tj|sx|j D]<}|j |}x$|D]}|j |j |qWqkWnZxW|dD]K}||r|j |}x'|D]}|j |j |qWqqWg|D]} | |kr| ^qS(s``filelog(pattern)`` Changesets connected to the specified filelog. For performance reasons, ``filelog()`` does not show every changeset that affects the requested file(s). See :hg:`help log` for details. For a slower, more accurate result, use ``file()``. sfilelog requires a patterntdefaulttrelpathRN( RURRRRRRRRRtfileR tlinkrev( R RZRRtRgRPRtfltfrRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytfilelogs $   !  !cCst|||S(s2``first(set, [n])`` An alias for limit(). (tlimit(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRsc Cst|ddtd|}|d}|rt|dtd|}||kr||}td|jd|D}|j|jqgSn4tt||jg|t|jgB}g|D]} | |kr| ^qS(Niis#%s takes no arguments or a filenameRAs%s expected a filenamecss|]}|jVqdS(N(R (RvR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys sR( RXRRURR{R RRR ( R RZRRRRNROtcxRPRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_follows   "4cCst|||dS(s``follow([file])`` An alias for ``::.`` (ancestors of the working copy's first parent). If a filename is specified, the history of the given file is followed, including copies. tfollow(R(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscCst|||ddtS(Nt _followfirstR(RR|(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscCst|ddtd|S(s9``all()`` All changesets, the same as ``0:tip``. isall takes no arguments(RXR(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscCsy"tjt|td}Wn/tjk rS}tjtd|nXg}xe|D]]}||}xJ|j|j|jgD]&}|j |r|j |PqqWqaW|S(s``grep(regex)`` Like ``keyword(string)`` but accepts a regex. Use ``grep(r'...')`` to ensure special escape characters are handled correctly. Unlike ``keyword(string)``, the match is case-sensitive. sgrep requires a stringsinvalid match pattern: %s( tretcompileRURRGRHRRRtsearchR (R RZRtgrteRNRBRO((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytgrep s"  )  cCset|ddtd}ggg}}}t}d\}} x<|D]4} t| td} | d | d} } | dkr|j| n| dkr|j| n| dkr|j| n| d kr|dk rtjtd n| }nR| d kr>| dk r5tjtd n| } ntjtd | | rHtj | dkrHt }qHqHW| sd} nd}g} x|D]}||}| s|r)|dkr)|}|dk r||pd}ntj |j |j |d|d|d|d| }nx1|jD]#}||r6| j|Pq6q6WqW| S(Niis*_matchfiles requires at least one arguments%_matchfiles requires string argumentsisp:si:sx:sr:s)_matchfiles expected at most one revisionsd:s-_matchfiles expected at most one default modesinvalid _matchfiles prefix: %sRtglobtincludetexcludeRR(NN(RXRtFalseRRUR RGRHRRR|RRRR(R RZRRNtpatstinctexcRR RtargRPtprefixRRgRBRORR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _matchfiles!sR                !   cCs/t|td}t||dd|fS(s``file(pattern)`` Changesets affecting files matched by pattern. For a faster but less accurate result, consider using ``filelog()`` instead. sfile requires a patternR?sp:(RURR(R RZRRt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pythasfile`scst|ddtdt}x=jjD])\}}|jfd|Dq5Wg|D]}||kri|^qiS(s5``head()`` Changeset is a named branch head. ishead takes no argumentsc3s|]}|jVqdS(N(R (Rvth(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pys ss(RXRRRRR(R RZRthsRqtlsRB((R s4/sys/lib/python2.7/site-packages/mercurial/revset.pytheadks  !cCsMt|||}tt|||}g|D]}||kr1|^q1S(s?``heads(set)`` Members of set with no children in set. (R[RR!(R RZRRPRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRvscCsNt|ddtdtj|d}g|D]}||kr2|^q2S(s(``hidden()`` Hidden changesets. ishidden takes no argumentstvisible(RXRtrepoviewt filterrevs(R RZRt hiddenrevsRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pythidden~scCstjt|td}g}xh|D]`}||}dj|j|j|jg}|tj|kr+|j|q+q+W|S(s``keyword(string)`` Search commit message, user name, and names of changed files for string. The match is case-insensitive. skeyword requires a stringt ( RRRURtjoinRRRR (R RZRtkwRNRBROtt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytkeywords  +cCst|ddtd}y>d}t|dkrXtt|dtd}nWn,ttfk rtjtdnXt |}t |t ||d| }g|D]}||kr|^qS(sE``limit(set, [n])`` First n members of set, defaulting to 1. iis#limit requires one or two argumentsslimit requires a numberslimit expects a numberi( RXRRER~RURRRGRHRR[R<(R RZRRNtlimtsstosRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs&  cCst|ddtd}y>d}t|dkrXtt|dtd}nWn,ttfk rtjtdnXt |}t |t ||d| }g|D]}||kr|^qS(sC``last(set, [n])`` Last n members of set, defaulting to 1. iis"last requires one or two argumentsslast requires a numberslast expects a numberi( RXRRER~RURRRGRHRR[R<(R RZRRNRRR RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytlasts& !cCsDt|t||}|r@t|}||kr@|gSngS(sD``max(set)`` Changeset with highest revision number in set. (R[R<RW(R RZRR Rg((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmaxrevs    cCsRt|ddtd|j}g|D]%}|j|ddkr)|^q)S(s4``merge()`` Changeset is a merge changeset. ismerge takes no argumentsii(RXRRR(R RZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmerges cCst|ddtd|j}|s,gSt|}dgt||}x[|jd|dD]C}x:|j|D])}||kr||||cd7dsN( RttupleR!RRR[R<RR(R RZRRRBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR!_s  #  cCs3y)t|d}|dkr(tnWn,ttfk rWtjtdnXt}|j}xt|||D]}|dkr|j |q}|dkr|j |j |dq}|dkr}|j |}t |dkr |j |dq q}q}Wg|D]}||kr|^qS(s``set^0`` The set. ``set^1`` (or ``set^``), ``set^2`` First or second parent, respectively, of all changesets in set. iiis^ expects a number 0, 1, or 2(iii( R~RRRGRHRRRR[R RRE(R RZRRhRRRBR!((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt parentspecms$       cCs0yt|||SWntjk r+gSXdS(s&``present(set)`` An empty set, if any revision in set isn't found; otherwise, all revisions in set. If any of specified revisions is not present in the local repository, the query is normally aborted. But this predicate allows the query to continue even in such cases. N(R[RGR`(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytpresents cCsTt|ddtd|j}g|D]'}|j||tjkr)|^q)S(s+``public()`` Changeset in public phase.ispublic takes no arguments(RXRRRRtpublic(R RZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR3s cCs~ddl}t|ddtd}d}t|dkr[t|dtd}n|dkrz|dj}nd}t|d krt|d td }n|jj|pd }|j|\}}|j |||g\}} |r$g|D]} |j | ^q}n|j |i|} | j |} | |krz|| j } | |krz| gSngS( s``remote([id [,path]])`` Local revision that corresponds to the given identifier in a remote repository, if present. Here, the '.' identifier is a synonym for the current local branch. iNiis%remote takes one, two or no argumentsRAsremote requires a string idRis!remote requires a repository pathR( RRXRRERURRRR R!R"R#R (R RZRRRNtqR)R*R R+R R,RhRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytremotes,  %   cCs(t|td}t|||dS(sM``removes(pattern)`` Changesets which remove files matching pattern. sremoves requires a patterni(RURRs(R RZRRt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytremovesscCst|ddtd}y#tt|dtd}Wn,ttfk rltjtdnXg|D]}||krt|^qtS(sD``rev(number)`` Revision with the given numeric identifier. isrev requires one argumentisrev requires a numbersrev expects a number(RXRR~RURRRGRH(R RZRRNRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR s #c s4t|ddtd}tj|d}dg}t|dkrqt|dtdj}ng}xq|D]i}|dkr|ddd g7}q~|d kr|d d g7}q~|d krd}n|j|q~Wt|}d |krd|kr|j d ndddd dd d ddd g fd}t |}|j d|gi fdd6fdd6fdd 6fdd6fdd 6fdd6fdd6fdd6fdd 6fdd 6} xU|D]M} | j | d } | d kratjtd| nj| q!Wfd} t} x|D]|}| |}xg|D]_}t}x:tD],\}}||||krt}PqqW|r| j|qqWqWg|D]}|| kr|^qS(!s``matching(revision [, field])`` Changesets in which a given set of fields match the set of fields in the selected revision or set. To match more than one field pass the list of fields to match separated by spaces (e.g. ``author description``). Valid fields are most regular revision fields and some special fields. Regular revision fields are ``description``, ``author``, ``branch``, ``date``, ``files``, ``phase``, ``parents``, ``substate``, ``user`` and ``diff``. Note that ``author`` and ``user`` are synonyms. ``diff`` refers to the contents of the revision. Two revisions matching their ``diff`` will also match their ``files``. Special fields are ``summary`` and ``metadata``: ``summary`` matches the first line of the description. ``metadata`` is equivalent to matching ``description user date`` (i.e. it matches the main metadata fields). ``metadata`` is the default field which is used when no fields are specified. You can match more than one field at a time. iismatching takes 1 or 2 argumentsitmetadatas1matching requires a string as its second argumentRRRtdiffRRtsummaryRR!Rtsubstatecs0yj|SWntk r+tSXdS(N(tindexRRE(R(t fieldorder(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt fieldkeyfuncs tkeycs|jS(N(R(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC!scs|jS(N(R(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC"scs|jS(N(R(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC#scs|jS(N(R(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC$scs|jS(N(R(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC%scs|jS(N(R!(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC&scs|jS(N(R(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC'scs |jS(N(R:(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC(scs|jjdS(Ni(Rt splitlines(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC)scst|jdtS(Ntgit(R<R8R|(RB(R (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC*ss,unexpected field name passed to matching: %scsgD]}||^qS(N((RBR(t getfieldfuncs(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC6sN(RXRR[RRERUtsplitR RtdiscardR<tsortRRRGRHR|t enumerateRR (R RZRRNR t fieldlisttfieldsRR=t_funcstinfotgetfieldtgetinfotmatchesR ttargetRBRRhR((R<RAR s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmatchingsl               cCs>t|||}t|ts0t|}n|j|S(s/``reverse(set)`` Reverse order of set. (R[t isinstanceR<treverse(R RZRRN((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRPEs  cCsutt||j|}g|D]}||kr"|^q"}t|||}g|D]}||krY|^qYS(sJ``roots(set)`` Changesets in set with no parent changeset in set. (RR[RR(R RZRRPRBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyROs%cCsTt|ddtd|j}g|D]'}|j||tjkr)|^q)S(s+``secret()`` Changeset in secret phase.issecret takes no arguments(RXRRRRtsecret(R RZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRQXs c Csnt|ddtd}d}t|dkrOt|dtd}n|d}|j}g}d}xt|||D]}||}g} x|D]} | dkr| j|q| dkr| j| q| d kr| j|jq| d kr-| j||jq| d krO| j|jq| d krw| j||jq| d kr| j|j q| dkr| j||j q| dkr| j|j dq| dkr| j|j d qt j td| qW| j||j| qW|j g|D]} | d^qZS(s``sort(set[, [-]key...])`` Sort set by keys. The default sort order is ascending, specify a key as ``-key`` to sort in descending order. The keys can be: - ``rev`` for the revision number, - ``branch`` for the branch name, - ``desc`` for the commit message (description), - ``user`` for user name (``author`` can be used as an alias), - ``date`` for the commit date iis"sort requires one or two argumentsR ssort spec must be a stringicSsdjd|DS(NRcss%|]}tdt|VqdS(iN(tchrRJ(RvRO((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys xs(R(RP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytinvertwss-revRs-branchRs-descs user authors -user -authorRs-datesunknown sort key %ri(RXRRERURBR[R RRRRRGRHRD( R RZRRNtkeysRPRSRBRORtk((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRD`sJ                 cCs|jdrn|d}ytj|}Wn/tjk r]}tjtd|nXd||jfS|jdr|d}nd||jfS(s accepts a string, possibly starting with 're:' or 'literal:' prefix. returns the matcher name, pattern, and matcher function. missing or unknown prefixes are treated as literal matches. helper for tests: >>> def test(pattern, *tests): ... kind, pattern, matcher = _stringmatcher(pattern) ... return (kind, pattern, [bool(matcher(t)) for t in tests]) exact matching (no prefix): >>> test('abcdefg', 'abc', 'def', 'abcdefg') ('literal', 'abcdefg', [False, False, True]) regex matching ('re:' prefix) >>> test('re:a.+b', 'nomatch', 'fooadef', 'fooadefbar') ('re', 'a.+b', [False, False, True]) force exact matches ('literal:' prefix) >>> test('literal:re:foobar', 'foobar', 're:foobar') ('literal', 're:foobar', [False, True]) unknown prefixes are ignored and treated as literals >>> test('foo:bar', 'foo', 'bar', 'foo:bar') ('literal', 'foo:bar', [False, False, True]) sre:isinvalid regular expression: %sRsliteral:iR(RRRRGRHRRt__eq__(RtregexR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs  cs@t\}}|dkr3fd}n||fS(NRcs |kS(N((RP(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRCs(R(RRR((Rs4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs c Csft|ddtd}|j}|rt|dtd}t|\}}}|dkr|jjj|d}|dkrt j td|nt ||j g} qCt g|j D]'\} } || r|j | ^q} n@t g|j D]'\} } | dkr|j | ^q} g|D]} | | krJ| ^qJS( s```tag([name])`` The specified tag by name, or all tagged revisions if no name is given. iistag takes one or no argumentss$the argument to tag must be a stringRstag '%s' does not existttipN(RXRRRURt _tagscachettagsRRRRRR ttagslist( R RZRRyRRRRttnRPRRhRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyttags    C@cCst|||S(N(R](R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyttaggedscCsNt|ddtdtj|d}g|D]}||kr2|^q2S(sH``unstable()`` Non-obsolete changesets with obsolete ancestors. isunstable takes no argumentstunstable(RXRRR(R RZRt unstablesRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR_scCst|||S(s``user(string)`` User name contains string. The match is case-insensitive. If `string` starts with `re:`, the remainder of the string is treated as a regular expression. To match a user that actually contains `re:`, use the prefix `literal:`. (R(R RZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscCst|d}|sgSt|ts7t|}ng|jdD]}||j^qG}g|D]}||krj|^qjS(Nsinternal errort(RURORRBR (R RZRRPRBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_lists,RutallR{R}RRRRRRRRRRRRRRRRRRRRR_RRRRRRRRRtidRR RRRWR RRRRR-RR/R!R2R3R5R6R RPRRDRQRNR]R^RR_Rbc Cs|dkrd|fSd}|r+d}n|d}|dkretd|dd|dff|S|dkrtd d(|df|S|d krtd d)|df|S|dkrtdd*|df|S|dkrtd|dd+f|S|dkr3tddt|dtdf|S|dkrI||fS|dkrt|dt\}}t|dt\}}t||}||kr||||ffS||||ffS|dkr>t|dt\}}t|dt\}}||kr"||}}nt|||||ffS|dkrvt|d| } | d|| dffS|dkrt|d|} | d|| dffS|dkrt|d|S|dkr|dkrYd|df} |dddkr$td| |ddf|S|dddkrYtd| |ddf|Snt|d|\}}t|d|\}}|||||ffS|d krt|dtd} t|d|\}}| dkrd }ns| d!kr d"}n^| d#krd$}nI| d%kr8d|}n0| d&krMd}n| d'krbd }nd}||||d|ffSd|fS(,Niig?R,R7R5iR.R%R>R{R0RR1R2R?t0R3RXR+R-scan't negate thatsstring symbol negateR9R)R#s'dagrange range list parent ancestorspecRR/s not a symbols>author branch closed date desc file grep keyword outgoing useri smodifies adds removesiRidR'sreverse limit firstRD(ssymbols ancestors(ssymbols descendants(sstringRe(sstringstip(RtoptimizeRURR|RRRW( Rtsmallt smallbonustoptwattatwbttbtwRtpostR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRfQs     $     $           !             t _aliasargcCsFt|dkrB|d tkrB|dddkrB|ddSdS(scIf tree matches ('func', ('symbol', '_aliasarg'), ('string', X)) return X, None otherwise. iiiR?iN(RERpR(ttree((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _getaliasargs" cCs{t|trwt|}|dk rV| s:||krVtjtddnx|D]}t||q]WndS(sCheck tree contains no _aliasarg construct or only ones which value is in known. Used to avoid alias placeholders injection. snot a function: %sRpN(ROR0RrRRGRHRt_checkaliasarg(RqtknownRR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRss   t revsetaliascBs&eZejdZdZdZRS(s^([^(]+)\(([^)]+)\)$cCs|jj|}|r|jd|_dd|jdff|_g|jdjdD]}|j^qa|_xE|jD]}|j|d|f}qWn||_d|f|_t |\|_ }|t |krt j td|nt|j |jdS( seAliases like: h = heads(default) b($1) = ancestors($1) - ancestors(default) iR%R>iR=s _aliasarg(%r)s invalid tokenN(tfuncreRR#RRqRBtstripRytreplacetparset replacementRERGRHRRs(tselfRRRgRRRM((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt__init__s4  N(t__name__t __module__RRRvRRyR|(((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRusc Cst|tr|r|ddkr{t|dkr{|d}|j|}|r{|jdkr{|j|kr{|Sn|ddkrt|dkr|dddkrt|ddkr|dd}|j|}|r|jdk r|j|d kr|SqqndS(sRIf tree looks like an unexpanded alias, return it. Return None otherwise. iR>iiR%N(ROR0RERRyRRq(taliasesRqRtalias((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _getaliass" $"*( csU| st|t r|St|}|dk r;|Stfd|DS(sgReplace _aliasarg instances with the substitution value of the same name in args, recursively. c3s|]}t|VqdS(N(t _expandargs(RvR(Ry(s4/sys/lib/python2.7/site-packages/mercurial/revset.pys sN(ROR0RrR(RqRyR((Rys4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs   cst|ts|St|}|dk rY|krYtjtd|jnj||jkrt |j |j sN(ROR0RRRGRHRRR RRzRRyRVRERtdicttzip(RRqRRRtresultRNRp((RRRs4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs.      (' cCs_t|i}x9|jdD](\}}t||}|||j>> formatspec('%r:: and %lr', '10 or 11', ("this()", "that()")) '(10 or 11):: and ((this()) or (that()))' >>> formatspec('%d:: and not %d::', 10, 20) '10:: and not 20::' >>> formatspec('%ld or %ld', [], [1]) "_list('') or 1" >>> formatspec('keyword(%s)', 'foo\xe9') "keyword('foo\\xe9')" >>> b = lambda: 'default' >>> b.branch = b >>> formatspec('branch(%b)', b) "branch('default')" >>> formatspec('root(%ls)', ['a', 'b', 'c', 'd']) "root(_list('a\x00b\x00c\x00d'))" cSstt|S(N(treprtstr(RP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytquoteFscs|dkrtt|S|dkr2|S|dkrPt|d|S|dkrotj|S|dkr|jSdS(NRQRPRBs(%s)RhRq(RR~RyRthexR(ROR(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pytargtypeIs       cst|}|dkrdS|dkr9||dS|dkr`ddjd|DS|dkr}ddj|S|d krddjd |DS|d krddjd |DS|d }d|| ||||fS(Nis _list('')iRQs _list('%s')Racss!|]}tt|VqdS(N(RR~(RvRp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys ]sRPRhcss|]}tj|VqdS(N(RR(RvRp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys asRqcss|]}|jVqdS(N(R(RvRp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys csis (%s or %s)(RER(RPRRNRg(Rtlistexp(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRVs        Rit%itdsnbrRNs&unexpected revspec format character %s(RER<RR(texprRytretRMRRORQ((RRRs4/sys/lib/python2.7/site-packages/mercurial/revset.pyt formatspec%s2!               csBfdg}|d|djd|D}|S(Ncst|t s |ddkr<|j|t|fnk|j|d|dfx&|dD]}||d|qbW|dd|dddfg|d)dS( NiR?R>s(%siiR$(sstringssymbol(ROR0R R(RqtleveltlinesRP(t _prettyformat(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs  is css#|]\}}d||VqdS(s N((RvRNRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys s(R(RqRtoutput((Rs4/sys/lib/python2.7/site-packages/mercurial/revset.pyt prettyformats  (sgroupiR$(sfunciR$(sancestori(sparenti(s parentposti(snegatei(sminusi(s dagrangeprei(sdagrangei(s dagrangeposti(s dagrangeprei(sdagrangei(s dagrangeposti(srangeprei(srangei(s rangeposti(snoti (snoti (sandi(sandi(sori(sori(sori(slisti(iNN(ssymbol(sstring(iNN(ssymbols _aliasarg(RtparserRRGR%RRRRRti18nRRRRRRRR"RtelementsRRKRSRURVRXR[RbRcReRiR/RkRnRoRrR%RuR'RRzR{R}RRRRRRRRRsRRRRRRRRRRRRRRR_RRRRRRRRRRRRRRR R R RRRRRR-RR/R!R1R2R3R5R6R RNRPRRQRDRRR]R^R_RRbRdRYRfRpRrRstobjectRuRRRRRyRRRt i18nfunctions(((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyts H               E                      &           ,          ?                 #   p  8 '       N     ^