store: use boolean property for upgrade's matchrevlog
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 15 May 2023 22:03:39 +0200
changeset 50503 aede57466804
parent 50502 e4186ddab473
child 50504 862e3a13da44
store: use boolean property for upgrade's matchrevlog
mercurial/upgrade_utils/engine.py
--- 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)