Patchwork D2475: py3: make sure regexes are bytes

login
register
mail settings
Submitter phabricator
Date Feb. 27, 2018, 12:57 p.m.
Message ID <5a719dc0976f90378dc2456509b34e2b@localhost.localdomain>
Download mbox | patch
Permalink /patch/28458/
State Not Applicable
Headers show

Comments

phabricator - Feb. 27, 2018, 12:57 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG9e3cb58c7ab3: py3: make sure regexes are bytes (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D2475?vs=6155&id=6171

REVISION DETAIL
  https://phab.mercurial-scm.org/D2475

AFFECTED FILES
  hgext/convert/cvsps.py
  hgext/convert/subversion.py
  hgext/lfs/blobstore.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/lfs/blobstore.py b/hgext/lfs/blobstore.py
--- a/hgext/lfs/blobstore.py
+++ b/hgext/lfs/blobstore.py
@@ -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):
diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -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')):
diff --git a/hgext/convert/cvsps.py b/hgext/convert/cvsps.py
--- a/hgext/convert/cvsps.py
+++ b/hgext/convert/cvsps.py
@@ -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]))