# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 2018-02-24 10:36:21 # Node ID 54f4328a07c2d888bb655c493ae8f5d83443d874 # Parent e9bcc2efb7e870c0b5a0308daf28630ca97e5cfa py3: make sure regexes are bytes # skip-blame because we added just b'' prefix Differential Revision: https://phab.mercurial-scm.org/D2416 diff --git a/hgext/convert/cvs.py b/hgext/convert/cvs.py --- a/hgext/convert/cvs.py +++ b/hgext/convert/cvs.py @@ -179,7 +179,7 @@ class convert_cvs(converter_source): # :ext:user@host/home/user/path/to/cvsroot if root.startswith(":ext:"): root = root[5:] - m = re.match(r'(?:([^@:/]+)@)?([^:/]+):?(.*)', root) + m = re.match(br'(?:([^@:/]+)@)?([^:/]+):?(.*)', root) # Do not take Windows path "c:\foo\bar" for a connection strings if os.path.isdir(root) or not m: conntype = "local" diff --git a/hgext/convert/monotone.py b/hgext/convert/monotone.py --- a/hgext/convert/monotone.py +++ b/hgext/convert/monotone.py @@ -46,11 +46,11 @@ class monotone_source(common.converter_s raise norepo # regular expressions for parsing monotone output - space = r'\s*' - name = r'\s+"((?:\\"|[^"])*)"\s*' + space = br'\s*' + name = br'\s+"((?:\\"|[^"])*)"\s*' value = name - revision = r'\s+\[(\w+)\]\s*' - lines = r'(?:.|\n)+' + revision = br'\s+\[(\w+)\]\s*' + lines = br'(?:.|\n)+' self.dir_re = re.compile(space + "dir" + name) self.file_re = re.compile(space + "file" + name +