mercurial/fileset.py
changeset 38904 899b4c74209c
parent 38902 61ab546b71c3
child 38915 da3bd2afd68d
equal deleted inserted replaced
38903:73731fa8d1bd 38904:899b4c74209c
    47     return mctx.matcher([x])
    47     return mctx.matcher([x])
    48 
    48 
    49 def kindpatmatch(mctx, x, y):
    49 def kindpatmatch(mctx, x, y):
    50     return stringmatch(mctx, _getkindpat(x, y, matchmod.allpatternkinds,
    50     return stringmatch(mctx, _getkindpat(x, y, matchmod.allpatternkinds,
    51                                          _("pattern must be a string")))
    51                                          _("pattern must be a string")))
       
    52 
       
    53 def patternsmatch(mctx, *xs):
       
    54     allkinds = matchmod.allpatternkinds
       
    55     patterns = [getpattern(x, allkinds, _("pattern must be a string"))
       
    56                 for x in xs]
       
    57     return mctx.matcher(patterns)
    52 
    58 
    53 def andmatch(mctx, x, y):
    59 def andmatch(mctx, x, y):
    54     xm = getmatch(mctx, x)
    60     xm = getmatch(mctx, x)
    55     ym = getmatch(mctx, y)
    61     ym = getmatch(mctx, y)
    56     return matchmod.intersectmatchers(xm, ym)
    62     return matchmod.intersectmatchers(xm, ym)
   434 
   440 
   435 methods = {
   441 methods = {
   436     'string': stringmatch,
   442     'string': stringmatch,
   437     'symbol': stringmatch,
   443     'symbol': stringmatch,
   438     'kindpat': kindpatmatch,
   444     'kindpat': kindpatmatch,
       
   445     'patterns': patternsmatch,
   439     'and': andmatch,
   446     'and': andmatch,
   440     'or': ormatch,
   447     'or': ormatch,
   441     'minus': minusmatch,
   448     'minus': minusmatch,
   442     'list': listmatch,
   449     'list': listmatch,
   443     'not': notmatch,
   450     'not': notmatch,