Read about our upcoming Code of Conduct on this issue

Commit 87d8365a authored by Raphaël Gomès's avatar Raphaël Gomès
Browse files

python3: prefix all regex to work with python 2 and 3

parent fa534a8c5863
......@@ -14,10 +14,10 @@ Mercurial tests
'''
ignored_patterns = [
re.compile('^#if'),
re.compile('^#else'),
re.compile('^#endif'),
re.compile('#rest-ignore$'),
re.compile(r'^#if'),
re.compile(r'^#else'),
re.compile(r'^#endif'),
re.compile(r'#rest-ignore$'),
]
......
......@@ -48,7 +48,7 @@ TROUBLES = compat.TROUBLES
shorttemplate = utility.shorttemplate
stacktemplate = utility.stacktemplate
_bookmarksupdater = rewriteutil.bookmarksupdater
sha1re = re.compile(r'\b[0-9a-f]{6,40}\b')
sha1re = re.compile(br'\b[0-9a-f]{6,40}\b')
eh = exthelper.exthelper()
mergetoolopts = commands.mergetoolopts
......
......@@ -88,7 +88,7 @@ class exthelper(object):
def _newdoregister(self, name, *args, **kwargs):
if kwargs.pop('helpbasic', False):
name = '^' + name
name = r'^' + name
return olddoregister(self, name, *args, **kwargs)
self.command._doregister = _newdoregister
......
......@@ -766,11 +766,11 @@ DATECHANGED = 1 << 5 # the date changed
BRANCHCHANGED = 1 << 6 # the branch changed
METABLACKLIST = [
re.compile('^__touch-noise__$'),
re.compile('^branch$'),
re.compile('^.*-source$'),
re.compile('^.*_source$'),
re.compile('^source$'),
re.compile(br'^__touch-noise__$'),
re.compile(br'^branch$'),
re.compile(br'^.*-source$'),
re.compile(br'^.*_source$'),
re.compile(br'^source$'),
]
def ismetablacklisted(metaitem):
......
......@@ -264,8 +264,8 @@ def _contexttopicidx(self):
return None
context.basectx.topicidx = _contexttopicidx
stackrev = re.compile(r'^s\d+$')
topicrev = re.compile(r'^t\d+$')
stackrev = re.compile(br'^s\d+$')
topicrev = re.compile(br'^t\d+$')
hastopicext = common.hastopicext
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment