# HG changeset patch # User Augie Fackler # Date 2020-03-06 18:54:35 # Node ID 6aee0647e0265ae11351b38a00d6b4c09043a033 # Parent e397c6d746521cf5d3b86896c5e78bd63e335a5d 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 diff --git a/mercurial/revlogutils/nodemap.py b/mercurial/revlogutils/nodemap.py --- a/mercurial/revlogutils/nodemap.py +++ b/mercurial/revlogutils/nodemap.py @@ -275,7 +275,7 @@ def _rawdata_filepath(revlog, docket): 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)