nodemap: fix missing r-prefix on regular expression
authorAugie Fackler <augie@google.com>
Fri, 06 Mar 2020 13:54:35 -0500
changeset 44480 6aee0647e026
parent 44479 e397c6d74652
child 44481 295417387769
nodemap: fix missing r-prefix on regular expression Looking at this regular expression, it's pretty obvious from reading it that it wanted to match literal ., but since the r was missing on the pattern it was matching any character. I guess we're just lucky nothing bad happened as a result. This was automatically fixed by pyupgrade, but I split it out into its own change because it seemed important. Differential Revision: https://phab.mercurial-scm.org/D8254
mercurial/revlogutils/nodemap.py
--- a/mercurial/revlogutils/nodemap.py	Fri Mar 06 23:04:58 2020 +0100
+++ b/mercurial/revlogutils/nodemap.py	Fri Mar 06 13:54:35 2020 -0500
@@ -275,7 +275,7 @@
 
 def _other_rawdata_filepath(revlog, docket):
     prefix = revlog.nodemap_file[:-2]
-    pattern = re.compile(b"(^|/)%s-[0-9a-f]+\.nd$" % prefix)
+    pattern = re.compile(br"(^|/)%s-[0-9a-f]+\.nd$" % prefix)
     new_file_path = _rawdata_filepath(revlog, docket)
     new_file_name = revlog.opener.basename(new_file_path)
     dirpath = revlog.opener.dirname(new_file_path)