changeset 50503:aede57466804

store: use boolean property for upgrade's matchrevlog
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 15 May 2023 22:03:39 +0200
parents e4186ddab473
children 862e3a13da44
files mercurial/upgrade_utils/engine.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/upgrade_utils/engine.py	Mon May 15 22:11:27 2023 +0200
+++ b/mercurial/upgrade_utils/engine.py	Mon May 15 22:03:39 2023 +0200
@@ -105,18 +105,18 @@
 )
 
 
-def matchrevlog(revlogfilter, rl_type):
+def matchrevlog(revlogfilter, entry):
     """check if a revlog is selected for cloning.
 
     In other words, are there any updates which need to be done on revlog
     or it can be blindly copied.
 
     The store entry is checked against the passed filter"""
-    if rl_type & store.FILEFLAGS_CHANGELOG:
+    if entry.is_changelog:
         return UPGRADE_CHANGELOG in revlogfilter
-    elif rl_type & store.FILEFLAGS_MANIFESTLOG:
+    elif entry.is_manifestlog:
         return UPGRADE_MANIFEST in revlogfilter
-    assert rl_type & store.FILEFLAGS_FILELOG
+    assert entry.is_filelog
     return UPGRADE_FILELOGS in revlogfilter
 
 
@@ -133,7 +133,7 @@
     """returns the new revlog object created"""
     newrl = None
     revlog_path = entry.main_file_path()
-    if matchrevlog(upgrade_op.revlogs_to_process, entry.revlog_type):
+    if matchrevlog(upgrade_op.revlogs_to_process, entry):
         ui.note(
             _(b'cloning %d revisions from %s\n')
             % (len(old_revlog), revlog_path)