https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/mercurial/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/mercurial/__pycache__/fileset.cpython-310.pyc
o

�]Lb�J�@s<ddlmZddlZddlZddlmZddlmZddlm	Z	m
Z
mZm
ZmZmZmZmZddlmZe
jZe
jZe
jZe
jZe
jZe
jZe
jZe
j Z e
j!Z!dd	�Z"d
d�Z#dd
�Z$dd�Z%dd�Z&dd�Z'dd�Z(dd�Z)dd�Z*dd�Z+dd�Z,e
j-Z-e�.e-�Z/e/dded �d!d"��Z0e/d#ded �d$d%��Z1e/d&ded �d'd(��Z2e/d)ded �d*d+��Z3e/d,ded �d-d.��Z4e/d/ded �d0d1��Z5e/d2ded �d3d4��Z6e/d5ded �d6d7��Z7e/d8�d9d:��Z8e/d;ed<�d=d>��Z9e/d?�d@dA��Z:e/dB�dCdD��Z;e/dEed<�dFdG��Z<e/dHed<�dIdJ��Z=e/dKed<�dLdM��Z>e/dNed<�dOdP��Z?e/dQed<�dRdS��Z@dTdU�ZAdVdW�ZBe/dXed<�dYdZ��ZCe/d[ed<�d\d]��ZDe/d^ed<�d_d`��ZEe/da�dbdc��ZFe/dded<�dedf��ZGe/dged<�dhdi��ZHe/dj�dkdl��ZIe#e$e$e%e&e'e(e*e+e)e,dm�ZJGdndo�doeK�ZLdtdpdq�Zdrds�ZMe-�N�ZOdS)u�)�absolute_importN�)�_��getattr)�error�filesetlang�match�
mergestate�pycompat�	registrar�scmutil�util)�
stringutilcCs2|s	t�td���t|d|g|dd��R�S)Nsmissing argumentrr)r�
ParseErrorr�methods��mctx�x�r�3/usr/lib/python3/dist-packages/mercurial/fileset.py�getmatch)s rcCs"tt|d����}t|�|�|�S)Nsstatus hint must be a string)�set�	getstring�splitr�
withstatus)rr�hint�keysrrr�getmatchwithstatus/srcCs|�|g�S�N)�matcherrrrr�stringmatch4sr!cCst|t||tjtd���S)N�pattern must be a string)r!�_getkindpat�matchmod�allpatternkindsr)rr�yrrr�kindpatmatch8s��r'cs"tj��fdd�|D�}|�|�S)Ncsg|]
}t|�td���qS)r")�
getpatternr��.0r��allkindsrr�
<listcomp>Cs�z!patternsmatch.<locals>.<listcomp>)r$r%r )r�xs�patternsrr+r�
patternsmatchAs

�
r0cC�&t||�}t|�|�|�}t�||�Sr)r�narrowedr$�intersectmatchers�rrr&�xm�ymrrr�andmatchI�
r7cs�fdd�|D�}t�|�S)Ncsg|]}t�|��qSr)rr)�rrrr-Pszormatch.<locals>.<listcomp>)r$�unionmatcher)rr.�msrr9r�ormatchOs
r<cs$t||��|j�fdd�d�fd�S)Ncs
�|�Srr��f��mrr�<lambda>Vs
znotmatch.<locals>.<lambda>s<not %r>��predrepr)r�	predicaterrr?r�notmatchTs
rEcCr1r)rr2r$�differencematcherr4rrr�
minusmatchYr8rGcGstjtd�td�d��)Ns can't use a list in this contextssee 'hg help "filesets.x or y"')r)rrr)rr.rrr�	listmatch_s�rHcsHt|�}|tvrt|||�Sdd���fdd�t��D�}t�||��)NcSst|dd�duS)N�__doc__r)�fnrrrrAk�zfunc.<locals>.<lambda>csg|]
\}}�|�r|�qSrr)r*�srJ��keeprrr-mszfunc.<locals>.<listcomp>)�	getsymbol�symbols�itemsr�UnknownIdentifier)r�a�b�funcname�symsrrMr�funcfsrWs
modified()T)�
callstatus�weightcC�0t|ddtd��t|��j�}|j|jdd�S)z0File that is modified according to :hg:`status`.rsmodified takes no argumentssmodifiedrB)�getargsrr�status�modifiedrD�__contains__�rrrLrrrr]{�r]sadded()cCrZ)z-File that is added according to :hg:`status`.rsadded takes no argumentssaddedrB)r[rrr\�addedrDr^r_rrrra�r`ras	removed()cCrZ)z/File that is removed according to :hg:`status`.rsremoved takes no argumentssremovedrB)r[rrr\�removedrDr^r_rrrrb�r`rbs	deleted()cCrZ)zAlias for ``missing()``.rsdeleted takes no arguments�deletedrB�r[rrr\�deletedrDr^r_rrrre�r`res	missing()cCrZ)z/File that is missing according to :hg:`status`.rsmissing takes no argumentsrcrBrdr_rrr�missing�r`rfs	unknown()cCrZ)z/File that is unknown according to :hg:`status`.rsunknown takes no arguments�unknownrB)r[rrr\�unknownrDr^r_rrrrh�r`rhs	ignored()cCrZ)z/File that is ignored according to :hg:`status`.rsignored takes no arguments�ignoredrB)r[rrr\�ignoredrDr^r_rrrrj�r`rjsclean()cCrZ)z-File that is clean according to :hg:`status`.rsclean takes no arguments�cleanrB)r[rrr\�cleanrDr^r_rrrrl�r`rls	tracked()cCs$t|ddtd��|j|jjdd�S)z%File that is under Mercurial control.rstracked takes no argumentsstrackedrB)r[rrD�ctxr^rrrr�tracked�srnsbinary())rYcCs&t|ddtd��|jdd�ddd�S)z4File that appears to be binary (contains NUL bytes).rsbinary takes no argumentscSs|��Sr)�isbinary��fctxrrrrA��zbinary.<locals>.<lambda>sbinaryT�rC�cache�r[r�
fpredicaterrrr�binary�s
�rwsexec()c�.t|ddtd��|j�|j�fdd�dd�S)z"File that is marked as executable.rsexec takes no argumentsc���|�dkS)N�x��flagsr=�rmrrrA��zexec_.<locals>.<lambda>sexecrB�r[rrmrDrrr}r�exec_��r�s	symlink()crx)z!File that is marked as a symlink.rssymlink takes no argumentscry)N�lr{r=r}rrrA�r~zsymlink.<locals>.<lambda>ssymlinkrBrrrr}r�symlink�r�r�s
resolved()c�Pt|ddtd��|j��dur|��Stj�|j����|j	�fdd�dd�S)z;File that is marked resolved according to :hg:`resolve -l`.rsresolved takes no argumentsNc�|�vo	�|dkS)N�rrr=�r;rrrA��zresolved.<locals>.<lambda>sresolvedrB�
r[rrm�rev�never�
mergestatemodr
�read�reporDrrr�r�resolved���r�sunresolved()cr�)z=File that is marked unresolved according to :hg:`resolve -l`.rsunresolved takes no argumentsNcr�)N�urr=r�rrrA�r�zunresolved.<locals>.<lambda>s
unresolvedrBr�rrr�r�
unresolved�r�r�s
hgignore()cCs t|ddtd��|j��jjS)z/File that matches the active .hgignore pattern.rshgignore takes no arguments)r[rrmr��dirstate�_ignorerrrr�hgignoresr�s
portable()cCs$t|ddtd��|jdd�dd�S)z^File that has a portable name. (This doesn't include filenames with case
    collisions.)
    rsportable takes no argumentscSst�|�duSr)r�checkwinfilenamer=rrrrAr~zportable.<locals>.<lambda>sportablerB)r[rrDrrrr�portable	s�r�sgrep(regex)c
sjzt�t|td����Wntjy%}zt�td�t�|���d}~ww|j�fdd�d�j	fdd�S)	z+File contains the given regular expression.sgrep requires a patternsinvalid match pattern: %sNcs��|���Sr)�search�datarp��rrrrA r~zgrep.<locals>.<lambda>sgrep(%r)Trs)
�re�compilerrrrr�forcebytestrrv�pattern)rr�err�r�greps���
�r�cCs�zC|����}tjD]4\}}|�|�r>|dt|��}d}d|vr/|dt|�d�d�}tt|�||�dWSq
t|�WSt	ySt
�td�|��w)Ng�?�.�
rscouldn't parse size: %s)
�strip�lowerr�
_sizeunits�endswith�lenr�int�float�
ValueErrorrrr)rL�k�v�n�incrrr�
_sizetomax&s
�
�r�cs|��}d|vr!|�dd�\��t����t������fdd�S|�d�r5t�|dd����fdd�S|�d	�rIt�|dd����fd
d�S|�d�r]t�|dd����fdd�S|�d
�rqt�|dd����fdd�St�|��t|����fdd�S)z>Return a function(size) -> bool from the ``size()`` expression�-rc�|�ko|�kSrr�r�rSrTrrrA>rKzsizematcher.<locals>.<lambda>s<=�Ncs|�kSrrr��rSrrrAArr�<cs|�kSrrr�r�rrrADrrs>=cs|�kSrrr�r�rrrAGrr�>cs|�kSrrr�r�rrrAJrrcr�rrr�r�rrrANrK)r�rr�	sizetoint�
startswithr�)�exprrr�r�sizematcher7s*






r�ssize(expression)cs2t|td��}t|��|j�fdd�d|fdd�S)aFile size matches the given expression. Examples:

    - size('1k') - files from 1024 to 2047 bytes
    - size('< 20k') - files less than 20480 bytes
    - size('>= .5MB') - files at least 524288 bytes
    - size('4k - 1MB') - files from 4096 bytes to 1048576 bytes
    ssize requires an expressioncs�|���Sr)�sizerpr?rrrA^szsize.<locals>.<lambda>ssize(%r)Trs)rrr�rv)rrr�rr?rr�Qs

�r�sencoding(name)c�.t|td����fdd�}|j|d�fdd�S)z�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 namecsR|��}z|�t����WdStyt�td����ty(YdSw)NTsunknown encoding '%s'F)	r��decoder�sysstr�LookupErrorr�Abortr�UnicodeDecodeError�rq�d��encrr�encpls�zencoding.<locals>.encpsencoding(%r)Trs�rrrv)rrr�rr�r�encodingbs
r�s
eol(style)cr�)z�File contains newlines of the given style (dos, unix, mac). Binary
    files are excluded, files with mixed line endings match multiple
    styles.
    seol requires a style namecsd|��rdS|��}�dks�dkrd|vrdS�dkr$t�d|�r$dS�dkr0t�d	|�r0dSdS)
NFsdosswins
Tsunixs(?<!
)
smacs
(?!
))ror�r�r�r�r�rr�eolp�szeol.<locals>.eolpseol(%r)Trsr�)rrr�rr�r�eolysr�scopied()cCs*t|ddtd��dd�}|j|ddd�S)z&File that is recorded as being copied.rscopied takes no argumentscSs |��}|o|d��|��kS)Nr)�parents�path)rq�prrr�copiedp�szcopied.<locals>.copiedpscopiedTrsru)rrr�rrr�copied�sr�srevs(revs, pattern)c	Cs�t|ddtd��\}}t|td��}|j��}t�||g�}g}|D]}||}|�|��|�}|�	t
||��q"|s?|��St|�dkrI|dSt
�|�S)z�Evaluate set in the specified revisions. If the revset match multiple
    revs, this will return file matching pattern in any of the revision.
    r�srevs takes two argumentss)first argument to revs must be a revisionrr)r[rrrmr�r
�revrange�switch�p1�appendrr�r�r$r:)	rrr��revspecr��revs�matchersrm�mcrrrr��s

r�sstatus(base, rev, pattern)cCs�|j��}t|ddtd��\}}}td�}t||�}|s!t�|��td�}t||�}|s1t�|��t�|||g�\}	}
|�	|	|
�}t
||�S)z�Evaluate predicate using status change between ``base`` and
    ``rev``. Examples:

    - ``status(3, 7, added())`` - matches files added from "3" to "7"
    �sstatus takes three argumentss+first argument to status must be a revisions,second argument to status must be a revision)rmr�r[rrrrr
�revpairr�r)rrr�rTr��baseerr�baserevspec�reverrr��basectxrmr�rrrr\�s





r\ssubrepo([pattern])cs�t|ddtd��|j}|j�|rDt|tjtd���t���}|r)�fdd��n
tj|�	�j
d�g|d��|j��fd	d
�d�fd�S|j�jd
d�S)z4Subrepositories whose paths match the given pattern.rrs"subrepo takes at most one arguments*subrepo requires a pattern or no argumentscs|�kSrr)rL)�patrrr@�szsubrepo.<locals>.m�r}cs|�vo�|�Srrr=)r@�sstaterrrA�rKzsubrepo.<locals>.<lambda>ssubrepo(%r)rBssubrepo)
r[rrm�substater(r$r%�patkindr	r��rootrDr^)rrrm�fastr)r@r�r�r�subrepo�s"��r�)s
withstatussstringssymbolskindpatspatternssandsorsminusslistsnotsfuncc@sbeZdZddd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Z	ddd�Z
ddd�Zdd�ZdS)�matchctxNcCs(||_||_||_d|_d|_||_dSr)�_basectxrm�_badfn�_match�_status�cwd)�selfr�rmr��badfnrrr�__init__�s
zmatchctx.__init__cCs(t|j|j|j|j�}||_|j|_|S)z<Create matchctx for a sub-tree narrowed by the given matcher)r�r�rmr�r�r�r�)r�r	rrrrr2szmatchctx.narrowedcCst|||j|j�}|j|_|Sr)r�r�r�r�)r�r�rmrrrrr�szmatchctx.switchcCs,t|j|j|j|j�}|j|_|�|�|S)zBCreate matchctx which has precomputed status specified by the keys)r�r�rmr�r�r��_buildstatus)r�rrrrrrs
zmatchctx.withstatuscCs,|jj|j|jd|vd|vd|vd�|_dS)Nrirkrg)�listignored�	listclean�listunknown)r�r\rmr�r�)r�rrrrr�s�zmatchctx._buildstatuscCs|jSr)r��r�rrrr\!szmatchctx.statuscCs|jj||j|jd�S)N)r�r�)rmr	r�r�)r�r/rrrr $szmatchctx.matcherFcCs |rt�|�}tj|||jd�S)z4Create a matcher to select files by predfn(filename))rCr�)r�	cachefuncr$�predicatematcherr�)r��predfnrCrtrrrrD's

�zmatchctx.predicatecs@|j����dur��fdd�}n��fdd�}|j|||d�S)z}Create a matcher to select files by predfn(fctx) at the current
        revision

        Missing files are ignored.
        Nc
s�z�|}WntjyYdSwz|��Wntjy#YdSwz�|�WSttfyL}z|jtjtjtj	tj
fvrGWYd}~dS�d}~ww�NF)rr��auditr��IOError�OSError�errno�ENOENT�EACCES�ENOTDIR�EISDIR)r>rqr��rmr�rr�
fctxpredfn8s.��
���z'matchctx.fpredicate.<locals>.fctxpredfncs*z	�|}W�|�StjyYdSwr�)rr�)r>rqrrrrPs
��rs)rmr�rD)r�r�rCrtrrrrrv/s
zmatchctx.fpredicatecCstj|jd�S)z"Create a matcher to select nothing�r�)r$r�r�r�rrrr�Yszmatchctx.neverrr�)
�__name__�
__module__�__qualname__r�r2r�rr�r\r rDrvr�rrrrr��s
	

*r�cCs<t�|�}t�|�}t�|�}t|��|||d�}t||�S)z0Create a matcher for a single fileset expressionr)r�parse�analyze�optimizer�r�r)rmr�r�r��treerrrrr	^s




r	cCs"t�|j�D]\}}|t|<qdS)z3Load fileset predicates from specified registrarobjN)r�	iteritems�_tablerP)�ui�extname�registrarobj�namerWrrr�
loadpredicategs
�rr)P�
__future__rr�r��i18nrrr�rrr	r$r
r�rr
r�utilsr�WEIGHT_CHECK_FILENAME�_WEIGHT_CHECK_FILENAME�WEIGHT_READ_CONTENTS�_WEIGHT_READ_CONTENTS�
WEIGHT_STATUS�_WEIGHT_STATUS�WEIGHT_STATUS_THOROUGH�_WEIGHT_STATUS_THOROUGHrOr�
getkindpatr#r(r[rrr!r'r0r7r<rErGrHrWrP�filesetpredicaterDr]rarbrerfrhrjrlrnrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r\r�r�objectr�r�values�
i18nfunctionsrrrr�<module>s�(
	











	























�
c	

https://t.me/RX1948 - 2025