hgext/schemes.py
changeset 31191 150cd5125722
parent 30645 7a3e67bfa417
child 31297 198cd5ad9db8
--- a/hgext/schemes.py	Fri Mar 03 13:29:50 2017 -0500
+++ b/hgext/schemes.py	Fri Mar 03 13:25:30 2017 -0500
@@ -63,6 +63,7 @@
 # leave the attribute unspecified.
 testedwith = 'ships-with-hg-core'
 
+_partre = re.compile(r'\{(\d+)\}'.encode(u'latin1'))
 
 class ShortRepository(object):
     def __init__(self, url, scheme, templater):
@@ -70,7 +71,7 @@
         self.templater = templater
         self.url = url
         try:
-            self.parts = max(map(int, re.findall(r'\{(\d+)\}', self.url)))
+            self.parts = max(map(int, _partre.findall(self.url)))
         except ValueError:
             self.parts = 0