
    	^c                     <    d dl mZ d dlmZmZmZmZ d Zd Zd Z	dS )   )_)errorfilesetfilesetlangpycompatc                 n    t          j        | t          d                    }t          j        |          S )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$EFFDt$$$    c                    	
  s!t          j        t          d                     d         }|dk    rt           d                   S |dv rt	          j         dht          d                    }|                    d          rN|d	d          t          j                  D ]*}|d
v r$t          j        t          d          |z            +fdS |                    d          r!|dd          
t          
          
fd}|S t          j        t          d          |z  t          d                    |dv rd  dd          D             		fdS |dk    r0t           d                   t           d	                   fdS |dk    r fdS |dk    rXd d  fdd}t	          j
         d                   }||v r||         S t          j        ||                                          |dk    r0t           d                   t           d	                   fd S |d!k    r0t          j        t          d"          t          d#                    t          j        d$ fz            )%Ns   missing argument    s
   withstatusr   >      string   symbol   kindpats   paths   invalid file patterns   **   s   *{}[]?/\s   reserved character: %sc                 .    |                                S N)endswith)nsexts     r   <lambda>z_compile.<locals>.<lambda>'   s    

3 r   s   path:   c                 v    |                                o#t          |           k    p| dz            dk    S )Nr      /)
startswithlen)r   r   ppls     r   r   z_compile.<locals>.<lambda>+   s<    Q\\!__ A"6"rAv+$ 6 r   s   unsupported file pattern: %ss#   paths must be prefixed with "path:")hint>      or   patternsc                 ,    g | ]}t          |          S  _compile).0r   s     r   
<listcomp>z_compile.<locals>.<listcomp>4   s    ///!///r   c                 @     t           fdD                       S )Nc              3   0   K   | ]} |          V  d S r   r(   )r+   fr   r   s     r   	<genexpr>z-_compile.<locals>.<lambda>.<locals>.<genexpr>5   s-      77A!Q777777r   )any)r   r   funcss   ``r   r   z_compile.<locals>.<lambda>5   s)    C7777777777 r   s   andc                 4     | |          o | |          S r   r(   r   r   func1func2s     r   r   z_compile.<locals>.<lambda>9   s     EE!QKK7EE!QKK r   s   notc                 D     t          d                   | |           S )Nr   r)   r   r   trees     r   r   z_compile.<locals>.<lambda>;   s#     1a 1 1!Q 7 77 r   s   funcc                     dS )NTr(   r   r   s     r   r   z_compile.<locals>.<lambda>>   s     r   c                     dS )NFr(   r;   s     r   r   z_compile.<locals>.<lambda>?   s    % r   c                 @     t          d                   |          S )Nr   )r   r8   s     r   r   z_compile.<locals>.<lambda>@   s    /&a//!"4"4 r   )s   alls   nones   sizes   minusc                 6     | |          o | |           S r   r(   r4   s     r   r   z_compile.<locals>.<lambda>K   s"    EE!QKK;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   r*   r   
getpatternr    r   bytestrr!   	getsymbolUnknownIdentifierkeysProgrammingError)r9   opnamecr/   symbolsr   r5   r6   r2   r"   r#   s   `     @@@@@@r   r*   r*      s    7q!455666	aB	]Q   	1	1	1%7)Q677
 
 ??5!! 	qrr(C%c** M M$$*1-F+G+G!+KLLL %/////__X&& 	QRRAQB    A H-..59::
 
 
 	
 
#	#	#//d122h///77777	va!!a!!777777	v77777	w%%''4444
 
 $T!W--7??4= %dGLLNN;;;	xa!!a!!;;;;;;	w122788
 
 
 	
 
 !4w!>
?
??r   c                     t          j        |           }t          j        |          }t          j        |          }t	          |          S )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optimizer*   )textr9   s     r   compilerO   T   s@     T""Dt$$D%%DD>>r   N)
i18nr    r   r   r   r   r   r*   rO   r(   r   r   <module>rR      s                    % % %9@ 9@ 9@x    r   