
    6h                     F    S SK Jr  SSKJr  SSKJrJrJrJr  S r	S r
S rg)	    )annotations   )_)errorfilesetfilesetlangpycompatc                n    [         R                  " U [        S5      5      n[        R                  " U5      $ )Ns   size requires an expression)r   	getstringr   r   sizematcher)xexprs     7/usr/lib/python3/dist-packages/mercurial/minifileset.py_sizepr      s+      A&D$EFDt$$    c                  ^ ^^^	^
^^ T (       d  [         R                  " [        S5      5      eT S   nUS:X  a  [        T S   5      $ US;   a  [        R
                  " T S1[        S5      5      nUR                  S5      (       aP  US	S  m[        R                  " T5       H+  nUS
;   d  M  [         R                  " [        S5      U-  5      e   U4S j$ UR                  S5      (       a  USS  m[        T5      mUU4S jnU$ [         R                  " [        S5      U-  [        S5      S9eUS;   a%  T SS   Vs/ s H  n[        U5      PM     snm
U
4S j$ US:X  a#  [        T S   5      m[        T S	   5      m	UU	4S j$ US:X  a  U 4S j$ US:X  aR  S S U 4S jS.n[        R                  " T S   5      nX&;   a  Xb   $ [         R                  " X&R                  5       5      eUS:X  a#  [        T S   5      m[        T S	   5      m	UU	4S j$ US :X  a'  [         R                  " [        S!5      [        S"5      S9e[         R                  " S#T 4-  5      es  snf )$Ns   missing argumentr   s
   withstatusr   >      string   symbol   kindpats   paths   invalid file patterns   **   s   *{}[]?/\s   reserved character: %sc                &   > U R                  T5      $ N)endswith)nsexts     r   <lambda>_compile.<locals>.<lambda>(   s    

3r   s   path:   c                t   > U R                  T5      =(       a     [        U 5      T:H  =(       d    U TTS-    S:H  $ )Nr      /)
startswithlen)r   r   ppls     r   r   r   ,   s6    Q\\!_ A"6"rAv$ 6r   s   unsupported file pattern: %ss#   paths must be prefixed with "path:")hint>      or   patternsc                4   >^ ^ [        U U4S jT 5       5      $ )Nc              3  4   >#    U  H  o" TT5      v   M     g 7fr    ).0fr   r   s     r   	<genexpr>-_compile.<locals>.<lambda>.<locals>.<genexpr>6   s     7A!Qs   )any)r   r   funcss   ``r   r   r   6   s    C777r   s   andc                2   > T" X5      =(       a    T" X5      $ r   r+   r   r   func1func2s     r   r   r   :   s    E!K7E!K7r   s   notc                6   > [        TS   5      " X5      (       + $ )Nr   )_compiler   r   trees     r   r   r   <   s    a 1! 77r   s   funcc                    g)NTr+   r   r   s     r   r   r   ?   s    r   c                    g)NFr+   r;   s     r   r   r   @   s    %r   c                ,   > [        TS   5      " U5      $ )Nr   )r   r8   s     r   r   r   A   s    &a/!"4r   )s   alls   nones   sizes   minusc                <   > T" X5      =(       a    T" X5      (       + $ r   r+   r3   s     r   r   r   L   s    E!K;aO;r   s   lists    can't use a list in this contexts   see 'hg help "filesets.x or y"'s   illegal tree: %r)r   
ParseErrorr   r7   r   
getpatternr"   r	   bytestrr#   	getsymbolUnknownIdentifierkeysProgrammingError)r9   opnamecr-   r   symbolsr   r4   r5   r1   r$   r%   s   `      @@@@@@r   r7   r7      sH   q!4566	aB	]Q  	1	1%%7)Q67
 ??5!!qr(C%%c*$**1-F+G!+KLL + 0/__X&&QRAQBA H-.59:
 	
 
#	#&*12h/h!h/77	va!a!77	v77	w%'4
 $$T!W-?= %%dLLN;;	xa!a!;;	w1278
 	
 
 
 !4w!>
??; 0s   ;Ic                    [         R                  " U 5      n[         R                  " U5      n[         R                  " U5      n[	        U5      $ )a  generate a function (path, size) -> bool from filter specification.

"text" could contain the operators defined by the fileset language for
common logic operations, and parenthesis for grouping.  The supported path
tests are '**.extname' for file extension test, and '"path:dir/subdir"'
for prefix test.  The ``size()`` predicate is borrowed from filesets to test
file size.  The predicates ``all()`` and ``none()`` are also supported.

'(**.php & size(">10MB")) | **.zip | (path:bin & !path:bin/README)' for
example, will catch all php files whose size is greater than 10 MB, all
files whose name ends with ".zip", and all files under "bin" in the repo
root except for "bin/README".
)r   parseanalyzeoptimizer7   )textr9   s     r   compilerO   U   s>     T"Dt$D%DD>r   N)
__future__r   i18nr    r   r   r   r	   r   r7   rO   r+   r   r   <module>rS      s(    #  %9@xr   