mercurial/util.py
changeset 5454 f2ca8d2c988f
parent 5450 c728424d44c6
child 5481 003d1f174fe1
equal deleted inserted replaced
5453:9d77f2b47eb7 5454:f2ca8d2c988f
   482             # made it explode, so we'll divide the pattern list in two
   482             # made it explode, so we'll divide the pattern list in two
   483             # until it works
   483             # until it works
   484             l = len(pats)
   484             l = len(pats)
   485             if l < 2:
   485             if l < 2:
   486                 raise
   486                 raise
   487             a, b = matchfn(pats[:l/2], tail), matchfn(pats[l/2:], tail)
   487             a, b = matchfn(pats[:l//2], tail), matchfn(pats[l//2:], tail)
   488             return lambda s: a(s) or b(s)
   488             return lambda s: a(s) or b(s)
   489         except re.error:
   489         except re.error:
   490             for k, p in pats:
   490             for k, p in pats:
   491                 try:
   491                 try:
   492                     re.compile('(?:%s)' % regex(k, p, tail))
   492                     re.compile('(?:%s)' % regex(k, p, tail))