store: use the new boolean property in `upgrade`
authorPierre-Yves David <pierre-yves.david@octobus.net>
Mon, 15 May 2023 22:11:27 +0200
changeset 50502 e4186ddab473
parent 50501 4242acf5c399
child 50503 aede57466804
store: use the new boolean property in `upgrade`
mercurial/upgrade_utils/engine.py
--- a/mercurial/upgrade_utils/engine.py	Mon May 15 22:11:02 2023 +0200
+++ b/mercurial/upgrade_utils/engine.py	Mon May 15 22:11:27 2023 +0200
@@ -52,9 +52,9 @@
 
     An instance of the appropriate class is returned.
     """
-    if entry.revlog_type == store.FILEFLAGS_CHANGELOG:
+    if entry.is_changelog:
         return changelog.changelog(repo.svfs)
-    elif entry.revlog_type == store.FILEFLAGS_MANIFESTLOG:
+    elif entry.is_manifestlog:
         mandir = entry.target_id.rstrip(b'/')
         return manifest.manifestrevlog(
             repo.nodeconstants, repo.svfs, tree=mandir
@@ -89,7 +89,7 @@
     if copydata:
         util.copyfile(olddata, newdata)
 
-    if entry.revlog_type & store.FILEFLAGS_FILELOG:
+    if entry.is_filelog:
         unencodedname = entry.main_file_path()
         destrepo.svfs.fncache.add(unencodedname)
         if copydata:
@@ -214,18 +214,18 @@
         srcrawsize += rawsize
 
         # This is for the separate progress bars.
-        if entry.revlog_type & store.FILEFLAGS_CHANGELOG:
+        if entry.is_changelog:
             changelogs[entry.target_id] = entry
             crevcount += len(rl)
             csrcsize += datasize
             crawsize += rawsize
-        elif entry.revlog_type & store.FILEFLAGS_MANIFESTLOG:
+        elif entry.is_manifestlog:
             manifests[entry.target_id] = entry
             mcount += 1
             mrevcount += len(rl)
             msrcsize += datasize
             mrawsize += rawsize
-        elif entry.revlog_type & store.FILEFLAGS_FILELOG:
+        elif entry.is_filelog:
             filelogs[entry.target_id] = entry
             fcount += 1
             frevcount += len(rl)