changeset 36485:9e3cb58c7ab3

py3: make sure regexes are bytes # skip-blame because we are adding just b'' prefixes Differential Revision: https://phab.mercurial-scm.org/D2475
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 27 Feb 2018 14:28:17 +0530
parents 698fe0f6eb5c
children 9ff5cbfbc26a
files hgext/convert/cvsps.py hgext/convert/subversion.py hgext/lfs/blobstore.py
diffstat 3 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/cvsps.py	Tue Feb 27 00:43:37 2018 +0530
+++ b/hgext/convert/cvsps.py	Tue Feb 27 14:28:17 2018 +0530
@@ -170,7 +170,7 @@
         #    /pserver/user/server/path
         # are mapped to different cache file names.
         cachefile = root.split(":") + [directory, "cache"]
-        cachefile = ['-'.join(re.findall(r'\w+', s)) for s in cachefile if s]
+        cachefile = ['-'.join(re.findall(br'\w+', s)) for s in cachefile if s]
         cachefile = os.path.join(cachedir,
                                  '.'.join([s for s in cachefile if s]))
 
--- a/hgext/convert/subversion.py	Tue Feb 27 00:43:37 2018 +0530
+++ b/hgext/convert/subversion.py	Tue Feb 27 14:28:17 2018 +0530
@@ -1129,7 +1129,7 @@
             self.wc = os.path.realpath(path)
             self.run0('update')
         else:
-            if not re.search(r'^(file|http|https|svn|svn\+ssh)\://', path):
+            if not re.search(br'^(file|http|https|svn|svn\+ssh)\://', path):
                 path = os.path.realpath(path)
                 if os.path.isdir(os.path.dirname(path)):
                     if not os.path.exists(os.path.join(path, 'db', 'fs-type')):
--- a/hgext/lfs/blobstore.py	Tue Feb 27 00:43:37 2018 +0530
+++ b/hgext/lfs/blobstore.py	Tue Feb 27 14:28:17 2018 +0530
@@ -27,7 +27,7 @@
 from ..largefiles import lfutil
 
 # 64 bytes for SHA256
-_lfsre = re.compile(r'\A[a-f0-9]{64}\Z')
+_lfsre = re.compile(br'\A[a-f0-9]{64}\Z')
 
 class lfsvfs(vfsmod.vfs):
     def join(self, path):