��c@s�ddlZddlZddlZddlZddlZddlmZidd`dafd6d dbdcfd
6dddfd6ddefd6d ddffd6d ddgfd6dddhfd6dddifd6dddjfd6dddkfd6dld6ddmdfd6ddndfd6dod6Ze dddg�Z
dZd�Zejee�j
Z
d �Zd!�Zd"�Zd#�Zd$�Zd%�Zd&�Zd'�Zd(�Zd)�Zd*�Zd+�Zd,�Zd-�Zd.�Zd/�Zd0�Zd1�Zd2�Z d3�Z!d4�Z"d5�Z#d6�Z$d7�Z%d8�Z&e'd9dpd:dqd;drd<dsd=dtd>dud?dvdAdw�Z(dB�Z)dC�Z*dD�Z+dE�Z,dF�Z-dG�Z.dH�Z/iedI6e dJ6edK6e.dL6edM6e,dN6e-dO6e!dP6e&dQ6edR6e%dS6edT6edU6e#dV6e+dW6e"dX6edY6e$dZ6e/d[6Z0i ed6ed6ed6ed6ed6ed6ed6ed6ed6Z1d\e2fd]��YZ3d^�Z4dJdPdQdWdXgZ5d_�Z6e0j7�Z8dS(xi�N(t_itgroupit)tfunct(itnegateitminust-i
tnott!tandt&itort|t+itlistt,itsymboltstringtends .*{}[]?/\ccsadt|�}}x9||krN||}|j�r;n|dkrX|d|fVn�dks�|dkrU|||d!dkrU|dkr�|d7}||}d �}n d
�}|d7}|}xr||kr9||}|dkr|d7}q�n||kr,d||||!�|fVPn|d7}q�Wtjtd
�|��n�j�s|tkst|�dkr)|}|d7}xR||kr�|}|j�p�|tkp�t|�dks�Pn|d7}q�W|||!}|t kr|d|fVnd||fV|d8}ntjtd�|��|d7}qWdd|fVdS(Nis(),-|&+!s"'trisr'sr"icSs|S(N((tx((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt<lambda>-scSs
|jd�S(Ns
string-escape(tdecode(R((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR/ss\Rsunterminated stringiRssyntax errorR(sr'sr"(
tlentisspacetNoneterrort
ParseErrorRtisalnumt globcharstordtkeywords(tprogramtpostltcRtstdtsym((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyttokenize sT
*
*
cCsA|r.|ddks&|ddkr.|dStj|��dS(NiRRi(RR(Rterr((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt getstringSs&cCs7|stjtd���nt|d||d�S(Nsmissing argumentii(RRRtmethods(tmctxR((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytgetsetXscCs8|j|g�}g|jD]}||�r|^qS(N(tmatchertsubset(R,Rtmtf((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt stringset]scCst|jt||��|�S(N(R-tnarrow(R,Rty((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytandsetascCsEt||�}t||�}|g|D]}||kr(|^q(S(N(R-(R,RR4txltylR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytorsetdscCs;tt||��}g|jD]}||kr|^qS(N(tsetR-R/(R,RR%R((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytnotsetjscCsGt||�}tt||��}g|D]}||kr+|^q+S(N(R-R9(R,RR4R6R7R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytminussetnscCstjtd���dS(Ns can't use a list in this context(RRR(R,tatb((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytlistsetsscCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(sB``modified()``
File that is modified according to status.
ismodified takes no arguments(tgetargsRtstatusR/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytmodifiedvscCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(s<``added()``
File that is added according to status.
isadded takes no argumentsi(R?RR@R/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytaddedscCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(s@``removed()``
File that is removed according to status.
isremoved takes no argumentsi(R?RR@R/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytremoved�scCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(s@``deleted()``
File that is deleted according to status.
isdeleted takes no argumentsi(R?RR@R/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytdeleted�scCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(s�``unknown()``
File that is unknown according to status. These files will only be
considered if this predicate is used.
isunknown takes no argumentsi(R?RR@R/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytunknown�scCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(s�``ignored()``
File that is ignored according to status. These files will only be
considered if this predicate is used.
isignored takes no argumentsi(R?RR@R/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytignored�scCsOt|ddtd��|j�d}g|jD]}||kr3|^q3S(s<``clean()``
File that is clean according to status.
isclean takes no argumentsi(R?RR@R/(R,RR%R1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytclean�scCsV|ddkr5|dtkr5t|d||�Stjtd�|d��dS(NiRisnot a function: %s(tsymbolsRRR(R,R<R=((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR�s cCs:|s
gS|ddkr3t|d�|dgS|gS(NiRii(tgetlist(R((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyRI�s
cCsFt|�}t|�|ks0t|�|krBtj|��n|S(N(RIRRR(RtmintmaxR)R#((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR?�s$cCsRt|ddtd��g|j�D](}tj|j|j��r&|^q&S(sJ``binary()``
File that appears to be binary (contains NUL bytes).
isbinary takes no arguments(R?Rtexistingtutiltbinarytctxtdata(R,RR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyRN�scCsNt|ddtd��g|j�D]$}|jj|�dkr&|^q&S(s6``exec()``
File that is marked as executable.
isexec takes no argumentsR(R?RRLROtflags(R,RR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytexec_�scCsNt|ddtd��g|j�D]$}|jj|�dkr&|^q&S(s8``symlink()``
File that is marked as a symlink.
issymlink takes no argumentsR#(R?RRLRORQ(R,RR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytsymlink�scCs}t|ddtd��|jj�dk r2gStj|jj�}g|jD](}||krQ||dkrQ|^qQS(sT``resolved()``
File that is marked resolved according to the resolve state.
isresolved takes no argumentsRN( R?RROtrevRtmerget
mergestatet_repoR/(R,RtmsR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytresolved�s
cCs}t|ddtd��|jj�dk r2gStj|jj�}g|jD](}||krQ||dkrQ|^qQS(sX``unresolved()``
File that is marked unresolved according to the resolve state.
isunresolved takes no argumentstuN( R?RRORTRRURVRWR/(R,RRXR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt
unresolved�s
cCsQt|ddtd��|jjjj}g|jD]}||�r5|^q5S(sG``hgignore()``
File that matches the active .hgignore pattern.
ishgignore takes no arguments(R?RRORWtdirstatet_ignoreR/(R,RtignoreR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pythgignore�scCs�y"tjt|td���}Wn/tjk
rS}tjtd�|��nXg|j�D](}|j|j|j ��ra|^qaS(sD``grep(regex)``
File contains the given regular expression.
sgrep requires a patternsinvalid match pattern: %s(
tretcompileR*RRRRLtsearchRORP(R,RRteR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytgrep�s
"tktKtkBtKBtMtMBtGitGBcCs�ye|j�}xHtj�D]:\}}|j|�rtt|t|� �|�SqWt|�SWn*tk
r�tj t
d�|��nXdS(Nscouldn't parse size: %s(tstript_unitstitemstendswithtinttfloatRt
ValueErrorRRR(R%Retv((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt
_sizetoint
s#
cCs�y�|j�}x�tj�D]~\}}|j|�r|t|� }d}d|kr~|dt|jd�d�:}ntt|�||�dSqWt|�SWn*tk
r�t j
td�|��nXdS(Ng�.i
iscouldn't parse size: %s(RmRnRoRpRtsplitRqRrRsRRR(R%ReRttntinc((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt
_sizetomaxs$
cs�t|td��j�}d|krl|jdd�\��t���t�����fd�}n'|jd�r�t|d���fd�}n�jd�r�t|d���fd �}n�|jd
�r�|d���fd�}n�|jd�r0t|d���fd
�}nc|djsM|ddkrzt|��t|����fd�}ntj td�|��g|j
�D]%}||j|j��r�|^q�S(s``size(expression)``
File size matches the given expression. Examples:
- 1k (files from 1024 to 2047 bytes)
- < 20k (files less than 20480 bytes)
- >= .5MB (files at least 524288 bytes)
- 4k - 1MB (files from 4096 bytes to 1048576 bytes)
ssize requires an expressionRics|�ko|�kS(N((R(R<R=(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR7ss<=ics
|�kS(N((R(R<(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR:st<cs
|�kS(N((R(R<(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR=ss>=cs
|�kS(N((R(R<(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR@st>cs
|�kS(N((R(R<(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyRCsiRvcs|�ko|�kS(N((R(R<R=(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyRGsscouldn't parse size: %s(
R*RRmRwRut
startswithtisdigitRzRRRLROtsize(R,RtexprR0R1((R<R=s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR's0cCs�t|td��}g}x�|j�D]w}|j|j�}y|j|�Wn=tk
r~tjtd�|��nt k
r�q(nX|j
|�q(W|S(s�``encoding(name)``
File can be successfully decoded with the given character
encoding. May not be useful for encodings other than ASCII and
UTF-8.
s"encoding requires an encoding namesunknown encoding '%s'(R*RRLRORPRtLookupErrorRMtAborttUnicodeDecodeErrortappend(R,RtencR%R1R&((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytencodingMs
cCs�t|td��}g}x�|j�D]�}|j|j�}tj|�rVq(n|dksn|dkr�d|kr�|j|�q(|dkr�tj d|�r�|j|�q(|dkr(tj d|�r(|j|�q(q(W|S( s�``eol(style)``
File contains newlines of the given style (dos, unix, mac). Binary
files are excluded, files with mixed line endings match multiple
styles.
s"encoding requires an encoding nametdostwins
tunixs(?<!
)
tmacs
(?!
)(
R*RRLRORPRMRNR�R`Rb(R,RR�R%R1R&((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyteolds$cCsvt|ddtd��g}xP|jD]E}|j|j�}|r)|dj�|kr)|j|�q)q)W|S(s<``copied()``
File that is recorded as being copied.
iscopied takes no arguments(R?RR/ROtparentstpathR�(R,RR%R1tp((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytcopied{scs�t|ddtd��|j}t|j�}|r�t|td���ddl}|j��}|r��fd�}n$|j|jj d�gd |�}g|D]}||�r�|^q�Sg|D]}|^q�SdS(
sT``subrepo([pattern])``
Subrepositories whose paths match the given pattern.
iis"subrepo takes at most one arguments*subrepo requires a pattern or no argumentsi�Ncs
|�kS(N((R%(tpat(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR0�stRO(
R?RROtsortedtsubstateR*tmatchtpatkindRWtroot(R,RROtsstatetmatchmodtfastR0tsub((R�s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytsubrepo�s $#RBRNRGR�RDR�R�texecRdRFR_RARCRYRRSRER[R�tmatchctxcBsDeZddd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs||_||_||_dS(N(ROR/t_status(tselfROR/R@((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt__init__�s cCs|jS(N(R�(R�((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR@�scCs|jj|�S(N(ROR�(R�tpatterns((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR.�scCs&g|D]}||jkr|^qS(N(R/(R�tfilesR1((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pytfilter�scsr�jdk rCt�jd��t�jd�jd��nt��t�����fd��jD�S(Niiic3s<|]2}|�jkr$|�ks0|�kr|VqdS(N(RO(t.0R1(RCR�RE(s5/sys/lib/python2.7/site-packages/mercurial/fileset.pys <genexpr>�s(R�RR9R/(R�((RCR�REs5/sys/lib/python2.7/site-packages/mercurial/fileset.pyRL�s! cCst|j|j|�|j�S(N(R�ROR�R�(R�R�((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR3�sN( t__name__t
__module__RR�[email protected]�RLR3(((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR��s cCs}t|t�ry|ddkrN|dddkrN|dd|krNtSnx(|dD]}t||�rYtSqYWntS(NiRiR(t
isinstancettupletTruet_intreetFalse(tfuncsttreeR%((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyR��s$c
Cs?t|�\}}|t|�kr?tjtd�|��ntdddddddg|�s�|j�dkrtt|�rtdg|�}tdg|�}|j }|j
|j�|d|d|dt�}g}xB|D]} |j
| �q�n$d}t|j|jg���}tt|||�|�S( Ns
invalid tokenRARBRCRDRERFRG(tparseRRRRR�RTRt_existingcallersRWR@tp1R�textendRtwalkR�R-R�(
ROR�R�R"RERFRR@R/R$((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt
getfileset�s"!
(sgroupiR(sfunciR(snegatei(Ri(snoti
(snoti
(sandi(sandi(sori(sori(sori(slisti(iNN(ssymbol(sstring(iNNiiiiiii@i@(9tparserRRMRUR`ti18nRRtelementsR9R RR(R�R*R-R2R5R8R:R;R>RARBRCRDRERFRGRRIR?RNRRRSRYR[R_RdtdictRnRuRzRR�R�R�R�RHR+tobjectR�R�R�R�tvaluest
i18nfunctions(((s5/sys/lib/python2.7/site-packages/mercurial/fileset.pyt<module>s�<
1
&
|