Patchwork [5,of,6] py3: pass regex as bytes

login
register
mail settings
Submitter Manuel Jacob
Date June 16, 2020, 12:49 p.m.
Message ID <442b269db244464da7c4.1592311767@tmp>
Download mbox | patch
Permalink /patch/46519/
State Accepted
Headers show

Comments

Manuel Jacob - June 16, 2020, 12:49 p.m.
# HG changeset patch
# User Manuel Jacob <me@manueljacob.de>
# Date 1592310829 -7200
#      Tue Jun 16 14:33:49 2020 +0200
# Branch stable
# Node ID 442b269db244464da7c4950db8ec3099f5cf16d5
# Parent  a35a5c188094fec13155a44a8e2c659847af337c
# EXP-Topic convert-svn
py3: pass regex as bytes

Patch

diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py
--- a/hgext/convert/subversion.py
+++ b/hgext/convert/subversion.py
@@ -662,9 +662,9 @@ 
     def checkrevformat(self, revstr, mapname=b'splicemap'):
         """ fails if revision format does not match the correct format"""
         if not re.match(
-            r'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-'
-            r'[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]'
-            r'{12,12}(.*)@[0-9]+$',
+            br'svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-'
+            br'[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]'
+            br'{12,12}(.*)@[0-9]+$',
             revstr,
         ):
             raise error.Abort(