��c@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlZ ddl
mZddlZddl
ZddlZd�Zd�Zd�Zidd�d�fd6ddd�fd6ddd�d�fd6dd�d�fd6dd�d��d6dd���d6dd���d!6d"d�d#6d"d�d$6ddd�d%6ddd�d&6d'dd�d(6d'dd�d)6d'dd�d*6d+dd�d-6d�6d.d�fd/6d.d�fd06d�6Zed%d(d#g�Zd2�Zd3�Zd4�Zd5�Zd6�Zd7�Zd8�Zd9�Zd:�Zd;�Z d<�Z!d=�Z"d>�Z#d?�Z$d@�Z%dA�Z&dB�Z'e(dC�Z)dD�Z*dE�Z+dF�Z,dG�Z-dH�Z.dI�Z/dJ�Z0dK�Z1dL�Z2dM�Z3dN�Z4dO�Z5dP�Z6dQ�Z7dR�Z8dS�Z9dT�Z:dU�Z;e(dV�Z<dW�Z=dX�Z>dY�Z?dZ�Z@d[�ZAd\�ZBd]�ZCd^�ZDd_�ZEe(d`�ZFda�ZGdb�ZHdc�ZIdd�ZJde�ZKdf�ZLdg�ZMdh�ZNdi�ZOdj�ZPdk�ZQdl�ZRdm�ZSdn�ZTdo�ZUdp�ZVdq�ZWdr�ZXds�Z
dt�ZYdu�ZZdv�Z[dw�Z\dx�Z]dy�Z^dz�Z_d{�Z`d|�Zad}�Zbd~�Zcd�Zdd��Zed��Zfd��Zgd��Zhd��Zid��Zjd��Zkd��Zld��Zmd��Znd��ZoiAe&d�6eId�6e'd
6e*d�6e+d�6e-d�6e.d�6e/d�6e0d�6e1d�6eUd�6e2d�6e3d�6e6d�6e7d�6e8d�6e9d�6e:d�6e;d�6e=d�6e>d�6e?d�6e@d�6eAd�6eBd�6eCd�6eLd�6eDd�6eEd�6eGd�6eHd�6eJd�6eMd�6eNd�6eOd�6eXd�6ePd�6eRd�6eQd�6eKd�6eSd�6eTd�6eVd�6eWd�6e
d�6eYd�6eZd�6e[d�6e\d�6e]d�6e_d�6e`d�6ead�6ebd�6ecd�6eed�6efd�6ehd�6egd�6edd�6ekd�6eld�6end�6emd�6eod�6Zpied6e d6ed06ed/6e!d%6e"d(6e#d#6e$d,6e%d
6e,d
6e^d6e[d6Zqd��Zrd
d�Zsd��Ztdd��Zud�evfd���YZwd��Zxd��Zyd��Zzd��Z{ejee�j|Z|d��Zd��Z}d��Z~epj�Z�dS(�i�N(t_ccs�|rdpd}|j}tj|�}ttjg�}x\|r�xO|j|j��| D]4}||kr_|j |�|j
|�|Vq_q_Wq?WdS(s2Like revlog.ancestors(), but supports followfirst.iN(tNonet changelogtutiltdequetsettnodetnullrevt
parentrevstpoplefttappendtadd(trepotrevstfollowfirsttcuttcltvisittseentparent((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt
_revancestorss
c
cs�|rdpd}|j}t|�}tj}||krVx|D]}|VqCWdSt|�}xg|j|d�D]R}xI|j|�| D]4} | |kr�| |kr�|j|�|VPq�q�WqvWdS(s3Like revlog.descendants() but supports followfirst.iN( RRtminRRRR
RR(
RR
RRRtfirstRtiRtx((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_revdescendantss
cCs$|s
gS|jj}|}t�}i}t|�}t|�}x�|r�|j�}||kru|j|�n||�} | ||<x6| D].}
|
|kr�|
|kr�|j|
�q�q�WqGW|s�gSxEt|�D]7}x.||D]"}
|
|kr�j|�q�Wq�Wt|�S(sNReturn all paths between roots and heads, inclusive of both endpoint
sets.(RRRRtpopRR
tsorted(RtrootstheadsRRt reachableRtminroottrevtparentsR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_revsbetween3s0
itgroupit)tfunct(itancestort~Rt
parentpostt^itnegateitminust-itdagrangepretdagrangetdagrangeposts::s..itrangepretranget rangepostt:i
tnott!tandt&itort|t+itlistt,itsymboltstringtendccsdt|�}}x�|kr�|}|j�r;n�|dkry|||d!dkrydd|fV|d7}nr|dkr�|||d!dkr�dd|fV|d7}n4|dkr�|d|fVn|d ks|d
kr�|||d!dkr�|d
kr/|d7}||}d
�}n d�}|d7}|}x�||kr�||}|dkr}|d7}qKn||kr�d||||!�|fVPn|d7}qKWtjtd�|��n|j�s�dks�|�dkr�|}|d7}x�||kr�||}|j�pK|dkpKt|�dksRPn|dkr�||ddkr�|d8}Pn|d7}qW|||!}|tkr�|d|fVnd||fV|d8}ntjtd�|��|d7}qWdd|fVdS(s�
Parse a revset statement into a stream of tokens
Check that @ is a valid unquoted token character (issue3686):
>>> 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.pyt<lambda>�scSs
|jd�S(Ns
string-escape(tdecode(R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC�ss\R?sunterminated strings._@is._/@R>ssyntax 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 getstring�s&cCs:|s
gS|ddkr3t|d�|dgS|gS(NiR<ii(tgetlist(R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRV�s
cCsRt|�}t|�|ks<|dkrNt|�|krNtj|��n|S(Ni(RVRERGRH(RRtmaxRTRN((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytgetargs�s0cCs:|stjtd���nt|d|||d�S(Nsmissing argumentii(RGRHRtmethods(RtsubsetR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytgetset�scCsa||j�}xJdD]B}||kry|||j�SWqYtjk
rUqYXqqWdS(Ntsourcettransplant_sourcet
rebase_source(ssourceR]R^(textraR RGtRepoLookupErrorR(RRBR_tlabel((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt
_getrevsource�s
cCsj||j�}|dkr;t|�t|�kr;dgSt|�t|�ks_||krf|gSgS(Ni�(R RE(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt stringset�s$$cCs8|tkr(tjtd�|��nt|||�S(Nscan't use %s here(tsymbolsRGRHRRc(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt symbolset�sc Cs�|j}t|||�}t|||�}|s;|r?gS|d|d}}||krvt||d�}nt||dd�}t|�}g|D]}||kr�|^q�S(Nii�i(RR[R2R( RRZRtyRtmtnRBRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytrangeset�s cCset|�}t|t|||�t|||��}t|�}g|D]}||krI|^qIS(N(R<R"R[R(RRZRRfRBtxsRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR/�s*cCst|t|||�|�S(N(R[(RRZRRf((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytandset�scCsWt|||�}t|�}t|g|D]}||kr+|^q+|�}||S(N(R[R(RRZRRftxlRPRBtyl((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytorset�s1cCs;tt|||��}g|D]}||kr|^qS(N(RR[(RRZRRPRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytnotset�scCstjtd���dS(Ns can't use a list in this context(RGRHR(RRZtatb((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytlistsetscCsY|ddkr8|dtkr8t|d|||�Stjtd�|d��dS(NiR>isnot a function: %s(RdRGRHR(RRZRpRq((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR%s cCs(t|td��}t|||d�S(sG``adds(pattern)``
Changesets that add a file matching pattern.
sadds requires a patterni(RURtcheckstatus(RRZRtpat((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytadds
sc
s�t|�}t���d}�jj}�jj}�jj}xh��fd�|D�D]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(Rtrl(s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>&sN(RVR<RRR R'R(
RRZRRNtancR R'RR
RB((RRws4/sys/lib/python2.7/site-packages/mercurial/revset.pyR's
)cCsgt|t|�|�}|s"gStt|||��t|�B}g|D]}||krK|^qKS(N(R[R<RR(RRZRRtargsRPRB((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(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt ancestors8scCst|||dt�S(NR(RztTrue(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_firstancestors>scCs�yt|d�}Wn,ttfk
rBtjtd���nXt�}|j}xQt|||�D]=}x't |�D]}|j
|�d}q{W|j|�qhWg|D]}||kr�|^q�S(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(RRZRRhtpsRRBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytancestorspecCs cCsitjt|td���}t|�\}}}g|D]+}|tj||j���r:|^q:S(s7``author(string)``
Alias for ``user(string)``.
sauthor requires a string(tencodingtlowerRURt_substringmatchertuser(RRZRRhtkindtpatterntmatcherRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytauthorTscCsVt|td��j�}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(RURR�Rthbisecttget(RRZRtstatuststateRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbisect]s
cCst|||�S(N(R�(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbisectedpscCs�t|ddtd��}|r�t|dtd��}t|�\}}}|dkr�|jj|d�}|s�tjtd�|��n||j �}g|D]} | |kr�| ^q�St
�}
x9|jj�D](\}}||�r�|
j|�q�q�W|
s,tjtd�|��nt
�}x%|
D]}|j||j ��q<Wg|D]} | |krd| ^qdSnt
g|jj
�D]} || j �^q��}
g|D]} | |
kr�| ^q�S( 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
_bookmarksR�RRtAbortR Rt iteritemsRtvalues(RRZRRytbmR�R�R�tbmrevRBt matchrevstnametbmrevstbms((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbookmarkss2
#
&,c CsHyt|d�}Wntjk
r)n�Xt|�\}}}|dkr�||j�kr�g|D]"}|||j��rd|^qdSn-g|D]"}|||j��r�|^q�St|t|�|�}t�}x%|D]}|j ||j��q�t|�}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�(
RURGRHR�t branchmaptbranchR[R<RR( RRZRRqR�R�R�RBRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s 0-
cCsNt|ddtd��tj|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(RRZRR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scCs\y|jj}Wn&tk
r8tjtd���nXg|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
bundlerevstAttributeErrorRR�R(RRZRR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbundle�s
cCs�d}g}tj|�dk}d}xY|D]Q}||} |sK|r�tj|j|j�|gd| �}|j�r�t|j��dkr�|j�d}q�n|dk r�|| j�kr�q�x'| j�D]}
||
�r�q��q.|j | j
�j�| j��|}|dk rQ||kr|j|�qq.x+|D]#}
||
�rX|j|�PqXqXWq.W|S(NRtctxii(
RtmatchmodtpatkindtmatchtroottgetcwdtanypatsREtfilesR�tp1RR
(RRZRttfieldRgRPthassettfnameRBROtfR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs�s4
'% (
cCs�t�}|s|S|jj}t|�}xS|D]K}||krJq2nx0||�D]"}||krW|j|�qWqWWq2W|S(N(RRRRR(Rtnarrowt parentsettcstprtminrevRBtp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _children�s
cCsStt|t|�|��}t|||�}g|D]}||kr7|^q7S(sA``children(set)``
Child changesets of changesets in set.
(RR[R<R�(RRZRRPR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytchildren�scCs@t|ddtd��g|D]}||j�r |^q S(s*``closed()``
Changeset is closed.
isclosed takes no arguments(RXRtclosesbranch(RRZRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytclosedsc Cs�t|td��}d}g}tj|�sdx�|D]&}|||kr7|j|�q7q7Wn�x�|D]�}||}|s�tj|�dkr�tj|j|j�|gd|�}nx1|j �D]#}||�r�|j|�Pq�q�WqkW|S(s�``contains(pattern)``
Revision contains a file matching pattern. See :hg:`help patterns`
for information about file patterns.
scontains requires a patternRR�N(
RURRR�R�R
R�R�R�tmanifest( RRZRRtRgRPRBROR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytcontainss
*
csxd�t|ddtd��}|rCt|dtd���n��fd�}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�|j�jdd�}|dk o@�dkp@|j��S(Ntconvert_revision(R_R�Rt
startswith(RBR\(RR (s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_matchvalue4sN(RRXRRU(RRZRRNR�RB((RR s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt converted$s cCsUt|td��}tj|�}g|D]&}|||j�d�r+|^q+S(sQ``date(interval)``
Changesets within the interval, see :hg:`help dates`.
sdate requires a stringi(RURRt matchdatetdate(RRZRtdstdmRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR�:scCsntjt|td���}g}xC|D];}||}|tj|j��kr+|j|�q+q+W|S(sZ``desc(string)``
Search commit message for string. The match is case-insensitive.
sdesc requires a string(R�R�RURtdescriptionR
(RRZRR�RNRBRO((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytdescCs
cCsgt|t|�|�}|s"gStt|||��t|�B}g|D]}||krK|^qKS(N(R[R<RR(RRZRRRyRPRB((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�(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytdescendantsWscCst|||dt�S(NR(R�R|(RRZR((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�dkr�t�}n|j|�||ks�||kr�|j|�Pn|}t||�}qyWq[Wg|D]}||kr�^q�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(RRZRRytdestsRBtsrctlineage((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytdestinationbs"!
cCsNt|ddtd��tj|d�}g|D]}||kr2|^q2S(sd``divergent()``
Final successors of changesets with an alternative set of final successors.
isdivergent takes no argumentst divergent(RXRR�R�(RRZRR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scCsTt|ddtd��|j}g|D]'}|j||�tjkr)|^q)S(s)``draft()``
Changeset in draft phase.isdraft takes no arguments(RXRt_phasecachetphasetphasestdraft(RRZRtpcRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s cCsNt|ddtd��tj|d�}g|D]}||kr2|^q2S(sJ``extinct()``
Obsolete changesets with obsolete descendants only.
isextinct takes no argumentstextinct(RXRR�R�(RRZRtextinctsRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scs�t|ddtd��}t|dtd���d�t|�dkr}t|dtd���t��\}��n����fd�}g|D]}||�r�|^q�S( 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�}�|ko5�dkp5�|��S(N(R_R(RBR_(RaR�Rtvalue(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��sN(RXRRURRER�(RRZRRNR�R�RB((RaR�RR�s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR_�sc
Cs+t|td��}tj|j|j�|gddd|d�}t�}tj|�s�x�|j �D]<}|j
|�}x$|D]}|j|j|��q�WqkWnZxW|dD]K}||�r�|j
|�}x'|D]}|j|j|��q�q�q�Wg|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 patterntdefaulttrelpathR�N(
RURR�R�R�R�RRR�R�tfileRtlinkrev(
RRZRRtRgRPR�tfltfrRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytfilelog�s
$
!
!cCst|||�S(s2``first(set, [n])``
An alias for limit().
(tlimit(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR�sc
Cs�t|ddtd�|�}|d}|r�t|dtd�|�}||kr�||}td�|jd|�D��}|j|j��q�gSn4tt||j�g|��t|j�g�B}g|D]} | |kr�| ^q�S(Niis#%s takes no arguments or a filenameRAs%s expected a filenamecss|]}|j�VqdS(N(R (RvR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>�sR( RXRRURR{RR�RR (
RRZRR�RRNROtcxRPRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_follow�s
"4cCst|||d�S(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�(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scCst|||ddt�S(Nt_followfirstR(R�R|(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scCst|ddtd��|S(s9``all()``
All changesets, the same as ``0:tip``.
isall takes no arguments(RXR(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR�scCs�y"tjt|td���}Wn/tjk
rS}tjtd�|��nXg}xe|D]]}||}xJ|j�|j�|j�gD]&}|j |�r�|j
|�Pq�q�WqaW|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(tretcompileRURRGRHR�R�R�tsearchR
(RRZRtgrteRNRBRO((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 r�jtd
���n|
}nR|dkr>| dk r5tjtd���n|
} ntjtd
�|��|rHtj |
�dkrHt
}qHqHW| s�d} nd}g}x�|D]�}||}|s�|r)|dkr)|}|dk r�|p�}ntj|j|j
�|d|d|d|d| �}nx1|j�D]#}||�r6|j|�Pq6q6Wq�W|S(Nii�s*_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: %sRtglobtincludetexcludeR�R�(NN(RXRtFalseRRUR
RGRHR�R�R|R�R�R�R�(RRZRRNtpatstinctexcR�R R�targRPtprefixR�RgRBROR�R�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_matchfiles!sR
!
cCs/t|td��}t||dd|f�S(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�(RRZRRt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pythasfile`scs�t|ddtd��t�}x=�j�j�D])\}}|j�fd�|D��q5Wg|D]}||kri|^qiS(s5``head()``
Changeset is a named branch head.
ishead takes no argumentsc3s|]}�|j�VqdS(N(R (Rvth(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>ss(RXRRR�R�R�(RRZRthsRqtlsRB((Rs4/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!(RRZRRPR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRvscCsNt|ddtd��tj|d�}g|D]}||kr2|^q2S(s(``hidden()``
Hidden changesets.
ishidden takes no argumentstvisible(RXRtrepoviewt
filterrevs(RRZRt
hiddenrevsRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pythidden~scCs�tjt|td���}g}xh|D]`}||}dj|j�|j�|j�g�}|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 ( R�R�RURtjoinR�R�R�R
(RRZRtkwRNRBROtt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytkeyword�s
+cCs�t|ddtd��}y>d}t|�dkrXtt|dtd���}nWn,ttfk
r�tjtd���nXt |�}t
|t|�|d�| }g|D]}||kr�|^q�S(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~RURR�RGRHRR[R<(RRZRRNtlimtsstosRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s& cCs�t|ddtd��}y>d}t|�dkrXtt|dtd���}nWn,ttfk
r�tjtd���nXt |�}t
|t|�|d�|}g|D]}||kr�|^q�S(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~RURR�RGRHRR[R<(RRZRRNRRR RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytlast�s&!cCsDt|t|�|�}|r@t|�}||kr@|gSngS(sD``max(set)``
Changeset with highest revision number in set.
(R[R<RW(RRZRR Rg((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmaxrev�s
cCsRt|ddtd��|j}g|D]%}|j|�ddkr)|^q)S(s4``merge()``
Changeset is a merge changeset.
ismerge takes no argumentsii�(RXRRR(RRZRRRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmerge�s cCs�t|ddtd��|j}|s,gSt|�}dgt|�|}x[|jd|d�D]C}x:|j|�D])}||kr||||cd7<q|q|WqfWg|D] }|||dkr�|^q�S(s?``branchpoint()``
Changesets with more than one child.
isbranchpoint takes no argumentststarti(RXRRRRER
R(RRZRRtbaserevtparentscountRBR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytbranchpoint�s cCsDt|t|�|�}|r@t|�}||kr@|gSngS(sC``min(set)``
Changeset with lowest revision number in set.
(R[R<R(RRZRR Rg((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s
cCs(t|td��}t|||d�S(sM``modifies(pattern)``
Changesets modifying files matched by pattern.
smodifies requires a patterni(RURRs(RRZRRt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmodifies�scCs�t|ddtd��}t|dtd��}t|�dkrY||j�}n9d}|jj|�}|dk r�|jj|�}ng|D]}||kr�|^q�S(sZ``id(string)``
Revision non-ambiguously specified by the given hex string prefix.
isid requires one argumentisid requires a stringi(N(RXRRURER RRt
_partialmatch(RRZRRNRhtrntpmRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytnode_�scCsNt|ddtd��tj|d�}g|D]}||kr2|^q2S(s:``obsolete()``
Mutable changeset with a newer version.isobsolete takes no argumentstobsolete(RXRR�R�(RRZRt obsoletesRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRscs�|dk r-tt�t��|��}ntt�t��|��}�fd�}tg|D]}||�^qd�}g|D]}||kr�|^q�S(s``origin([set])``
Changesets that were specified as a source for the grafts, transplants or
rebases that created the given revisions. Omitting the optional set is the
same as passing all(). If a changeset created by these operations is itself
specified as a source for one of these operations, only the source changeset
for the first operation is selected.
csUt�|�}|dkrdSx/trPt�|�}|dkrG|S|}q"WdS(N(RbRR|(R R�tprev(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _firstsrcs N(RRR[R<R�(RRZRRyRRBto((Rs4/sys/lib/python2.7/site-packages/mercurial/revset.pytorigins!%c Csiddl}t|ddtd��}|rFt|dtd��pId}|jj|p^d|pgd �}|j|�\}}|j|||g�\}}|r�g|D]} |j| �^q�}n|j |i|�}
|jj
�tj||
d
|�}|jj
�|j}tg|jD]}
|j|
�^q(�}g|D]}
|
|krM|
^qMS(s}``outgoing([path])``
Changesets not found in the specified destination repository, or the
default push location.
i�Niis"outgoing takes one or no argumentss#outgoing requires a repository pathR�sdefault-pushR�t onlyheads(thgRXRRUtuit
expandpathtparseurlt
addbranchrevstlookuptpeert
pushbuffert discoverytfindcommonoutgoingt popbufferRRtmissingR (RRZRRRNtdesttbranchesR
tcheckoutR tothertoutgoingRRBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR-(s%!%
+cCs�|dkrE||j�j�}g|D]}||kr)|^q)St�}|j}x:t|t|�|�D] }|j|j|�d�qpWg|D]}||kr�|^q�S(sS``p1([set])``
First parent of changesets in set, or the working directory.
iN( RR�R RRR[R<RR(RRZRR�RBR�R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR�?s# cCs�|dkrk||j�}y7|dj�}g|D]}||kr6|^q6SWqktk
rggSXnt�}|j}x:t|t|�|�D] }|j|j |�d�q�Wg|D]}||kr�|^q�S(sT``p2([set])``
Second parent of changesets in set, or the working directory.
iN(
RR!R t
IndexErrorRRR[R<RR(RRZRR�R�RBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytp2Ms'
cCs�|dkrOtd�||j�D��}g|D]}||kr3|^q3St�}|j}x6t|t|�|�D]}|j|j|��qzWg|D]}||kr�|^q�S(sg``parents([set])``
The set of all parents for all changesets in set, or the working directory.
css|]}|j�VqdS(N(R (RvR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>dsN( RttupleR!RRR[R<R�R(RRZRR�RBR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR!_s # cCs3y)t|d�}|dkr(t�nWn,ttfk
rWtjtd���nXt�}|j}x�t|||�D]�}|dkr�|j |�q}|dkr�|j |j
|�d�q}|dkr}|j
|�}t|�dkr|j |d�qq}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~R�RRGRHRRRR[RRRE(RRZRRhR�RRBR!((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`(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytpresent�s cCsTt|ddtd��|j}g|D]'}|j||�tjkr)|^q)S(s+``public()``
Changeset in public phase.ispublic takes no arguments(RXRR�R�R�tpublic(RRZRR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR3�s cCs~ddl}t|ddtd��}d}t|�dkr[t|dtd��}n|dkrz|dj�}nd}t|�d kr�t|d td
��}n|jj|p�d�}|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.
i�Niis%remote takes one, two or no argumentsRAsremote requires a string idR�is!remote requires a repository pathR�(
RRXRRERUR�RRR R!R"R#R (RRZRRRNtqR)R*R
R+R R,RhRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytremote�s,%
cCs(t|td��}t|||d�S(sM``removes(pattern)``
Changesets which remove files matching pattern.
sremoves requires a patterni(RURRs(RRZRRt((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytremoves�scCs�t|ddtd��}y#tt|dtd���}Wn,ttfk
rltjtd���nXg|D]}||krt|^qtS(sD``rev(number)``
Revision with the given numeric identifier.
isrev requires one argumentisrev requires a numbersrev expects a number(RXRR~RURR�RGRH(RRZRRNRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR �s#cs4t|ddtd��}t��j|d�}dg}t|�dkrqt|dtd��j�}ng}xq|D]i}|dkr�|ddd g7}q~|d
kr�|dd
g7}q~|dkr�d}n|j|�q~Wt|�}d
|krd|kr|j d
�ndddd dd
dddd
g
��fd�}t
|�}|jd|�g�i
�fd�d6�fd�d6�fd�d 6�fd�d6�fd�d6�fd�d6�fd�d6�fd�d6�fd�d
6�fd�d
6} xU|D]M}
| j|
d �}|d kratjtd�|
��n�j|�q!W�fd�}t�}
x�|D]|}||�}xg|D]_}t}x:t��D],\}}||||�kr�t}Pq�q�W|r�|
j|�q�q�Wq�Wg|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 argumentR�R�R�tdiffR�R�tsummaryR�R!R�tsubstatecs0y�j|�SWntk
r+t��SXdS(N(tindexR�RE(R�(t
fieldorder(s4/sys/lib/python2.7/site-packages/mercurial/revset.pytfieldkeyfuncs
tkeycs�|j�S(N(R�(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC!scs�|j�S(N(R�(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC"scs�|j�S(N(R�(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC#scs�|j�S(N(R�(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC$scs�|j�S(N(R�(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC%scs�|j�S(N(R!(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC&scs�|j�S(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�|j�j�dS(Ni(R�t
splitlines(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC)scst�|jdt��S(Ntgit(R<R8R|(RB(R(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC*ss,unexpected field name passed to matching: %scsg�D]}||�^qS(N((RBR�(t
getfieldfuncs(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC6sN(RXRR[RRERUtsplitR
RtdiscardR<tsortR�RRGRHR|t enumerateR�R(RRZRRNR
t fieldlisttfieldsR�R=t_funcstinfotgetfieldtgetinfotmatchesR ttargetRBR�RhR�((R<RARs4/sys/lib/python2.7/site-packages/mercurial/revset.pytmatching�sl
cCs>t|||�}t|t�s0t|�}n|j�|S(s/``reverse(set)``
Reverse order of set.
(R[t
isinstanceR<treverse(RRZRRN((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�(RRZRRPRBR�((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(RXRR�R�R�tsecret(RRZRR�RB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRQXs cCsnt|ddtd��}d}t|�dkrOt|dtd��}n|d}|j�}g}d�}x�t|||�D]�}||}g} x�|D]�}
|
dkr�| j|�q�|
dkr� j|�q�|
d kr| j|j��q�|
d
kr-| j||j���q�|
dkrO| j|j��q�|
dkrw| j||j���q�|
d
kr�| j|j ��q�|
dkr�| j||j ���q�|
dkr� j|j
�d�q�|
dkr| j|j
�d�q�tjtd�|
��q�W| j|�|j| �q�W|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�|D��S(NR�css%|]}tdt|��VqdS(i�N(tchrRJ(RvRO((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>xs(R(RP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytinvertwss-revR�s-branchR�s-descsuser authors
-user -authorR�s-datesunknown sort key %ri�(RXRRERURBR[R
R�R�R�R�RGRHRD(RRZRRNtkeysRPRSRBROR�tk((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRD`sJ
cCs�|jd�rn|d}ytj|�}Wn/tjk
r]}tjtd�|��nXd||jfS|jd�r�|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: %sR�sliteral:iR�(R�R�R�RGRHRR�t__eq__(R�tregexR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s
cs@t��\}�}|dkr3�fd�}n|�|fS(NR�cs
�|kS(N((RP(R�(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRC�s(R�(R�R�R�((R�s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��sc
Csft|ddtd��}|j}|rt|dtd��}t|�\}}}|dkr�|jjj|d�}|dkr�t j
td�|��nt||j�g�} qCtg|j
�D]'\}
}||
�r�|j|�^q��} n@tg|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 stringR�stag '%s' does not existttipN(RXRRRUR�t
_tagscachettagsR�RRR�RR ttagslist(
RRZRRyRR�R�R�ttnRPRRhRB((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyttag�s
C@cCst|||�S(N(R](RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyttagged�scCsNt|ddtd��tj|d�}g|D]}||kr2|^q2S(sH``unstable()``
Non-obsolete changesets with obsolete ancestors.
isunstable takes no argumentstunstable(RXRR�R�(RRZRt 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�(RRZR((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scCs�t|d�}|sgSt|t�s7t|�}ng|jd�D]}||j�^qG}g|D]}||krj|^qjS(Nsinternal errort(RURORRBR (RRZRRPRBR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt_list�s,RutallR{R}R�R�R�R�R�RR�R�R�R�R�R�R�R�R�R�R�R�R�R�R_R�R�RR�R�R�R�RRtidRR
R�R�RWRRRRRR-R�R/R!R2R3R5R6R RPRRDRQRNR]R^R�R_RbcCs�|dkrd|fSd}|r+d}n|d}|dkretd|dd|dff|�S|dkr�td d(|df|�S|dkr�td d)|df|�S|dkr�tdd*|df|�S|dkr�d|dd+f|�S|dkr3tddt|dtd��f|�S|dkrI||fS|dkr�t|dt�\}}t|dt�\}}t||�}||kr�||||ffS||||ffS|dkr>t|dt�\}}t|dt�\}}||kr"||}}nt||�|||ffS|dkrvt|d|�} | d|| dffS|dkr�t|d|�} | d|| dffS|dkr�t|d|�S|dkr�|dkrYd|df}
|dddkr$td|
|ddf|�S|dddkrYtd|
|ddf|�Snt|d|�\}}t|d|�\}}|||||ffS|d kr�t|dtd��}t|d|�\}}|dkr�}ns|d!kr
d"}n^|d#krd$}nI|d%kr8d|}n0|d&krMd}n|d'krbd }nd}||||d|ffSd|fS(,Niig�,R7R5iR.R%R>R{R0R�R1R2R?t0R3RXR+R-scan't negate thatsstring symbol negateR9R)R#s'dagrange range list parent ancestorspecRR/snot a symbols>author branch closed date desc file grep keyword outgoing useri
smodifies adds removesiR�idR'sreverse limit firstRD(ssymbols ancestors(ssymbolsdescendants(sstringRe(sstringstip(RtoptimizeRURR|RR�RW(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_getaliasarg�s"cCs{t|t�rwt|�}|dk rV|s:||krVtjtd�d��nx|D]}t||�q]WndS(s�Check 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(RqtknownR�R((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRs�s
trevsetaliascBs&eZejd�ZdZd�ZRS(s^([^(]+)\(([^)]+)\)$cCs|jj|�}|r�|jd�|_dd|jd�ff|_g|jd�jd�D]}|j�^qa|_xE|jD]}|j|d|f�}q�Wn||_d|f|_t |�\|_
}|t|�krtj
td�|��nt|j
|j�dS( seAliases like:
h = heads(default)
b($1) = ancestors($1) - ancestors(default)
iR%R>iR=s
_aliasarg(%r)s
invalid tokenN(tfuncreR�R#R�RqRBtstripRytreplacetparsetreplacementRERGRHRRs(tselfR�R�RgRR�RM((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt__init__�s4 N(t__name__t
__module__R�R�RvRRyR|(((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyRu�scCst|t�r|r|ddkr{t|�dkr{|d}|j|�}|r{|jdkr{|j|kr{|Sn|ddkrt|�dkr|dddkrt|d�dkr|dd}|j|�}|r|jdk r|j|d kr|SqqndS(sRIf tree looks like an unexpanded alias, return it. Return None
otherwise.
iR>iiR%N(ROR0RER�RyRRq(taliasesRqR�talias((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt _getalias�s"
$"*(
csU|st|t�r|St|�}|dk r;�|St�fd�|D��S(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 <genexpr>�sN(ROR0RrR(RqRyR�((Rys4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��scst|t�s|St�|�}|dk rY|�krYtjtd�|j��n�j|�|j�kr�t �|j
����|j<n�|j}�j�|jdk r{t
|d�}t|�t|j�kr
tjtd�t|���ng|D]}t �|g��^q}t|tt|j|���}q{n"t���fd�|D��}|S(s�Expand aliases in tree, recursively.
'aliases' is a dictionary mapping user defined aliases to
revsetalias objects.
s0infinite expansion of revset alias "%s" detectedisinvalid number of arguments: %sc3s$|]}t�|���VqdS(N(t_expandaliases(RvR(Rtcachet expanding(s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>
sN(ROR0R�RRGRHRR�R
R�RzRRyRVRER�tdicttzip(RRqR�R�R�tresultRNRp((RR�R�s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s.
('
cCs_t|�i}x9|jd�D](\}}t||�}|||j<q Wt||gi�S(NRu(RstconfigitemsRuR�R�(RRqRRUtvR�((s4/sys/lib/python2.7/site-packages/mercurial/revset.pytfindaliasess
cs�|stjtd���nt|�\�}|t|�kr]tjtd�|��n|rut|���nt�t�\}��fd�}|S(Nsempty querys
invalid tokencst||��S(N(R[(RRZ(Rq(s4/sys/lib/python2.7/site-packages/mercurial/revset.pytmfunc!s(RGRHRRyRER�RfR|(RtspecRMtweightR�((Rqs4/sys/lib/python2.7/site-packages/mercurial/revset.pyR�scs@d���fd����fd��d}d}d}x�t|�kr;||}|dkr$|d7}||}|dkr�||7}q.|dkr�|�|||�7}|d7}q.|d kr|d7}||}|�t||�|�7}|d7}q.tjd
|��n
||7}|d7}q?W|S(s/
This is a convenience function for using revsets internally, and
escapes arguments appropriately. Aliases are intentionally ignored
so that intended expression behavior isn't accidentally subverted.
Supported arguments:
%r = revset expression, parenthesized
%d = int(arg), no quoting
%s = string(arg), escaped and single-quoted
%b = arg.branch(), escaped and single-quoted
%n = hex(arg), single-quoted
%% = a literal '%'
Prefixing the type with 'l' specifies a parenthesized list of that type.
>>> 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|dkro�tj|��S|dkr��|j��SdS(NRQRPRBs(%s)RhRq(R�R~RyRthexR�(ROR�(R�(s4/sys/lib/python2.7/site-packages/mercurial/revset.pytargtypeIs
cs�t|�}|dkrdS|dkr9�||d�S|dkr`ddjd�|D��S|dkr}ddj|�S|d kr�ddjd
�|D��S|dkr�ddjd�|D��S|d
}d�|| |��|||�fS(Nis _list('')iRQs_list('%s')Racss!|]}tt|��VqdS(N(R�R~(RvRp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>]sRPRhcss|]}tj|�VqdS(N(RR�(RvRp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>asRqcss|]}|j�VqdS(N(R�(RvRp((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>csis
(%s or %s)(RER(RPRRNRg(R�tlistexp(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR�Vs
R�it%itdsnbrRNs&unexpected revspec format character %s(RER<RR�(texprRytretRMR�RORQ((R�R�R�s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt
formatspec%s2!
csB�fd��g}�|d|�djd�|D��}|S(Ncs�t|t�s |ddkr<|j|t|�f�nk|j|d|df�x&|dD]}�||d|�qbW|dd|dddfg|d)dS( NiR?R>s(%sii�R$(sstringssymbol(ROR0R
R�(RqtleveltlinesRP(t
_prettyformat(s4/sys/lib/python2.7/site-packages/mercurial/revset.pyR��s is
css#|]\}}d||VqdS(s N((RvRNRP((s4/sys/lib/python2.7/site-packages/mercurial/revset.pys <genexpr>�s(R(RqR�toutput((R�s4/sys/lib/python2.7/site-packages/mercurial/revset.pytprettyformat�s
(sgroupiR$(sfunciR$(sancestori(sparenti(s
parentposti(snegatei(sminusi(sdagrangeprei(sdagrangei(sdagrangeposti(sdagrangeprei(sdagrangei(sdagrangeposti(srangeprei(srangei(s rangeposti(snoti
(snoti
(sandi(sandi(sori(sori(sori(slisti(iNN(ssymbol(sstring(iNN(ssymbols _aliasarg(�R�tparserRRGR%R�R�RR�R�ti18nRR�RR�R�RRR"RtelementsRRKRSRURVRXR[RbRcReRiR/RkRnRoRrR%RuR'R�RzR{R}R�R�R�R�R�R�R�R�RsR�R�R�R�R�R�R�R�R�R�R�R�R�R�R_R�RR�R�R�R�R�R�R�R�RRRR�R
RRRR�RRRR-R�R/R!R1R2R3R5R6R RNRPRRQRDR�R�R]R^R_R�RbRdRYRfRpRrRstobjectRuR�R�R�R�RyR�R�R�t
i18nfunctions(((s4/sys/lib/python2.7/site-packages/mercurial/revset.pyt<module>s�H
E &
, ? # p
8 '
N
^
|