diff mercurial/hgweb/webutil.py @ 38475:67dc32d4e790

cleanup: migrate from re.escape to stringutil.reescape This has consistent behavior on Python 2.7, 3.6, and 3.7 and has the benefit of probably being a little faster. Test output changes are largely because / used to be pointlessly escaped. Differential Revision: https://phab.mercurial-scm.org/D3842
author Augie Fackler <augie@google.com>
date Tue, 26 Jun 2018 10:36:23 -0400
parents dae829b4de78
children 4455e5d4d59c
line wrap: on
line diff
--- a/mercurial/hgweb/webutil.py	Tue Jun 26 10:33:52 2018 -0400
+++ b/mercurial/hgweb/webutil.py	Tue Jun 26 10:36:23 2018 -0400
@@ -766,7 +766,7 @@
     for key, pattern in websubdefs:
         # grab the delimiter from the character after the "s"
         unesc = pattern[1:2]
-        delim = re.escape(unesc)
+        delim = stringutil.reescape(unesc)
 
         # identify portions of the pattern, taking care to avoid escaped
         # delimiters. the replace format and flags are optional, but