�
�c@sPddklZddkZddkZddkZdad�Zd�ZdS(i�(t_Nc Cs�hdd<dd<dd<}d}g}g}xY|D]Q}d|joBtptid�antid|�}|id d�}n|i�}|pq:n|id
�oR|di�}y||}Wq:tj
o|i t
d�|�q:Xq:n||}xf|i�D]X\}}|i|�o|}Pq"|i|d
�o||t|�d}Pq"q"W|i |�q:W||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((s#/sys/lib/python/mercurial/ignore.pyt
ignorepatss@!
c
Cs�h}x�|D]�}yUg||<t|�}t|�\||<}x"|D]}|d||f�qIWWq
tj
o;}||djo!|td�||if�q�q
Xq
Wg} g}
|i�D]}|
| i|�q�~
| ptiSnyt i |dg| �}Wn�ti
j
ovxq|i�D]^\}}yt i |dg|�Wq9ti
j
o&}ti
d||df��q9Xq9WnX|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 types%s: %s
is)skipping unreadable ignore file '%s': %s
ts%s: %s(topenRtIOErrorRtstrerrortvaluestextendtutiltnevertmatchtAbortR(
troottfilestwarntpatstftfpRtwarningtinsttallpatst_[1]tpatlistt
ignorefunc((s#/sys/lib/python/mercurial/ignore.pytignore7s8
.
+( ti18nRR!R#RtNoneRRR1(((s#/sys/lib/python/mercurial/ignore.pys<module>s
)
|