mercurial/util.py
changeset 1031 503aaf19a040
parent 1015 22571b8d35d3
child 1062 6d5a62a549fa
equal deleted inserted replaced
1030:28e2f13ca7c4 1031:503aaf19a040
   154         incmatch = matchfn(map(patkind, inc), '(?:/|$)')
   154         incmatch = matchfn(map(patkind, inc), '(?:/|$)')
   155     excmatch = lambda fn: False
   155     excmatch = lambda fn: False
   156     if exc:
   156     if exc:
   157         excmatch = matchfn(map(patkind, exc), '(?:/|$)')
   157         excmatch = matchfn(map(patkind, exc), '(?:/|$)')
   158 
   158 
   159     return roots, lambda fn: (incmatch(fn) and not excmatch(fn) and
   159     return (roots,
   160                               (fn.endswith('/') or
   160             lambda fn: (incmatch(fn) and not excmatch(fn) and
   161                                (not pats and not files) or
   161                         (fn.endswith('/') or
   162                                (pats and patmatch(fn)) or
   162                          (not pats and not files) or
   163                                (files and filematch(fn))))
   163                          (pats and patmatch(fn)) or
       
   164                          (files and filematch(fn)))),
       
   165             (inc or exc or (pats and pats != [('glob', '**')])) and True)
   164 
   166 
   165 def system(cmd, errprefix=None):
   167 def system(cmd, errprefix=None):
   166     """execute a shell command that must succeed"""
   168     """execute a shell command that must succeed"""
   167     rc = os.system(cmd)
   169     rc = os.system(cmd)
   168     if rc:
   170     if rc: