-=[ Mr. Bumblebee ]=-
_Indonesia_

Path : /usr/lib/python2.7/dist-packages/mercurial/
File Upload :
Current File : //usr/lib/python2.7/dist-packages/mercurial/match.pyc

ó
Ì\,Tc@söddlZddlZddlZddlmZd„Zd„Zdefd„ƒYZdefd„ƒYZ	d	efd
„ƒYZ
defd„ƒYZdd
„Z
d„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZdS(iÿÿÿÿN(t_cCs9tjj|ƒ}y|jSWntk
r4|jSXdS(sZcompile the regexp with the best available regexp engine and return a
    matcher functionN(tutiltretcompilet
test_matchtAttributeErrortmatch(tregextm((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt
_rematchers

cCs‰tƒ}g}xm|D]e\}}|dkrh|sFtjdƒ‚n|j|ƒ}|j|ƒqn|j||fƒqW||fS(s;Returns the kindpats list with the 'set' patterns expanded.tsets"fileset expression with no context(R
RtAbortt
getfilesettupdatetappend(tkindpatstctxtfsettothertkindtpatts((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt_expandsetss	
RcBsweZggded
d
d„Zd„Zd„Zd„Zd
Zd
Z	d„Z
d„Zd„Zd„Z
d	„ZRS(tglobc
s5||_||_g|_t|p'|ƒ|_|	|_t|_|r~t|d|||ƒ}
t	|	|
dƒ\|_
‰n|rºt|d|||ƒ}
t	|	|
dƒ\|_‰n|röt|t
ƒrÛ||_nt
|ƒ|_|j‰nc|rYt|||||ƒ}
t|
ƒ|_|jp5t|
ƒ|_t	|	|
dƒ\|_‰n|se|rÂ|rž|r‰‡‡‡fd†}q¿‡‡fd†}q|r¹‡‡fd†}qˆ}nT|rì|r㇇fd†}qˆ}n*|r‡fd†}nd	„}t|_||_t|jƒ|_d
S(sbuild 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
        exact - patterns are actually filenames (include/exclude still apply)

        a pattern is one of:
        'glob:<glob>' - a glob relative to cwd
        're:<regexp>' - a regular expression
        'path:<path>' - a path relative to repository root
        'relglob:<glob>' - an unrooted glob (*.c matches C files in all dirs)
        'relpath:<path>' - a path relative to cwd
        'relre:<regexp>' - a regexp that needn't match the start of a name
        'set:<fileset>' - a fileset expression
        '<something>' - a pattern of the specified default type
        Rs(?:/|$)t$cs#ˆ|ƒo"ˆ|ƒo"ˆ|ƒS(N((tf(temtimtpm(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt<lambda>Zscsˆ|ƒoˆ|ƒS(N((R(RR(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR\scsˆ|ƒoˆ|ƒS(N((R(RR(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR_scsˆ|ƒoˆ|ƒS(N((R(RR(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRescsˆ|ƒS(N((R(R(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRjscSstS(N(tTrue(R((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRlsN(t_roott_cwdt_filestboolt_anypatst_ctxtFalset_alwayst
_normalizet_buildmatcht
includepatt
excludepatt
isinstancetlisttexactt_rootstpatternspatRtmatchfnR
t_fmap(tselftroottcwdtpatternstincludetexcludetdefaultR-tauditorRRR((RRRs3/usr/lib/python2.7/dist-packages/mercurial/match.pyt__init__&sP										cCs
|j|ƒS(N(R0(R2tfn((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt__call__rsccsx|jD]}|Vq
WdS(N(R!(R2R((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt__iter__tscCsdS(soCallback from dirstate.walk for each explicit file that can't be
        found/accessed, with an error message.N((R2Rtmsg((s3/usr/lib/python2.7/dist-packages/mercurial/match.pytbadzscCstj|j|j|ƒS(sBConvert repo path back to path that is relative to cwd of matcher.(RtpathtoRR (R2R((s3/usr/lib/python2.7/dist-packages/mercurial/match.pytrel‡scCs|jS(sÒ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!(R2((s3/usr/lib/python2.7/dist-packages/mercurial/match.pytfiles‹scCs
||jkS(s!Returns True if f is in .files().(R1(R2R((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR-“scCs|jS(s)Matcher uses patterns or include/exclude.(R#(R2((s3/usr/lib/python2.7/dist-packages/mercurial/match.pytanypats—scCs|jS(spMatcher will match everything and .files() will be empty
        - optimization might be possible and necessary.(R&(R2((s3/usr/lib/python2.7/dist-packages/mercurial/match.pytalways›sN(t__name__t
__module__R%tNoneR:R<R=R?texplicitdirttraversedirRARBR-RCRD(((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR%sK							R-cBseZd„ZRS(cCs tj||||dtƒdS(NR-(RR:R(R2R3R4RB((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR:¡s(RERFR:(((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR- sRDcBseZd„ZRS(cCs#tj|||gƒt|_dS(N(RR:RR&(R2R3R4((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR:¥s(RERFR:(((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRD¤st
narrowmatchercBs eZdZd„Zd„ZRS(sqAdapt a matcher to work on a subdirectory only.

    The paths are remapped to remove/insert the path as needed:

    >>> m1 = match('root', '', ['a.txt', 'sub/b.txt'])
    >>> m2 = narrowmatcher('sub', m1)
    >>> bool(m2('a.txt'))
    False
    >>> bool(m2('b.txt'))
    True
    >>> bool(m2.matchfn('a.txt'))
    False
    >>> bool(m2.matchfn('b.txt'))
    True
    >>> m2.files()
    ['b.txt']
    >>> m2.exact('b.txt')
    True
    >>> m2.rel('b.txt')
    'b.txt'
    >>> def bad(f, msg):
    ...     print "%s: %s" % (f, msg)
    >>> m1.bad = bad
    >>> m2.bad('x.txt', 'No such file')
    sub/x.txt: No such file
    cs­ˆjˆ_ˆjˆ_|ˆ_ˆˆ_ˆjˆ_gˆjD]-}|j|dƒr@|t|ƒd^q@ˆ_ˆjˆ_‡‡fd†ˆ_	t
ˆjƒˆ_dS(Nt/icsˆjˆjd|ƒS(NRK(R0t_path(R;(tmatcherR2(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRÏs(RR RLt_matcherR&R!t
startswithtlenR#R0R
R1(R2tpathRMR((RMR2s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR:Ås		0cCs"|jj|jd||ƒdS(NRK(RNR?RL(R2RR>((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR?Òs(RERFt__doc__R:R?(((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRJ©s	
cCst||ƒdS(s8If pattern is 'kind:pat' with a known kind, return kind.i(t	_patsplit(tpatternR8((s3/usr/lib/python2.7/dist-packages/mercurial/match.pytpatkindÕsc
CsGd|kr=|jddƒ\}}|dkr=||fSn||fS(
sPSplit a string into the optional pattern kind prefix and the actual
    pattern.t:iRRRQtrelglobtrelpathtrelretlistfilet	listfile0R
(	sresglobspathRWsrelpathRYRZR[sset(tsplit(RTR8RR((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRSÙs	
c	sÃdtˆƒ‰‰d}d}tjj}‡‡‡fd†}x|ˆˆkr¾ˆˆ}ˆd7‰|dkr‚|||ƒ7}qC|dkrç|ƒdkrÚˆd7‰|ƒdkr͈d7‰|d7}qä|d	7}q»|d
7}qC|dkr|d7}qC|d
krõˆ}|ˆkr;ˆ|dkr;|d7}nx*|ˆkrgˆ|dkrg|d7}q>W|ˆkr|d7}q»ˆˆ|!jddƒ}|d‰|ddkrÅd|d}n|ddkrâd|}nd||f}qC|dkr|d7}|d7}qC|dkrA|rA|d7}|d8}qC|dkr`|r`|d7}qC|dkr«|ƒ}|r˜ˆd7‰|||ƒ7}q»|||ƒ7}qC|||ƒ7}qCW|S(sšConvert an extended glob string to a regexp string.

    >>> print _globre(r'?')
    .
    >>> print _globre(r'*')
    [^/]*
    >>> print _globre(r'**')
    .*
    >>> print _globre(r'**/a')
    (?:.*/)?a
    >>> print _globre(r'a/**/b')
    a\/(?:.*/)?b
    >>> print _globre(r'[a*?!^][^b][!c]')
    [a*?!^][\^b][^c]
    >>> print _globre(r'{a,b}')
    (?:a|b)
    >>> print _globre(r'.\*\?')
    \.\*\?
    itcsˆˆkoˆˆS(N(((titnR(s3/usr/lib/python2.7/dist-packages/mercurial/match.pytpeekûsis*?[{},\t*RKs(?:.*/)?s.*s[^/]*t?t.t[s!]t]s\[s\s\\t!t^s%s[%s]t{s(?:t}t)t,t|(RPRRtescapetreplace(	RtrestgroupRmR`tctjtstufftp((R^R_Rs3/usr/lib/python2.7/dist-packages/mercurial/match.pyt_globreãsf
















	
cCs±|s
dS|dkr|S|dkr>dtjj|ƒdS|dkr\dt|ƒ|S|dkr|tjj|ƒdS|d	kr£|jdƒr›|Sd
|St|ƒ|S(sxConvert a (normalized) pattern of any kind into a regular expression.
    globsuffix is appended to the regexp of globs.R]RRQRgs(?:/|$)RWs(?:|.*/)RXRYs.*(RRRmRuRO(RRt
globsuffix((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt_regex1scsct||ƒ\‰}|s(dˆjfSt||ƒ\}‰ˆrY|‡‡fd†fS|ˆfS(slReturn regexp string and a matcher function for kindpats.
    globsuffix is appended to the regexp of globs.R]cs|ˆkpˆ|ƒS(N((R(Rtmf(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRMs(Rt__contains__t_buildregexmatch(RRRvR((RRxs3/usr/lib/python2.7/dist-packages/mercurial/match.pyR(Ds
cs}ygddjg|D]\}}t|||ƒ^qƒ}t|ƒdkrVt‚n|t|ƒfSWntk
råt|ƒ}|dkr•‚nt||d |ƒ\}‰t||d|ƒ\}‰|‡‡fd†fStjk
rxxh|D]`\}}ytdt|||ƒƒWqütjk
r[tj	t
dƒ||fƒ‚qüXqüWtj	t
dƒƒ‚nXdS(	sjBuild a match function from a list of kinds and kindpats,
    return regexp string and a matcher function.s(?:%s)Rli Nicsˆ|ƒpˆ|ƒS(N((R(tatb(s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRbssinvalid pattern (%s): %ssinvalid patternN(tjoinRwRPt
OverflowErrorR	RzRterrorRRR(RRvtkRtRtltregexatregexb((R{R|s3/usr/lib/python2.7/dist-packages/mercurial/match.pyRzPs(,	
'cCsLg}x?g|D]}t||ƒ^qD]\}}|d	kr\tj||||ƒ}nÕ|d
krztj|ƒ}n·|dkr1y\tj|ƒ}	|dkr¶|	jdƒ}	n|	jƒ}	g|	D]}
|
rÉ|
^qÉ}	Wn*tk
rtj	t
dƒ|ƒ‚nX|t|	||||ƒ7}q)n|j||fƒq)W|S(sConvert 'kind:pat' from the patterns list to tuples with kind and
    normalized and rooted patterns and with listfiles expanded.RRXRWRQRZR[tsunable to read file list (%s)(sglobsrelpath(srelglobspath(slistfiles	listfile0(
RStpathutilt	canonpathRtnormpathtreadfileR\t
splitlinestEnvironmentErrorRRR'R(R5R8R3R4R9RRtRRRBR((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR'ks&/#
cCsÜg}xÏ|D]Ç\}}|dkr¥g}xX|jdƒD]G}d|ksqd|ksqd|ksqd|kruPn|j|ƒq;W|jdj|ƒpždƒq
|d
krÇ|j|pÀdƒq
|jdƒq
W|S(sHreturn roots and exact explicitly listed files from patterns

    >>> _roots([('glob', 'g/*'), ('glob', 'g'), ('glob', 'g*')])
    ['g', 'g', '.']
    >>> _roots([('relpath', 'r'), ('path', 'p/p'), ('path', '')])
    ['r', 'p/p', '.']
    >>> _roots([('relglob', 'rg*'), ('re', 're/'), ('relre', 'rr')])
    ['.', '.', '.']
    RRKRdRhRaRbRcRXRQ(srelpathspath(R\RR}(RtrRRR3Rt((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR.„s
0cCs+x$|D]\}}|dkrtSqWdS(NRRRWRYR
(sglobsresrelglobsrelresset(R(RRR((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyR#s(RRR…ti18nRR	RtobjectRR-RDRJRGRURSRuRwR(RzR'R.R#(((s3/usr/lib/python2.7/dist-packages/mercurial/match.pyt<module>s"	
	{,	
	N					

Copyright © 2017 || Recoded By Mr.Bumblebee