diff mercurial/repair.py @ 45558:10284ce3d5ed

scmutil: introduce function to check whether repo uses treemanifest or not In an upcoming patch, I wanted to check whether current repo uses treemanifest or not. I looked for a function and found that at all places we manually check for the requirement in repo requirements. I guess having a dedicated function for that is much better. Differential Revision: https://phab.mercurial-scm.org/D8981
author Pulkit Goyal <7895pulkit@gmail.com>
date Tue, 01 Sep 2020 18:08:24 +0530
parents 77b8588dd84e
children 63edc384d3b7
line wrap: on
line diff
--- a/mercurial/repair.py	Thu Sep 03 11:07:47 2020 -0400
+++ b/mercurial/repair.py	Tue Sep 01 18:08:24 2020 +0530
@@ -27,6 +27,7 @@
     phases,
     pycompat,
     requirements,
+    scmutil,
     util,
 )
 from .utils import (
@@ -419,7 +420,7 @@
 
 def manifestrevlogs(repo):
     yield repo.manifestlog.getstorage(b'')
-    if requirements.TREEMANIFEST_REQUIREMENT in repo.requirements:
+    if scmutil.istreemanifest(repo):
         # This logic is safe if treemanifest isn't enabled, but also
         # pointless, so we skip it if treemanifest isn't enabled.
         for unencoded, encoded, size in repo.store.datafiles():