mercurial/util.py
changeset 19461 dd7c992d3cc1
parent 19287 8b04e1344111
child 19710 887ffa22fd0d
child 19845 a1237a4b437d
equal deleted inserted replaced
19460:d876c82f25a3 19461:dd7c992d3cc1
   671     only flags from the re module that are re2-compatible are
   671     only flags from the re module that are re2-compatible are
   672     IGNORECASE and MULTILINE.'''
   672     IGNORECASE and MULTILINE.'''
   673     global _re2
   673     global _re2
   674     if _re2 is None:
   674     if _re2 is None:
   675         try:
   675         try:
   676             re2.compile
   676             # check if match works, see issue3964
   677             _re2 = True
   677             _re2 = bool(re2.match(r'\[([^\[]+)\]', '[ui]'))
   678         except ImportError:
   678         except ImportError:
   679             _re2 = False
   679             _re2 = False
   680     if _re2 and (flags & ~(re.IGNORECASE | re.MULTILINE)) == 0:
   680     if _re2 and (flags & ~(re.IGNORECASE | re.MULTILINE)) == 0:
   681         if flags & re.IGNORECASE:
   681         if flags & re.IGNORECASE:
   682             pat = '(?i)' + pat
   682             pat = '(?i)' + pat