Plan 9 from Bell Labs’s /usr/web/sources/contrib/jas/root/sys/lib/python2.7/site-packages/mercurial/ignore.pyc

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


��Qc@sYddlmZddlZddlZddlZdad�Zd�Zd�Z	dS(i�(t_Nc	Cs�idd6dd6dd6}d}g}g}xK|D]C}d|kr�ts^tjd�antjd|�}|jd	d�}n|j�}|s�q4n|jd
�r�dj�}y||}Wq4tk
r�|j	t
d�|�q4Xq4n||}xb|j�D]T\}}|j|�r7|}Pq|j|d
�r||t|�d}PqqW|j	|�q4W||fS(s�parse lines (iterable) of .hgignore text, returning a tuple of
    (patterns, parse errors). These patterns should be given to compile()
    to be validated and converted into a match function.srelre:tretregexpsrelglob:tglobt#s((^|[^\\])(\\\\)*)#.*s\1s\#ssyntax:isignoring invalid syntax '%s't:i(
t
_commentreRtcompiletsubtreplacetrstript
startswithtstriptKeyErrortappendRt	iteritemstlen(	tlinestsyntaxestsyntaxtpatternstwarningstlinetstpattrels((s4/sys/lib/python2.7/site-packages/mercurial/ignore.pyt
ignorepatss<


c	Cs�i}x�|D]�}||kr%q
ny_g||<t|�}t|�\||<}|j�x"|D]}|d||f�qeWWq
tk
r�}||dkr�|td�||jf�q�q
Xq
Wg|D]"}||kr�|||f^q�S(s:return a dict mapping ignore-file-name to list-of-patternss%s: %s
is)skipping unreadable ignore file '%s': %s
(topenRtclosetIOErrorRtstrerror(	troottfilestwarntpatstftfpRtwarningtinst((s4/sys/lib/python2.7/site-packages/mercurial/ignore.pytreadpats7s 



c	Cs�t|||�}g}x!|D]\}}|j|�qW|sItjSytj|dg|�}Wn{tjk
r�xh|D]\\}}ytj|dg|�Wqtjk
r�}tjd||df��qXqWnX|S(s�return matcher covering patterns in 'files'.

    the files parsed for patterns include:
    .hgignore in the repository root
    any additional files specified in the [ui] section of ~/.hgrc

    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
    pattern        # pattern of the current default typets%s: %si(R'textendtutiltnevertmatchtAbort(	RR R!R"tallpatsR#tpatlistt
ignorefuncR&((s4/sys/lib/python2.7/site-packages/mercurial/ignore.pytignoreKs)(
ti18nRR*R,RtNoneRRR'R1(((s4/sys/lib/python2.7/site-packages/mercurial/ignore.pyt<module>s	)	

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.