diff mercurial/repair.py @ 45391:e58e234096de

repository: introduce constant for treemanifest requirement and use it In future we will like to much cleaner logic around which requirement is for working copy and which can go in store. To start with that, we first need to de-clutter the requirement values spread around and replace them with constants. Differential Revision: https://phab.mercurial-scm.org/D8916
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 08 Aug 2020 15:48:17 +0530
parents c93dd9d9f1e6
children 77b8588dd84e
line wrap: on
line diff
--- a/mercurial/repair.py	Tue Jul 21 22:13:54 2020 +0200
+++ b/mercurial/repair.py	Sat Aug 08 15:48:17 2020 +0530
@@ -28,6 +28,7 @@
     pycompat,
     util,
 )
+from .interfaces import repository
 from .utils import (
     hashutil,
     stringutil,
@@ -418,7 +419,7 @@
 
 def manifestrevlogs(repo):
     yield repo.manifestlog.getstorage(b'')
-    if b'treemanifest' in repo.requirements:
+    if repository.TREEMANIFEST_REQUIREMENT in repo.requirements:
         # 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():
@@ -476,7 +477,7 @@
 
         progress.complete()
 
-        if b'treemanifest' in repo.requirements:
+        if repository.TREEMANIFEST_REQUIREMENT in repo.requirements:
             # This logic is safe if treemanifest isn't enabled, but also
             # pointless, so we skip it if treemanifest isn't enabled.
             for dir in pathutil.dirs(seenfiles):