##// END OF EJS Templates
schemes: move re construction to module-level and python3-ify...
Augie Fackler -
r31181:150cd512 default
parent child Browse files
Show More
@@ -63,6 +63,7 command = cmdutil.command(cmdtable)
63 # leave the attribute unspecified.
63 # leave the attribute unspecified.
64 testedwith = 'ships-with-hg-core'
64 testedwith = 'ships-with-hg-core'
65
65
66 _partre = re.compile(r'\{(\d+)\}'.encode(u'latin1'))
66
67
67 class ShortRepository(object):
68 class ShortRepository(object):
68 def __init__(self, url, scheme, templater):
69 def __init__(self, url, scheme, templater):
@@ -70,7 +71,7 class ShortRepository(object):
70 self.templater = templater
71 self.templater = templater
71 self.url = url
72 self.url = url
72 try:
73 try:
73 self.parts = max(map(int, re.findall(r'\{(\d+)\}', self.url)))
74 self.parts = max(map(int, _partre.findall(self.url)))
74 except ValueError:
75 except ValueError:
75 self.parts = 0
76 self.parts = 0
76
77
General Comments 0
You need to be logged in to leave comments. Login now