mercurial/util.py
changeset 869 1e3a23719662
parent 839 9c918287d10b
child 870 a82eae840447
equal deleted inserted replaced
868:6a8a50bcc143 869:1e3a23719662
    88         if cwd: name = os.path.join(cwdsep, name)
    88         if cwd: name = os.path.join(cwdsep, name)
    89         name = os.path.normpath(name)
    89         name = os.path.normpath(name)
    90         if name == '.': name = '**'
    90         if name == '.': name = '**'
    91         return head + globre(name, '', tail)
    91         return head + globre(name, '', tail)
    92 
    92 
    93     def under(fn):
       
    94         """check if fn is under our cwd"""
       
    95         return not cwd or fn.startswith(cwdsep)
       
    96 
       
    97     def matchfn(pats, tail):
    93     def matchfn(pats, tail):
    98         """build a matching function from a set of patterns"""
    94         """build a matching function from a set of patterns"""
    99         if pats:
    95         if pats:
   100             pat = '(?:%s)' % '|'.join([regex(p, tail) for p in pats])
    96             pat = '(?:%s)' % '|'.join([regex(p, tail) for p in pats])
   101             return re.compile(pat).match
    97             return re.compile(pat).match