Ë xCæ’ÆHxãóÔ—ddlZddlZddlZddlZddlZddlmZddlmZddl m Z m Z m Z m Z mZmZddlmZe j"d«ZdZd Zej*Zd „Zd@d „Zd „Zd „Z d@d„Z dAd„ZdBd„ZdBd„ZdBd„Zd„ZdCd„Z Gd„d«Z!Gd„de!«Z"Gd„de!«Z#Gd„de!«Z$d„Z%Gd„de!«Z&Gd „d!«Z'Gd"„d#e!«Z(Gd$„d%e!«Z)Gd&„d'e!«Z*d(„Z+Gd)„d*e!«Z,Gd+„d,e!«Z-Gd-„d.e!«Z.Gd/„d0e!«Z/dBd1„Z0d2„Z1d3„Z2ejjgd4«Z4d5„Z5d6„Z6d7Z7d8„Z8d9„Z9d:„Z:d;„Z;d<„Z„Z>da?dDd?„Z@y)EéNé)Ú_)Úopen)ÚencodingÚerrorÚpathutilÚpolicyÚpycompatÚutil)Ú stringutilÚdirstate)óreóglobópathófilepathórelglobórelpathórelreórootglobólistfileó listfile0ósetóincludeó subincludeó rootfilesin©rrcó�—tjj|«} |jS#t$r|j cYSwxYw)zZcompile the regexp with the best available regexp engine and return a matcher function)r ÚreÚcompileÚ test_matchÚAttributeErrorÚmatch)ÚregexÚms ú3usr/lib/python3.12/site-packages/mercurial/match.pyÚ _rematcherr&2s=€ô �‰�‰˜Ó€Aðà�|‰|ÐøÜ òØ�w‰wŠðús¡ -­AÁAcóz—g}g}|D]¯\}}} |dk(r�|€tjd«‚|j|j|||¬««|rS|jD]D} |j | «j|||¬«} t | | |¬«} |j| «ŒFŒœ|j||| f«Œ±||fS)zFReturns the kindpats list with the 'set' patterns expanded to matchersrs"fileset expression with no context©Úbadfn)rÚProgrammingErrorÚappendÚ matchfilesetÚsubstateÚsubÚprefixdirmatcher) ÚcwdÚkindpatsÚctxÚ listsubreposr)ÚmatchersÚotherÚkindÚpatÚsourceÚsubpathÚsmÚpms r%Ú _expandsetsr<=s΀à€HØ €Eã%шˆc�6Ø �6Š>؈{Ü×,Ñ,Ø9óðð �O‰O˜C×,Ñ,¨S°#¸UÐ,ÓCÔ DáØ"Ÿ|œ|�GØŸ™ Ó)×6Ñ6°s¸CÀuÐ6ÓM�BÜ)¨'°2¸UÔC�BØ—O‘O BÕ'ð ,ð Ø � ‰ �d˜C Ð(Õ)ð&ð �Uˆ?Ðócó¢—g}g}|D]Ã\}}}|dk(r¤tjtj|««}tj|«}tj ||«}tj|«} | dgd|zgf} tj ||| «} | r| dz } |j| | f«Œ°|j|||f«ŒÅ||fS)z_Returns the list of subinclude matcher args and the kindpats without the subincludes in it.rr=s include:%só/)rÚdirnamer ÚnormpathÚpconvertÚjoinÚ canonpathr+) r1ÚrootÚ relmatchersr5r6r7r8Ú sourcerootÚpathÚnewrootÚ matcherargsÚprefixs r%Ú_expandsubincluderLUs×€ð€KØ €Eã%шˆc�6Ø �=Ò Ü!×)Ñ)¬$¯-©-¸Ó*?Ó@ˆJÜ—-‘- Ó$ˆCÜ—=‘= ¨SÓ1ˆDä×&Ñ& tÓ,ˆGØ" C¨¨m¸dÑ.BÐ-CÐDˆKä×'Ñ'¨¨d°GÓ<ˆFÙØ˜$‘�Ø × Ñ  ¨ Ð4Õ 5à �L‰L˜$  VÐ,Õ -ð&ð ˜Ð Ðr=có0—|D]\}}}|dk7s|dvsŒyy)zQChecks whether the kindspats match everything, as e.g. 'relpath:.' does. r=rFT©©r1r6r7r8s r%Ú_kindpatsalwaysmatchrPns,€ó&шˆc�6Ø �#Š:˜Ð%:Ò:Ùð&ð r=cóæ—g}t|||||¬«\}}|r||||¬«} |j| «|r|j|«|s t|¬«St |«dk(r|dSt |«S)N©r2r3r)r(rr)r<r+ÚextendÚ nevermatcherÚlenÚ unionmatcher) Ú matcherclsrEr0r1r2r3r)r4Úfmsr$s r%Ú_buildkindpatsmatcherrYxsƒ€ð€HÜØ ØØ Ø!Øô �M€CˆñÙ �t˜X¨UÔ 3ˆØ�‰˜ÔÙ Ø�‰˜ÔÙ Ü %Ô(Ð(Ü ˆ8ƒ}˜Òؘ‰{ÐÜ ˜Ó !Ð!r=c ón‡‡—tjj|«sJ‚tjj|t j |««}t } | r,|j«jЉjŠˆˆfd„} |r;| |||||| «} t| «r t| «}n"tt||| ||| ¬«}n t| «}|r/| |d|||| «} tt||| ||d¬«}t||«}|r/| |d|||| «} tt||| ||d¬«}t!||«}|S)a+build an object to match a set of file patterns arguments: root - the canonical root of the tree you're matching against cwd - the current working directory, if relevant patterns - patterns to find include - patterns to include (unless they are excluded) exclude - patterns to exclude (even if they are included) default - if a pattern in patterns has no explicit type, assume this one auditor - optional path auditor ctx - optional changecontext listsubrepos - if True, recurse into subrepositories warn - optional function used for printing warnings badfn - optional bad() callback for this matcher instead of the default icasefs - make a matcher for wdir on case insensitive filesystems, which normalizes the given patterns to the case in the filesystem a pattern is one of: 'glob:' - a glob relative to cwd 're:' - a regular expression 'path:' - a path relative to repository root, which is matched recursively 'filepath:' - an exact path to a single file, relative to the repository root 'rootfilesin:' - a path relative to repository root, which is matched non-recursively (will not match subdirectories) 'relglob:' - an unrooted glob (*.c matches C files in all dirs) 'relpath:' - a path relative to cwd 'relre:' - a regexp that needn't match the start of a name 'set:' - a fileset expression 'include:' - a file of patterns to read and include 'subinclude:' - a file of patterns to match against files under the same directory '' - a pattern of the specified default type >>> def _match(root, *args, **kwargs): ... return match(util.localpath(root), *args, **kwargs) Usually a patternmatcher is returned: >>> _match(b'/foo', b'.', [br're:.*\.c$', b'path:foo/a', b'*.py']) Combining 'patterns' with 'include' (resp. 'exclude') gives an intersectionmatcher (resp. a differencematcher): >>> type(_match(b'/foo', b'.', [br're:.*\.c$'], include=[b'path:lib'])) >>> type(_match(b'/foo', b'.', [br're:.*\.c$'], exclude=[b'path:build'])) Notice that, if 'patterns' is empty, an alwaysmatcher is returned: >>> _match(b'/foo', b'.', []) The 'default' argument determines which kind of pattern is assumed if a pattern has no prefix: >>> _match(b'/foo', b'.', [br'.*\.c$'], default=b're') >>> _match(b'/foo', b'.', [b'main.py'], default=b'relpath') >>> _match(b'/foo', b'.', [b'main.py'], default=b're') The primary use of matchers is to check whether a value (usually a file name) matches againset one of the patterns given at initialization. There are two ways of doing this check. >>> m = _match(b'/foo', b'', [br're:.*\.c$', b'relpath:a']) 1. Calling the matcher with a file name returns True if any pattern matches that file name: >>> m(b'a') True >>> m(b'main.c') True >>> m(b'test.py') False 2. Using the exact() method only returns True if the file name matches one of the exact patterns (i.e. not re: or glob: patterns): >>> m.exact(b'a') True >>> m.exact(b'main.c') False cóÀ•—t||||||«}g}|D]E\}} } |dvr'| } ‰ | «} | | k7r| ‰ vr|j|| | f«|j|| | f«ŒG|S)N)rr)Ú _donormalizer+)ÚpatternsÚdefaultrEr0ÚauditorÚwarnÚkpr1r6Úpatsr8Úpr Ú dsnormalizes €€r%Ú normalizezmatch..normalizeþs�ø€Ü˜h¨°°s¸GÀTÓJˆB؈HÛ&(Ñ"��d˜FØÐ0Ñ0Ø�AÙ& tÓ,�Dð˜D’y Q¨(¡]Ø Ÿ™¨¨q°&Ð(9Ô:à—‘  t¨VÐ 4Õ5ð')ðˆOr=rRrN)ÚosrHÚisabsrCr Ú localpathr\Úrepor rerPÚ alwaysmatcherrYÚpatternmatcherÚincludematcherÚintersectmatchersÚdifferencematcher)rEr0r]ÚincludeÚexcluder^r_r2r3r`r)Úicasefsrer1r$ÚimÚemr rds @@r%r"r"•sEù€ôD �7‰7�=‰=˜Ô ÐÐ Ü �'‰'�,‰,�tœTŸ^™^¨CÓ0Ó 1€CÜ€IÙØ—8‘8“:×&Ñ&ˆØ×(Ñ(ˆ õ ñÙ˜X w°°c¸7ÀDÓIˆÜ  Ô )ܘeÓ$‰Aä%ÜØØØØØ)Øô‰Aô ˜%Ó ˆáÙ˜W g¨t°S¸'À4ÓHˆÜ "Ü Ø Ø Ø ØØ%Øô ˆô ˜a Ó $ˆÙÙ˜W g¨t°S¸'À4ÓHˆÜ "Ü Ø Ø Ø ØØ%Øô ˆô ˜a Ó $ˆØ €Hr=có—t||¬«S)Nr()Ú exactmatcher)Úfilesr)s r%Úexactrw;s€Ü ˜ UÔ +Ð+r=có—t|«S©N)rjr(s r%Úalwaysrz?s €Ü ˜Ó Ðr=có—t|«Sry)rTr(s r%Úneverr|Cs €Ü ˜Ó Ðr=có>—tj|«}||_|S)zWMake a copy of the given matcher, replacing its bad method with the given one. )ÚcopyÚbad)r"r)r$s r%Úbadmatchr€Gs€ô � ‰ �%Ó€AØ €A„EØ €Hr=c óf—g}d}|D�cgc]}t||«‘Œc}D�]Q\} } | tvrtj||| |¬«} �n| |vrt j | «} nú| dvr} t j | «} | dk(r| jd«} n| j«} | D� cgc]} | sŒ| ‘Œ } } t| |||||«D]\} }}|j| || f«ŒŒÅ| dk(rt tj j#|t j$| ««}t'||«}t||||||«D]\} }}|j| ||xs| f«Œ  �Œ>|j| | d f«�ŒT|Scc}wcc} w#t$r"tjtd«| z«‚wxYw#tj$r)}tjd| |j(fz«‚d }~wt*$r?}|r3|td «| t-j.|j0«fz«Yd }~ŒÐd }~wwxYw) z�Convert 'kind:pat' from the patterns list to tuples with kind and normalized and rooted patterns and with listfiles expanded.)rrrrr)r_)rrrósunable to read file list (%s)rs%s: %sNs*skipping unreadable pattern file '%s': %s r=)Ú _patsplitÚcwdrelativepatternkindsrrDr rAÚreadfileÚsplitÚ splitlinesÚEnvironmentErrorrÚAbortrr\r+rfrHrCrhÚreadpatternfileÚmessageÚIOErrorr Ú forcebytestrÚstrerror)r]r^rEr0r_r`r1Úkinds_to_normalizercr6r7rvÚfÚkr8ÚfullpathÚ includepatsÚinsts r%r\r\PsC€ð€HðÐñ6>Ó>±X°”i  7Õ+°XÕ>‰ ˆˆcØ Ô*Ñ *Ü×$Ñ$ T¨3°¸WÔEŠCØ Ð'Ñ 'Ü—-‘- Ó$‰CØ Ð0Ñ 0ð MÜŸ ™  cÓ*�ؘ<Ò'Ø!ŸK™K¨Ó.‘Eà!×,Ñ,Ó.�EÙ$)Ó/¡E˜qªQš E�Ð/ô!-Ø�w  c¨7°Dö!‘ ��1�fð—‘  A s  Õ,ð!ð Ø �ZÒ ð ÜŸ7™7Ÿ<™<¨¬d¯n©n¸SÓ.AÓB�Ü-¨h¸Ó=� Ü$0Ø ¨$°°W¸dö%‘L�A�q˜&ð—O‘O Q¨¨6ª=°SÐ$9Õ:ñ%ñ$ à�‰˜˜s CÐ(Ö)ðY?ðZ €Oùò[?ùò0øÜ#ò MÜ—k‘k¤!Ð$DÓ"EÈÑ"KÓLÐLð Mûô—;‘;ò Ü—k‘kØàØŸ ™ ðñóðûôò ÙÙÜÐHÓIؤ × 7Ñ 7¸¿ ¹ Ó FÐGñHôÿøð úsO‰E6Á(AFÂ(E;Â0E;Â4FÃ*A0F.Å;FÆ+F+Æ.H0Ç$G%Ç% H0Ç15H+È+H0cóz—eZdZdd„Zd„Zd„ZdZed„«Zd„Z ed„«Z d„Z d „Z d „Z d „Zd „Zd „Zd„Zd„Zy)Ú basematcherNcó—|�||_yyry)r)Úselfr)s r%Ú__init__zbasematcher.__init__�s€Ø Р؈D�Hð r=có$—|j|«Sry)Úmatchfn©r˜Úfns r%Ú__call__zbasematcher.__call__‘s€Ø�|‰|˜BÓÐr=có—y)zoCallback from dirstate.walk for each explicit file that can't be found/accessed, with an error message.NrN©r˜r�Úmsgs r%rzbasematcher.bad–s�r=có—gSryrN©r˜s r%Ú_fileszbasematcher._filesžs€àˆ r=có—|jS)zÒExplicitly listed files or patterns or roots: if no patterns or .always(): empty list, if exact: list exact files, if not .anypats(): list all files and dirs, else: optimal roots©r¤r£s r%rvzbasematcher.files¢s€ð �{‰{Ðr=có,—t|j«Sry)Úsetr¤r£s r%Ú_filesetzbasematcher._filesetªs€ä�4—;‘;ÓÐr=có—||jvS)z!Returns True if f is in .files().)r©©r˜r�s r%rwzbasematcher.exact®s€à�D—M‘MÐ!Ð!r=có—y©NFrNr«s r%r›zbasematcher.matchfn²ó€Ør=có—y)a¨Decides whether a directory should be visited based on whether it has potential matches in it or one of its subdirectories. This is based on the match's primary, included, and excluded patterns. Returns the string 'all' if the given directory and all subdirectories should be visited. Otherwise returns True or False indicating whether the given directory should be visited. TrN©r˜Údirs r%Úvisitdirzbasematcher.visitdirµs€ðr=có—y)a]Decides whether a directory should be visited based on whether it has potential matches in it or one of its subdirectories, and potentially lists which subdirectories of that directory should be visited. This is based on the match's primary, included, and excluded patterns. This function is very similar to 'visitdir', and the following mapping can be applied: visitdir | visitchildrenlist ----------+------------------- False | set() 'all' | 'all' True | 'this' OR non-empty set of subdirs -or files- to visit Example: Assume matchers ['path:foo/bar', 'rootfilesin:qux'], we would return the following values (assuming the implementation of visitchildrenset is capable of recognizing this; some implementations are not). '' -> {'foo', 'qux'} 'baz' -> set() 'foo' -> {'bar'} # Ideally this would be 'all', but since the prefix nature of matchers # is applied to the entire matcher, we have to downgrade this to # 'this' due to the non-prefix 'rootfilesin'-kind matcher being mixed # in. 'foo/bar' -> 'this' 'qux' -> 'this' Important: Most matchers do not know if they're representing files or directories. They see ['path:dir/f'] and don't know whether 'f' is a file or a directory, so visitchildrenset('dir') for most matchers will return {'f'}, but if the matcher knows it's a file (like exactmatcher does), it may return 'this'. Do not rely on the return being a set indicating that there are no files in this dir to investigate (or equivalently that if there are files to investigate in 'dir' that it will always return 'this'). óthisrNr°s r%Úvisitchildrensetzbasematcher.visitchildrensetÀs€ðRr=có—y)zcMatcher will match everything and .files() will be empty -- optimization might be possible.FrNr£s r%rzzbasematcher.alwaysëó€ðr=có—y)zcMatcher will match exactly the list of files in .files() -- optimization might be possible.FrNr£s r%Úisexactzbasematcher.isexactðr·r=có—y)z_Matcher will match the paths in .files() recursively -- optimization might be possible.FrNr£s r%rKzbasematcher.prefixõr·r=cóp—|j« xr$|j« xr|j« S)z`None of .always(), .isexact(), and .prefix() is true -- optimizations will be difficult.)rzr¹rKr£s r%Úanypatszbasematcher.anypatsús/€ð—;‘;“=Ð ÒM¨¯©«Ð%7ÒMÀÇ Á à ÐrNr£s r%Ú__repr__zalwaysmatcher.__repr__s€Ø!r=ry) r½r¾r¿Ú__doc__r™rzr›r²rµrÑÚ __classcell__©rÆs@r%rjrjs$ø„Ùõ3òòòòö"r=rjcóB‡—eZdZdZdˆfd„ Zd„Zd„Zd„Zd„Zd„Z ˆxZ S) rTzMatches nothing.có,•—tt|� |«yry)rÄrTr™rÅs €r%r™znevermatcher.__init__sø€Ü Œl˜DÑ*¨5Õ1r=có—yrÈrNr£s r%r¹znevermatcher.isexact!rÉr=có—yrÈrNr£s r%rKznevermatcher.prefix$rÉr=có—yr­rNr°s r%r²znevermatcher.visitdir'r®r=có—t«Sry)r¨r°s r%rµznevermatcher.visitchildrenset*s €Ü‹uˆ r=có—y)NzrNr£s r%rÑznevermatcher.__repr__-s€Ø r=ry) r½r¾r¿rÒr™r¹rKr²rµrÑrÓrÔs@r%rTrTs$ø„Ùõ2òòòòö!r=rTcóH‡—eZdZdZdˆfd„ Zej d„«ZˆxZS)Úpredicatematcherz/A matcher adapter for a simple boolean functioncóH•—tt|� |«||_||_yry)rÄrÝr™r›Ú _predrepr)r˜ÚpredfnÚpredreprr)rÆs €r%r™zpredicatematcher.__init__4s!ø€Ü Ô Ñ.¨uÔ5؈Œ Ø!ˆ�r=cóŒ—tj|j«xstj|j «}d|zS)Ns)r Ú buildreprrßr Úbytereprr›)r˜Úss r%rÑzpredicatematcher.__repr__9s<€ä × Ñ  §¡Ó 0ò ´H×4EÑ4EØ �L‰Ló5 ˆð.°Ñ1Ð1r=©NN) r½r¾r¿rÒr™rÚ strmethodrÑrÓrÔs@r%rÝrÝ1s%ø„Ù9õ"ð ×Ññ2óô2r=rÝcóÖ‡‡‡—t‰«}|dk(ry‰‰vry|dkDr'tˆfd„tj‰«D««Sd‰vryt d«Štˆˆfd„‰D««S) zDReturns True if `path` (or any parent of `path`) is in `prefix_set`.rFTéc3ó&•K—|]}|‰v–—Œ y­wryrN)Ú.0Ú parentdirÚ prefix_sets €r%Ú z)path_or_parents_in_set..Lsøèø€ð Ù5L¨ ˆI˜Ô #Ñ5Lùsƒr=r?c3óf•K—|](}‰j|«xr‰t|«‰k(–—Œ*y­wry)Ú startswithrU)rëÚpfrHÚsls €€r%rîz)path_or_parents_in_set..Ys0øèø€ÐPÁZ¸rˆt�‰˜rÓ"Ò: t¬C°«G¡}¸Ñ':Ó:ÁZùsƒ.1)rUÚanyrÚfinddirsÚord)rHríÚlròs`` @r%Úpath_or_parents_in_setr÷Asxú€ä ˆJ‹€A؈A‚vØØ ˆzÑØð ˆ1‚uÜó Ü5=×5FÑ5FÀtÔ5Ló ó ð ð  ˆjÑØä ˆT‹€Bô ÔPÁZÓPÓ PÐPr=cóp‡—eZdZdZd ˆfd„ Zd„Zed„«Zd„Zd„Z d„Z e jd„«Z ˆxZS) rka,Matches a set of (kind, pat, source) against a 'root' directory. >>> kindpats = [ ... (b're', br'.*\.c$', b''), ... (b'path', b'foo/a', b''), ... (b'relpath', b'b', b''), ... (b'glob', b'*.h', b''), ... ] >>> m = patternmatcher(b'foo', kindpats) >>> m(b'main.c') # matches re:.*\.c$ True >>> m(b'b.txt') False >>> m(b'foo/a') # matches path:foo/a True >>> m(b'a') # does not match path:b, since 'root' is 'foo' False >>> m(b'b') # matches relpath:b, since 'root' is 'foo' True >>> m(b'lib.h') # matches glob:*.h True >>> m.files() [b'', b'foo/a', b'', b'b'] >>> m.exact(b'foo/a') True >>> m.exact(b'b') True >>> m.exact(b'lib.h') # exact matches are for (rel)path kinds False cóÀ•—tt|� |«|j«t |«|_t |«|_t|d|«\|_|_ y)Nó$) rÄrkr™ÚsortÚ_explicitfilesr¤Ú_prefixÚ _buildmatchÚ_patsÚ_matchfn)r˜rEr1r)rÆs €r%r™zpatternmatcher.__init__}sJø€Ü Œn˜dÑ,¨UÔ3Ø� ‰ Œä$ XÓ.ˆŒ ܘxÓ(ˆŒ Ü$/°¸$ÀÓ$EÑ!ˆŒ �D•Mr=cóB—||jvry|j|«SrÈ)r©rrœs r%r›zpatternmatcher.matchfn…s €Ø �—‘Ñ ØØ�}‰}˜RÓ Ð r=cóR—ttj|j««Sry©r¨rÚdirsr©r£s r%Ú_dirszpatternmatcher._dirsŠó€ä”8—=‘= §¡Ó/Ó0Ð0r=có„—|jr||jvry||jvxst||j«SrÌ)rýr©rr÷r°s r%r²zpatternmatcher.visitdirŽs7€Ø �<Š<˜C 4§=¡=Ñ0ØØ�d—j‘jÐ ÒNÔ$:¸3ÀÇ Á Ó$NÐNr=cóV—|j|«}|dury|s t«S|dk(sJ‚y)NTr´rÍ)r²r¨)r˜r±Úrets r%rµzpatternmatcher.visitchildrenset“s3€Ø�m‰m˜CÓ ˆØ �$‰;ØÙÜ“5ˆLØ�fŠ}Ј}Ør=có—|jSry)rýr£s r%rKzpatternmatcher.prefixœó €Ø�|‰|Ðr=cóF—dtj|j«zS)Ns©r Úbytestrrÿr£s r%rÑzpatternmatcher.__repr__Ÿó€à.´×1AÑ1AÀ$Ç*Á*Ó1MÑMÐMr=ry)r½r¾r¿rÒr™r›rÁrr²rµrKrrçrÑrÓrÔs@r%rkrk\sTø„ñõ@Fò!ð ñ1óð1òOò òð×ÑñNóôNr=rkcó0—eZdZdd„Zd„Zed„«Zd„Zy)Ú _dirchildrenNcó^—i|_|xsg|_|j}|D] }||«Œ yry)rÚ _onlyincludeÚaddpath)r˜ÚpathsÚ onlyincluderr�s r%r™z_dirchildren.__init__¨s0€ØˆŒ Ø'Ò-¨2ˆÔØ—,‘,ˆÛˆAÙ �A�Jñr=cóØ—|dk(ry|j}tj}||«D]=\}}||jvrŒ|j |t ««j |«Œ?y©Nr=)rrÚ_findsplitdirsrÚ setdefaultr¨Úadd)r˜rHrÚ findsplitdirsÚdÚbs r%rz_dirchildren.addpath¯s_€Ø �3Š;Ø Ø�z‰zˆÜ$×3Ñ3ˆ Ù! $Ö'‰DˆAˆqؘ×)Ñ)Ñ)ØØ �O‰O˜Aœs›uÓ %× )Ñ )¨!Õ ,ñ(r=c#ó´K—t|«}|jd«}|dk7r*|d|||dz|f–—|}|jdd|«}|dk7rŒ*d|d|f–—y­w)Nr?éÿÿÿÿrrr=)rUÚrfind)rHÚoldposÚposs r%rz_dirchildren._findsplitdirs¹suèø€ô�T“ˆØ�j‰j˜ÓˆØ�RŠiØ�t˜�*˜d 3¨¡7¨VÐ4Ð4Ò 4؈FØ—*‘*˜T 1 cÓ*ˆCð�R‹ið�4˜˜�=Ð Ó ùs ‚A AÁ AcóJ—|jj|t««Sry)rÚgetr¨)r˜rHs r%r%z_dirchildren.getÈs€Ø�z‰z�~‰~˜d¤C£EÓ*Ð*r=ry)r½r¾r¿r™rÚ staticmethodrr%rNr=r%rr§s%„óò-ðñ !óð !ó+r=rcó`‡—eZdZdˆfd„ Zd„Zed„«Zd„Zejd„«Z ˆxZ S)rlcó•—tt|� |«t�||_t |d|«\|_|_t|«|_t|«\}}}t|«|_ t|«|_ ||_ y)Nó(?:/|$))rÄrlr™ÚrustmodÚ _kindpatsrþrÿr›rýÚ_rootsdirsandparentsr¨Ú_rootsrÚ_parents)r˜rEr1r)ÚrootsrÚparentsrÆs €r%r™zincludematcher.__init__Ístø€Ü Œn˜dÑ,¨UÔ3Ü Ð ð&ˆDŒNÜ#.¨x¸ÀTÓ#JÑ ˆŒ �D”LܘxÓ(ˆŒ Ü3°HÓ=шˆt�Wä˜%“jˆŒ 䘓YˆŒ ð ˆ� r=có¤—|jr||jvry||jvxs&||jvxst ||j«SrÌ)rýr-rr.r÷r°s r%r²zincludematcher.visitdirÞsL€Ø �<Š<˜C 4§;¡;Ñ.Øà �4—:‘:Ð ò 8Ø�d—m‘mÐ#ò 8ä% c¨4¯;©;Ó7ð r=có–—ttj|j|j|j «|j ¬«S)N)r)rÚ itertoolsÚchainrr-r.r£s r%Ú_allparentschildrenz"includematcher._allparentschildrençs4€ôÜ �O‰O˜DŸJ™J¨¯ © °T·]±]Ó CØŸ ™ ô ð r=có—|jr||jvryd|jvs$||jvst||j«ry||jvr'|j j |«xs t«St«S)NrÍr=r´)rýr-rr÷r.r5r%r¨r°s r%rµzincludematcher.visitchildrensetôss€Ø �<Š<˜C 4§;¡;Ñ.Øð �4—;‘;Ñ Ø�d—j‘jÑ Ü% c¨4¯;©;Ô7àà �$—-‘-Ñ Ø×+Ñ+×/Ñ/°Ó4Ò=¼»Ð =Ü‹uˆ r=cóF—dtj|j«zS)Nsr r£s r%rÑzincludematcher.__repr__rr=ry) r½r¾r¿r™r²rÁr5rµrrçrÑrÓrÔs@r%rlrlÌsBø„õ ò" ðñ  óð  òð ×ÑñNóôNr=rlc󢇗eZdZdZd ˆfd„ Zej Zed„«Z d„Z ed„«Z ed„«Z d„Z d„Zej d „«ZˆxZS) ruaæMatches the input files exactly. They are interpreted as paths, not patterns (so no kind-prefixes). >>> m = exactmatcher([b'a.txt', br're:.*\.c$']) >>> m(b'a.txt') True >>> m(b'b.txt') False Input files that would be matched are exactly those returned by .files() >>> m.files() ['a.txt', 're:.*\\.c$'] So pattern 're:.*\.c$' is not considered as a regex, but as a file name >>> m(b'main.c') False >>> m(br're:.*\.c$') True có|•—tt|� |«t|t«r||_yt |«|_yry)rÄrur™Ú isinstanceÚlistr¤)r˜rvr)rÆs €r%r™zexactmatcher.__init__s.ø€Ü Œl˜DÑ*¨5Ô1ä �eœTÔ "؈D�Kä˜u›+ˆD�Kr=cóR—ttj|j««Sryrr£s r%rzexactmatcher._dirs(rr=có—||jvSry)rr°s r%r²zexactmatcher.visitdir,s€Ø�d—j‘jÐ Ð r=có<—|j|jdhz zS)z2A memoized set of candidates for visitchildrenset.r=)r©rr£s r%Ú_visitchildrenset_candidatesz)exactmatcher._visitchildrenset_candidates/s€ð�}‰}˜tŸz™z¨S¨EÑ1Ñ1Ð1r=có,—t|j«S)z:A memoized sorted list of candidates for visitchildrenset.)Úsortedr?r£s r%Ú#_sorted_visitchildrenset_candidatesz0exactmatcher._sorted_visitchildrenset_candidates4s€ô�d×7Ñ7Ó8Ð8r=cóΗ|jr||jvr t«S|dk(r |j}nŒ|j}|dz}t j ||«}|tjttd«dz««z}t j |||¬«}t|«}|||D�chc]}||d’Œ }}|D�chc] }d|vsŒ|’Œ } }| sJ‚| Scc}wcc}w)Nr=r?r)Úlo) r©rr¨r?rBÚbisectÚ bisect_leftrÚ strtolocalÚchrrõrU) r˜r±Ú candidatesrÚfirstÚdnextÚlastÚdlenÚcr s r%rµzexactmatcher.visitchildrenset9sî€Ø�}Š} ¨4¯:©:Ñ 5Ü“5ˆLà �#Š:Ø×:Ñ:‰Jà×AÑAˆJØ�d‘ ˆAô×&Ñ& z°1Ó5ˆEð œ(×-Ñ-¬c´#°d³)¸a±-Ó.@ÓAÑAˆEä×%Ñ% j°%¸EÔBˆDÜ�q“6ˆDØ,6°u¸TÑ,BÓCÑ,B q˜!˜D˜Eš(Ð,BˆJÐCñ %Ó6™*�Q¨°Aª Šq˜*ˆÐ6ñˆ ˆs؈ ùòDùò 7sÂ5 Cà C"ÃC"có—yrÈrNr£s r%r¹zexactmatcher.isexactZrÉr=có —d|jzS)Nsr¦r£s r%rÑzexactmatcher.__repr__]s€à)¨D¯K©KÑ7Ð7r=ry)r½r¾r¿rÒr™r–rwr›rÁrr²r?rBrµr¹rrçrÑrÓrÔs@r%ruru s~ø„ñõ(&ð×Ñ€Gàñ1óð1ò!ðñ2óð2ðñ9óð9òòBð×Ññ8óô8r=rucón‡—eZdZdZˆfd„Zd„Zed„«Zd„Zd„Z d„Z e jd„«Z ˆxZS) rnzªComposes two matchers by matching if the first matches and the second does not. The second matcher's non-matching-attributes (bad, traversedir) are ignored. cóŠ•—tt|� «||_||_|j |_|j |_yry)rÄrnr™Ú_m1Ú_m2rrÀ©r˜Úm1Úm2rÆs €r%r™zdifferencematcher.__init__is6ø€Ü Ô Ñ/Ô1؈ŒØˆŒØ—6‘6ˆŒØŸ>™>ˆÕr=cóL—|j|«xr|j|« Sry©rSrTr«s r%r›zdifferencematcher.matchfnps€Ø�x‰x˜‹{Ò. 4§8¡8¨A£;˜Ð.r=có—|j«r1|jj«D�cgc] }||«sŒ |‘Œc}S|jj«Scc}wry)r¹rSrvr«s r%r¤zdifferencematcher._filesssK€à �<‰<Œ>Ø#Ÿx™xŸ~™~Ô/Ó;Ñ/˜!±4¸µ7’AÐ/Ñ;Ð ;ð �x‰x�~‰~ÓÐùò rYr£s r%rÑzdifferencematcher.__repr__¢s€à2°d·h±hÀÇÁÐ5IÑIÐIr=)r½r¾r¿rÒr™r›rÁr¤r²rµr¹rrçrÑrÓrÔs@r%rnrnbsQø„ñô *ò/ðñ óð ò,òò2"ð×ÑñJóôJr=rncó—|�|€|xs|S|j«r9tj|«}|j|_|j|_|S|j«rtj|«}|St ||«S)z�Composes two matchers by matching if both of them match. The second matcher's non-matching-attributes (bad, traversedir) are ignored. )rzr~rrÀÚintersectionmatcher)rVrWr$s r%rmrm§sq€ð  €z�R�ZØŠx�RˆØ ‡y�y„{Ü �I‰I�b‹Mˆð—‘ˆŒØŸ™ˆŒ ØˆØ ‡y�y„{Ü �I‰I�b‹MˆØˆÜ ˜r 2Ó &Ð&r=cóp‡—eZdZˆfd„Zed„«Zd„Zd„Zd„Zd„Z d„Z e jd„«Z ˆxZS) rccóŠ•—tt|� «||_||_|j |_|j |_yry)rÄrcr™rSrTrrÀrUs €r%r™zintersectionmatcher.__init__¼s6ø€Ü Ô! 4Ñ1Ô3؈ŒØˆŒØ—6‘6ˆŒØŸ>™>ˆÕr=có<—|j«rS|j|j}}|j«s||}}|j«D�cgc] }||«sŒ |‘Œc}S|jj«|jj«zScc}wry)r¹rSrTrv)r˜rVrWr�s r%r¤zintersectionmatcher._filesÃsw€à �<‰<Œ>Ø—X‘X˜tŸx™x�ˆBØ—:‘:”<ؘR�B�Ø!Ÿx™xœzÓ3™z˜!©R°­U’A˜zÑ3Ð 3ð �x‰x�~‰~Ó $§(¡(§.¡.Ó"2Ñ2Ð2ùò 4s Á BÁBcóJ—|j|«xr|j|«SryrYr«s r%r›zintersectionmatcher.matchfnÐs€Ø�x‰x˜‹{Ò*˜tŸx™x¨›{Ð*r=cóÈ—|jj|«}|dk(r|jj|«St|xr|jj|««SrÌ)rSr²rTr\)r˜r±Úvisit1s r%r²zintersectionmatcher.visitdirÓsR€Ø—‘×"Ñ" 3Ó'ˆØ �VÒ Ø—8‘8×$Ñ$ SÓ)Ð )ä�FÒ5˜tŸx™x×0Ñ0°Ó5Ó6Ð6r=có6—|jj|«}|s t«S|jj|«}|s t«S|dk(r|S|dk(r|S|dk(s|dk(ryt |t«rt |t«sJ‚|j |«S)NrÍr´)rSrµr¨rTr:Ú intersection)r˜r±r_r^s r%rµz$intersectionmatcher.visitchildrensetÚs”€Ø—‘×*Ñ*¨3Ó/ˆÙÜ“5ˆLØ—‘×*Ñ*¨3Ó/ˆÙÜ“5ˆLà �VÒ ØˆMØ �vÒ ØˆMà �WÒ  ¨'Ò 1Øä˜&¤#Ô&¬:°f¼cÔ+BÐBÐBØ×"Ñ" 6Ó*Ð*r=cón—|jj«xr|jj«Sry)rSrzrTr£s r%rzzintersectionmatcher.alwaysís#€Ø�x‰x�‰Ó Ò6 T§X¡X§_¡_Ó%6Ð6r=cón—|jj«xs|jj«Sry)rSr¹rTr£s r%r¹zintersectionmatcher.isexactðs'€Ø�x‰x×ÑÓ!Ò7 T§X¡X×%5Ñ%5Ó%7Ð7r=có8—d|j|jfzS)Ns"rYr£s r%rÑzintersectionmatcher.__repr__ós€à4¸¿¹À$Ç(Á(Ð7KÑKÐKr=)r½r¾r¿r™rÁr¤r›r²rµrzr¹rrçrÑrÓrÔs@r%rcrc»sQø„ô*ðñ 3óð 3ò+ò7ò+ò&7ò8ð×ÑñLóôLr=rccój‡—eZdZdZˆfd„Zd„Zd„Zd„Zd„Zd„Z d„Z e jd „«Z ˆxZS) Ú subdirmatcheraŸAdapt a matcher to work on a subdirectory only. The paths are remapped to remove/insert the path as needed: >>> from . import pycompat >>> m1 = match(util.localpath(b'/root'), b'', [b'a.txt', b'sub/b.txt'], auditor=lambda name: None) >>> m2 = subdirmatcher(b'sub', m1) >>> m2(b'a.txt') False >>> m2(b'b.txt') True >>> m2.matchfn(b'a.txt') False >>> m2.matchfn(b'b.txt') True >>> m2.files() ['b.txt'] >>> m2.exact(b'b.txt') True >>> def bad(f, msg): ... print(pycompat.sysstr(b"%s: %s" % (f, msg))) >>> m1.bad = bad >>> m2.bad(b'x.txt', b'No such file') sub/x.txt: No such file cóh•‡—tt|� «‰|_||_|j «|_|jD�cgc]'}|j‰dz«r|t‰«dzd‘Œ)c}|_|j«r$tˆfd„|jD««|_yycc}w)Nr?rc3ó(•K—|] }|‰k(–—Œ y­wryrN)rër�rHs €r%rîz)subdirmatcher.__init__.."søèø€ÐA±.¨Q˜q D�y±.ùsƒ) rÄrpr™Ú_pathÚ_matcherrzÚ_alwaysr¤rðrUrKró)r˜rHÚmatcherr�rÆs ` €r%r™zsubdirmatcher.__init__sœù€Ü Œm˜TÑ+Ô-؈Œ ؈Œ Ø—~‘~Ó'ˆŒ ð—^’^ó á#�Ø�|‰|˜D 4™KÔ(ð Œc�$‹i˜!‰mˆoÒ Ø#ñ ˆŒ ð �>‰>Ô ÜÓA°'·.².ÓAÓAˆD�Lð ùò sÁ,B/có\—|jj|jdz|z|«y©Nr?)rtrrsr s r%rzsubdirmatcher.bad$s$€Ø � ‰ ×ј$Ÿ*™* tÑ+¨aÑ/°Õ5r=cóX—|jj|jdz|z«Srx)rtr›rsr«s r%r›zsubdirmatcher.matchfn's'€ð �}‰}×$Ñ$ T§Z¡Z°$Ñ%6¸Ñ%:Ó;Ð;r=có€—|dk(r |j}n|jdz|z}|jj|«S©Nr=r?)rsrtr²r°s r%r²zsubdirmatcher.visitdir.s:€Ø �#Š:Ø—*‘*‰Cà—*‘*˜tÑ# cÑ)ˆCØ�}‰}×%Ñ% cÓ*Ð*r=có€—|dk(r |j}n|jdz|z}|jj|«Sr{)rsrtrµr°s r%rµzsubdirmatcher.visitchildrenset5s:€Ø �#Š:Ø—*‘*‰Cà—*‘*˜tÑ# cÑ)ˆCØ�}‰}×-Ñ-¨cÓ2Ð2r=có—|jSry)rur£s r%rzzsubdirmatcher.always<r r=cóT—|jj«xr |j Sry)rtrKrur£s r%rKzsubdirmatcher.prefix?s!€Ø�}‰}×#Ñ#Ó%Ò:¨d¯l©lÐ*:Ð:r=có8—d|j|jfzS)Ns#)rsrtr£s r%rÑzsubdirmatcher.__repr__Bs"€à5Ø �J‰JØ �M‰Mð9 ñ ð r=)r½r¾r¿rÒr™rr›r²rµrzrKrrçrÑrÓrÔs@r%rprpøsFø„ñô4Bò"6ò<ò+ò3òò;ð×Ññ óô r=rpc󆇗eZdZdZd ˆfd„ Zed„«Zd„Zed„«Zd„Z d„Z d„Z d „Z e jd „«ZˆxZS) r/aAdapt a matcher to work on a parent directory. The matcher's non-matching-attributes (bad, traversedir) are ignored. The prefix path should usually be the relative path from the root of this matcher to the root of the wrapped matcher. >>> m1 = match(util.localpath(b'/root/d/e'), b'f', [b'../a.txt', b'b.txt'], auditor=lambda name: None) >>> m2 = prefixdirmatcher(b'd/e', m1) >>> m2(b'a.txt') False >>> m2(b'd/e/a.txt') True >>> m2(b'd/e/b.txt') False >>> m2.files() ['d/e/a.txt', 'd/e/f/b.txt'] >>> m2.exact(b'd/e/a.txt') True >>> m2.visitdir(b'd') True >>> m2.visitdir(b'd/e') True >>> m2.visitdir(b'd/e/f') True >>> m2.visitdir(b'd/e/g') False >>> m2.visitdir(b'd/ef') False cóŠ•—tt|� |«|stjd«‚||_|dz|_||_y)Nsprefix path must not be emptyr?)rÄr/r™rr*rsÚ _pathprefixrt)r˜rHrvr)rÆs €r%r™zprefixdirmatcher.__init__jsBø€Ü Ô Ñ.¨uÔ5ÙÜ×(Ñ(Ð)IÓJÐ J؈Œ Ø $™;ˆÔ؈� r=cón—|jjD�cgc]}|j|z‘Œc}Scc}wry)rtr¤r‚r«s r%r¤zprefixdirmatcher._filesrs1€à.2¯m©m×.BÒ.BÓCÑ.B¨�× Ñ  1Ó$Ð.BÑCÐCùÒCs™2cóœ—|j|j«sy|jj|t |j«d«Sr­)rðr‚rtr›rUr«s r%r›zprefixdirmatcher.matchfnvs?€Ø�|‰|˜D×,Ñ,Ô-ØØ�}‰}×$Ñ$ Q¤s¨4×+;Ñ+;Ó'<Ð'>Ð%?Ó@Ð@r=cóR—ttj|j««Sry)r¨rrôrsr£s r%Ú _pathdirszprefixdirmatcher._pathdirs{s€ä”8×$Ñ$ T§Z¡ZÓ0Ó1Ð1r=có —||jk(r|jjd«S|j|j«r1|jj|t |j«d«S||j vSr)rsrtr²rðr‚rUr†r°s r%r²zprefixdirmatcher.visitdirsl€Ø �$—*‘*Ò Ø—=‘=×)Ñ)¨#Ó.Ð .Ø �>‰>˜$×*Ñ*Ô +Ø—=‘=×)Ñ)¨#¬c°$×2BÑ2BÓ.CÐ.EÐ*FÓGÐ GØ�d—n‘nÐ$Ð$r=có —||jk(r|jjd«S|j|j«r1|jj|t |j«d«S||j vryt«S)Nr=r´)rsrtrµrðr‚rUr†r¨r°s r%rµz!prefixdirmatcher.visitchildrenset†ss€Ø �$—*‘*Ò Ø—=‘=×1Ñ1°#Ó6Ð 6Ø �>‰>˜$×*Ñ*Ô +Ø—=‘=×1Ñ1°#´c¸$×:JÑ:JÓ6KÐ6MÐ2NÓOÐ OØ �$—.‘.Ñ ØÜ‹uˆ r=có6—|jj«Sry)rtr¹r£s r%r¹zprefixdirmatcher.isexact�s€Ø�}‰}×$Ñ$Ó&Ð&r=có6—|jj«Sry)rtrKr£s r%rKzprefixdirmatcher.prefix’s€Ø�}‰}×#Ñ#Ó%Ð%r=có^—dtj|j«|jfzS)Ns&)r rrsrtr£s r%rÑzprefixdirmatcher.__repr__•s-€à8Ü × Ñ ˜TŸZ™ZÓ (Ø �M‰Mð< ñ ð r=ry)r½r¾r¿rÒr™rÁr¤r›r†r²rµr¹rKrrçrÑrÓrÔs@r%r/r/Jskø„ñõ> ðñDóðDòAð ñ2óð2ò%òò'ò&ð×Ññ óô r=r/cóX‡—eZdZdZˆfd„Zd„Zd„Zd„Zejd„«Z ˆxZ S)rVz�A matcher that is the union of several matchers. The non-matching-attributes (bad, traversedir) are taken from the first matcher. cód•—|d}tt|� «|j|_||_y)Nr)rÄrVr™rÀÚ _matchers)r˜r4rVrÆs €r%r™zunionmatcher.__init__¤s,ø€Ø �a‰[ˆÜ Œl˜DÑ*Ô,ØŸ>™>ˆÔØ!ˆ�r=có:—|jD] }||«sŒ yy©NTF©rŽ)r˜r�r"s r%r›zunionmatcher.matchfnªs€Ø—^”^ˆEÙ�Q�xÙð$ðr=cój—d}|jD]!}|j|«}|dk(r|cS||z}Œ#|S)NFrÍ)rŽr²)r˜r±Úrr$Úvs r%r²zunionmatcher.visitdir°s>€Ø ˆØ—”ˆAØ— ‘ ˜3“ˆAØ�FŠ{Ø’Ø �‰F‰Að  ð ˆr=cóÚ—t«}d}|jD]L}|j|«}|sŒ|dk(r|cS|s|dk(rd}Œ*t|t«sJ‚|j |«}ŒN|ry|S)NFrÍr´T)r¨rŽrµr:Úunion)r˜r±r“Úthisr$r”s r%rµzunionmatcher.visitchildrenset¹sy€Ü ‹EˆØˆØ—”ˆAØ×"Ñ" 3Ó'ˆAÙØØ�FŠ{Ø’Ù�q˜G’|Ø�àܘa¤Ô%Ð %Ð%Ø—‘˜“ ‰Að ñ ØØˆr=có —d|jzS)Nsr‘r£s r%rÑzunionmatcher.__repr__Ìs€à,¨t¯~©~Ñ=Ð=r=) r½r¾r¿rÒr™r›r²rµrrçrÑrÓrÔs@r%rVrV�s6ø„ñô "ò ò òð&×Ññ>óô>r=rVcó —t||«dS)aIf pattern is 'kind:pat' with a known kind, return kind. >>> patkind(br're:.*\.c$') 're' >>> patkind(b'glob:*.c') 'glob' >>> patkind(b'relpath:test.py') 'relpath' >>> patkind(b'main.py') >>> patkind(b'main.py', default=b're') 're' r)rƒ)Úpatternr^s r%Úpatkindr›Ñs€ô �W˜gÓ & qÑ )Ð)r=cóT—d|vr!|jdd«\}}|tvr||fS||fS)zPSplit a string into the optional pattern kind prefix and the actual pattern.ó:r)r†Úallpatternkinds)ršr^r6r7s r%rƒrƒás<€ð ˆw�Ø—M‘M $¨Ó*‰ ˆˆcØ ”?Ñ "ؘ�9Ð Ø �GÐ Ðr=cóJ‡‡ ‡ —dt‰«cŠ Š d}d}tjjj}ˆ ˆ ˆfd„}‰ ‰ k�r\‰‰ ‰ dz}‰ dz Š |dvr||||«z }�n6|dk(r2|«dk(r"‰ dz Š |«dk(r ‰ dz Š |dz }�n |d z }�n|d z }nÿ|d k(r|d z }nô|d k(r‡‰ }|‰ kr‰||dzdvr|dz }|‰ kr!‰||dzdk7r|dz }|‰ kr ‰||dzdk7rŒ|‰ k\r|dz }n¨‰‰ |j dd«}|dzŠ |dddk(r d|ddz}n |dddk(rd|z}d||fz}nh|dk(r |dz }|dz }nX|dk(r |r |dz }|dz}nF|dk(r|r|dz }n9|dk(r(|«}|r‰ dz Š ||||«z }n||||«z }n ||||«z }‰ ‰ kr�Œ\|S)a Convert an extended glob string to a regexp string. >>> from . import pycompat >>> def bprint(s): ... print(pycompat.sysstr(s)) >>> bprint(_globre(br'?')) . >>> bprint(_globre(br'*')) [^/]* >>> bprint(_globre(br'**')) .* >>> bprint(_globre(br'**/a')) (?:.*/)?a >>> bprint(_globre(br'a/**/b')) a/(?:.*/)?b >>> bprint(_globre(br'[a*?!^][^b][!c]')) [a*?!^][\^b][^c] >>> bprint(_globre(br'{a,b}')) (?:a|b) >>> bprint(_globre(br'.\*\?')) \.\*\? rr=có"•—‰‰kxr‰‰‰dzS)NrrN)ÚiÚnr7s€€€r%Úpeekz_globre..peeksø€Ø�1‰uÒ'˜˜Q  Q¡˜Ð'r=rs*?[{},\ó*r?s(?:.*/)?ó.*ó[^/]*ó?ó.ó[s!]ó]s\[ó\s\\ó!ó^Ns%s[%s]ó{s(?:ó}ó)ó,ó|)rUr r Úregexbytesescapemapr%Úreplace) r7ÚresÚgroupÚescaper£rNÚjÚstuffrcr¡r¢s ` @@r%Ú_globrerºësFú€ð. Œc�#‹h€D€A€qØ €CØ €EÜ �_‰_× 0Ñ 0× 4Ñ 4€Fö(ð ˆa‹%Ø ��A˜‘EˆNˆØ ˆQ‰ˆØ �KÑ Ø ‘6˜!˜Q“<Ñ ŠCØ �$ŠYÙ‹v˜Š~Ø�Q‘�Ù“6˜T’>ؘ‘F�Aؘ;Ñ&’Cà˜5‘L’Cà�x‘‘Ø �$ŠYØ �4‰K‰CØ �$ŠY؈AØ�1Šu˜˜Q  Q¡˜¨5Ñ0Ø�Q‘�Ø�a’%˜C  A¨¡E˜N¨dÒ2Ø�Q‘�ð�a’%˜C  A¨¡E˜N¨dÓ2à�AŠvØ�v‘ ‘à˜A˜a˜×(Ñ(¨°Ó8�ؘ‘E�ؘ˜1�: Ò%Ø  5¨¨ 9Ñ,‘Eؘ1˜Q�Z 4Ò'Ø! E™M�EØ 3¨ ,Ñ.‘Ø �$ŠYØ �Q‰JˆEØ �6‰M‰CØ �$ŠY™5Ø �4‰KˆCØ �Q‰J‰EØ �$ŠY™5Ø �4‰K‰CØ �%ŠZÙ“ˆAÙØ�Q‘�Ø‘v˜a “|Ñ#‘à‘v˜a “|Ñ#‘à ‘6˜!˜Q“<Ñ ˆCðc ˆaŒ%ðd €Jr=s^\(\?([aiLmsux]+)\)(.*)có�—|s|dvry|dk(r|S|dk(rtjd«‚|dvr(|dk(rytjj |«dzS|d k(r3|dk(rd}|d zStjj |«d z}|d zS|d k(r8t |«}|j d «rd|td «dz|zSd|z|zS|dk(rMd}tj|«}|r|j«\}}|j d«sd|z}|�d||fz}|S|dvrt |«|zStjd||fz«‚)z|Convert a (normalized) pattern of any kind into a regular expression. globsuffix is appended to the regexp of globs.)rrr=rrz7'filepath:' patterns should not be converted to a regex©rrr¨r)rr?s[^/]+$rr¦r¥Ns(?:|.*/)rr­s(?%s:%s)©rrsnot a regex pattern: %s:%s) rr*r r ÚreescaperºrðrUÚFLAG_REr"Úgroups)r6r7Ú globsuffixÚescapedÚglobreÚflagr$s r%Ú_regexrÅBsŒ€ñ �4Ð0Ñ0ØØ ˆu‚}؈ Ø ˆ{ÒÜ×$Ñ$Ø Eó ð ð Ð$Ñ$Ø �$Š;ØÜ�‰×'Ñ'¨Ó,¨zÑ9Ð9Ø ˆ~ÒØ �$Š;؈Gð ˜Ñ"Ð"ô—o‘o×.Ñ.¨sÓ3°dÑ:ˆGà˜Ñ"Ð"Ø ˆzÒܘ“ˆØ × Ñ ˜XÔ &ð˜6¤# h£- /Ð2Ñ2°ZÑ?Ð ?ؘVÑ# jÑ0Ð0Ø ˆxÒØˆÜ �M‰M˜#Ó ˆÙ ØŸ™› ‰IˆD�#Ø�~‰~˜dÔ#ؘ#‘+ˆCØ Ð Ø $¨ Ñ,ˆC؈ Ø Ð%Ñ%Ü�s‹|˜jÑ(Ð(Ü × Ñ Ð!>À$ÈÀÑ!LÓ MÐMr=cóÆ‡ ‡ ‡ ‡ —gŠ t||«\Š }‰ riŠ ˆ ˆ fd„}‰ j|«d}|r‹td„|D««rY|D���chc]\}}}|’Œ c}}}Š ˆ fd„}dtjt t ‰ «««z}‰ j|«n t||«\}}‰ j|«t‰ «dk(r|‰ dfS|ˆ fd„fScc}}}w) zlReturn regexp string and a matcher function for kindpats. globsuffix is appended to the regexp of globs.c󪕗‰D]M\}}|j|«sŒ‰j|«}|€ t|Ž}|‰|<||t|«d«sŒMyyr�)rðr%r"rU)r�rKrJÚmfÚ subincludesÚ submatcherss €€r%Úmatchsubincludez$_buildmatch..matchsubincludeys`ø€Û'2Ñ#�˜ Ø—<‘< Õ'Ø$Ÿ™¨Ó0�BØ�zÜ" KÐ0˜Ø.0˜  FÑ+á˜!œC ›K˜MÐ*Õ+Ù#ð(3ðr=r=c3ó.K—|] \}}}|dk(–—Œy­w)rNrN)rër‘rcrås r%rîz_buildmatch..‰sèø€Ð;±(¡w q¨!¨Qˆq�NÕ"±(ùs‚cóN•—|jd«}|dk\r |d|}|‰vSd}|‰vS)Nr?rr¨)r!)r�r¡r±rs €r%rÈz_buildmatch..mfŒs?ø€Ø—G‘G˜D“M�ؘ’6ؘB˜Q˜%�Cð˜d�{Ð"ð�Cؘd�{Ð"r=srootfilesin: %srrcó.•‡—tˆfd„‰D««S)Nc3ó.•K—|] }|‰«–—Œy­wryrN)rërÈr�s €r%rîz0_buildmatch....�søèø€Ð#?±J¨b¡B q§E±Jùóƒ©ró)r�Ú matchfuncss`€r%Úz_buildmatch..�sù€¤Ó#?±JÓ#?Ô ?r=) rLr+Úallr Úpprintr;rAÚ_buildregexmatchrU) r1rÁrErËr#r‘rcrårÈrrÒrÉrÊs @@@@r%rþrþpsåû€ð€Jä-¨h¸Ó=Ñ€K�ÙØˆ õ ð ×ј/Ô*à €EÙÜ Ñ;±(Ó;Ô ;Ù%-Õ.¡X™'˜!˜Q ’A XÓ.ˆDô #ð'¬×):Ñ):¼4ÄÀtà Ó;MÓ)NÑNˆEØ × Ñ ˜bÕ !ä(¨°:Ó>‰IˆE�2Ø × Ñ ˜bÔ !ä ˆ:ƒ˜!ÒØ�j ‘mÐ#Ð#àÓ?Ð?Ð?ùô'/sÁ Ci Ncó$—dj|«S)z5gather multiple regular expressions into a single oner²)rC)Úregexpss r%Ú _joinregexesrÙ£s€à �9‰9�WÓ Ðr=c 󇇇‡— g}g}t«Š|D]9\}}}|dk(r‰j|«Œ|jt|||««Œ;t |«}d}d} t |«D]s\} } t | «} | tkDr#td«| z} tj| «‚| | ztkDr#||| }|jt |««| }d} | | dzz } Œu|dk(rt|«Šˆfd„Šn=||d}|jt |««|D�cgc] }t|«‘Œc}Šˆfd„Љ}‰r|sˆfd„}nˆˆfd „}||fScc}w#tj$r§|D]ƒ\}}}|dk(rŒ tt|||««Œ%#tj$rJ|r$tjtd «|||fz«‚tjtd «||fz«‚wxYwtjtd ««‚wxYw) aKBuild a match function from a list of kinds and kindpats, return regexp string and a matcher function. Test too large input >>> _buildregexmatch([ ... (b'relglob', b'?' * MAX_RE_SIZE, b'') ... ], b'$') Traceback (most recent call last): ... Abort: matcher pattern is too long (20009 bytes) rrs&matcher pattern is too long (%d bytes)rcó&•—t‰|««Sry)r\)rårvs €r%rÓz"_buildregexmatch..Ðsø€œT¡'¨!£*Ô-r=Ncó.•‡—tˆfd„‰D««S)Nc3ó.•K—|] }|‰«–—Œy­wryrN)rër$rås €r%rîz5_buildregexmatch....Õsøèø€Ð ;©{¨!¡ 1§©{ùrÐrÑ)råÚ allmatcherss`€r%rÓz"_buildregexmatch..Õsù€œSÓ ;©{Ó ;Ô;r=có •—|‰vSryrN)rårws €r%rÓz"_buildregexmatch..Üs ø€ q¨E¡zr=có •—|‰vxs‰|«SryrN)rårwÚfuncs €€r%rÓz"_buildregexmatch..Þsø€ q¨E zÒ'<±T¸!³WÐ'>> r = _rootsdirsandparents( ... [(b'glob', b'g/h/*', b''), (b'glob', b'g/h', b''), ... (b'glob', b'g*', b'')]) >>> print(r[0:2], sorted(r[2])) # the set has an unstable output (['g/h', 'g/h', ''], []) ['', 'g'] >>> r = _rootsdirsandparents( ... [(b'rootfilesin', b'g/h', b''), (b'rootfilesin', b'', b'')]) >>> print(r[0:2], sorted(r[2])) # the set has an unstable output ([], ['g/h', '']) ['', 'g'] >>> r = _rootsdirsandparents( ... [(b'relpath', b'r', b''), (b'path', b'p/p', b''), ... (b'path', b'', b'')]) >>> print(r[0:2], sorted(r[2])) # the set has an unstable output (['r', 'p/p', ''], []) ['', 'p'] >>> r = _rootsdirsandparents( ... [(b'relglob', b'rg*', b''), (b're', b're/', b''), ... (b'relre', b'rr', b'')]) >>> print(r[0:2], sorted(r[2])) # the set has an unstable output (['', '', ''], []) [''] )rïr¨Úupdaterr)r1r“rrcs r%r,r,sR€ô:  Ó )�D€A€qä ‹€Að‡H�HŒX�]‰]˜1Ó ÔØ‡H�HŒX�]‰]˜1Ó Ôð ˆa�ˆ7€Nr=cóP—|D�cgc] }|ddvsŒ |‘Œ}}t|«Scc}w)zÉReturns the potential explicit filenames from the patterns. >>> _explicitfiles([(b'path', b'foo/bar', b'')]) ['foo/bar'] >>> _explicitfiles([(b'rootfilesin', b'foo/bar', b'')]) [] rrî)r-)r1raÚfilables r%rürüAs4€ñ%ÓG™H�b¨¨1©Ð5FÒ(FŠr˜H€GÐGÜ �'‹?ÐùòHs… #’#có&—|D] \}}}|dvsŒ yy)z:Whether all the patterns match a prefix (i.e. recursively)r¼FTrNrOs r%rýrýOs$€ã%шˆc�6Ø Ð,Ò ,Ùð&ð r=cóF—dddddddœ}d}g}t|d«}t|d¬ «D�]?\}}d |vrbtstjj d «atj |«} | r|d | jd«}|jd d «}|j«}|sŒ€|jd«r|dd j«} || }Œ«|} |j«D]Q\} } |j| «r| } |t| «d }n+|j| dz«sŒ>| } |t| «dzd }n|r|j!| |z||f«�Œ,|j!| |z«�ŒB|j#«|S#t$r|r|td«|| fz«YŒÎwxYw)a.parse a pattern file, returning a list of patterns. These patterns should be given to compile() to be validated and converted into a match function. trailing white space is dropped. the escape character is backslash. comments start with #. empty lines are skipped. lines can be of the following formats: syntax: regexp # defaults following lines to non-rooted regexps syntax: glob # defaults following lines to non-rooted globs re:pattern # non-rooted regular expression glob:pattern # non-rooted glob rootglob:pat # rooted glob (same root as ^ in regexps) pattern # pattern of the current default type if sourceinfo is set, returns a list of tuples: (pattern, lineno, originalline). This is useful to debug ignore patterns. srelre:srelglob:s rootglob:rr)rsregexprrrrsrbr)Ústartó#s((?:^|[^\\])(?:\\\\)*)#.*Ns\#ssyntax:és!%s: ignoring invalid syntax '%s' r�)rrâÚ _commentrer rrÚsearchÚendr´ÚrstriprðÚstripÚKeyErrorrÚitemsrUr+Úclose) Úfilepathr`Ú sourceinfoÚsyntaxesÚsyntaxr]ÚfpÚlinenoÚliner$råÚ linesyntaxÚrelss r%rŠrŠZs¼€ð2ØØØ!ØØ$ñ €Hð€FØ€Hä ˆh˜Ó €BÜ! "¨A×.Ð.‰ ˆ�Ø �4‰<åÜ!ŸW™WŸ_™_Ð-JÓK� ä×!Ñ! $Ó'ˆAÙØ˜J˜aŸe™e A›hÐ'�à—<‘< ¨Ó-ˆDØ�{‰{‹}ˆÙØ à �?‰?˜:Ô &Ø�Q�R�—‘Ó ˆAð Ø! !™�ð àˆ Ø—~‘~Ö'‰GˆAˆtØ�‰˜tÔ$Ø!� ØœC ›I˜KÐ(�ÙØ—‘  T¡Õ*Ø!� ØœC ›F Q™J˜LÐ)�Ùð(ñ Ø �O‰O˜Z¨$Ñ.°¸Ð=Ö >à �O‰O˜J¨Ñ-Ö .ðO/ðP‡H�H„JØ €Oøô-ò ÙÙÜÐ?Ó@ÀHÈaÀ=ÑPôùð úsà E<ÅrsîðóÛ ÛÛ Û åÝ÷÷õà ˆ&× Ñ ˜JÓ '€ð€ð 0Ðà×"Ñ"€ òóò0ò2ð ØØ ó"ð@Ø Ø Ø Ø Ø ØØ Ø Ø óc óL,ó óò ó9÷xqNñqNôh"�Kô"ô,!�;ô!ô6 2�{ô 2ò Qô6EN�[ôEN÷V"+ñ"+ôJ:N�[ô:NôzV8�;ôV8ôrBJ˜ ôBJòJ'ô(:L˜+ô:LôzO �KôO ôdP �{ôP ôf1>�;ô1>óh *ò òQðh �'‰'�/‰/Ð5Ó 6€ò+Nò\-@ð`€ òò E1òPò>ò )òX òð€ ôMr=