diff hgext/convert/p4.py @ 41537:fc09aafd3c36

convert: use raw string for regular expressions This avoids a SyntaxWarning on Python 3.8. Differential Revision: https://phab.mercurial-scm.org/D5821
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 04 Feb 2019 09:03:10 -0800
parents a8a902d7176e
children aaad36b88298
line wrap: on
line diff
--- a/hgext/convert/p4.py	Mon Feb 04 09:01:49 2019 -0800
+++ b/hgext/convert/p4.py	Mon Feb 04 09:03:10 2019 -0800
@@ -64,12 +64,12 @@
         self.encoding = self.ui.config('convert', 'p4.encoding',
                                        convcmd.orig_encoding)
         self.re_type = re.compile(
-            "([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)"
-            "(\+\w+)?$")
+            br"([a-z]+)?(text|binary|symlink|apple|resource|unicode|utf\d+)"
+            br"(\+\w+)?$")
         self.re_keywords = re.compile(
-            r"\$(Id|Header|Date|DateTime|Change|File|Revision|Author)"
-            r":[^$\n]*\$")
-        self.re_keywords_old = re.compile("\$(Id|Header):[^$\n]*\$")
+            br"\$(Id|Header|Date|DateTime|Change|File|Revision|Author)"
+            br":[^$\n]*\$")
+        self.re_keywords_old = re.compile(br"\$(Id|Header):[^$\n]*\$")
 
         if revs and len(revs) > 1:
             raise error.Abort(_("p4 source does not support specifying "