diff mercurial/store.py @ 47659:f030c7d22032

walk: no longer ignore revlogs of files starting with `undo.` (issue6542) Changeset 0b569c75d180 introduced new code in store.walk to filter out undo files left behind by the transaction. However doing so is also filtering out legitimate revlog file starting with `undo.` So this changeset is mostly rolling back that change and adding tests tests to catch this kind of error in the future. As a result we the transaction undo files a considered again by various code (in practice mostly persistent nodemap related). We either live with it (low inconvenient) or explicitly work around it for now. This should be good enough to no longer block the 5.9rc release with this issue. We shall build something cleaner within the 6.0 cycle. Differential Revision: https://phab.mercurial-scm.org/D11201
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 19 Jul 2021 22:39:08 +0200
parents 9ab54aa56982
children 59bc92a7c60f
line wrap: on
line diff
--- a/mercurial/store.py	Tue Jul 13 14:54:09 2021 +0530
+++ b/mercurial/store.py	Mon Jul 19 22:39:08 2021 +0200
@@ -405,6 +405,8 @@
 REVLOG_FILES_VOLATILE_EXT = (b'.n', b'.nd')
 
 # some exception to the above matching
+#
+# XXX This is currently not in use because of issue6542
 EXCLUDED = re.compile(b'.*undo\.[^/]+\.(nd?|i)$')
 
 
@@ -415,9 +417,12 @@
 
 
 def revlog_type(f):
-    if f.endswith(REVLOG_FILES_MAIN_EXT) and EXCLUDED.match(f) is None:
+    # XXX we need to filter `undo.` created by the transaction here, however
+    # being naive about it also filter revlog for `undo.*` files, leading to
+    # issue6542. So we no longer use EXCLUDED.
+    if f.endswith(REVLOG_FILES_MAIN_EXT):
         return FILEFLAGS_REVLOG_MAIN
-    elif f.endswith(REVLOG_FILES_OTHER_EXT) and EXCLUDED.match(f) is None:
+    elif f.endswith(REVLOG_FILES_OTHER_EXT):
         t = FILETYPE_FILELOG_OTHER
         if f.endswith(REVLOG_FILES_VOLATILE_EXT):
             t |= FILEFLAGS_VOLATILE