diff mercurial/localrepo.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 f025b97f3758
children 77b8588dd84e
line wrap: on
line diff
--- a/mercurial/localrepo.py	Tue Jul 21 22:13:54 2020 +0200
+++ b/mercurial/localrepo.py	Sat Aug 08 15:48:17 2020 +0530
@@ -846,7 +846,7 @@
     """
     options = {}
 
-    if b'treemanifest' in requirements:
+    if repository.TREEMANIFEST_REQUIREMENT in requirements:
         options[b'treemanifest'] = True
 
     # experimental config: format.manifestcachesize
@@ -1053,7 +1053,7 @@
     supportedformats = {
         b'revlogv1',
         b'generaldelta',
-        b'treemanifest',
+        repository.TREEMANIFEST_REQUIREMENT,
         COPIESSDC_REQUIREMENT,
         REVLOGV2_REQUIREMENT,
         SIDEDATA_REQUIREMENT,
@@ -3314,7 +3314,7 @@
         requirements.add(SIDEDATA_REQUIREMENT)
         requirements.add(COPIESSDC_REQUIREMENT)
     if ui.configbool(b'experimental', b'treemanifest'):
-        requirements.add(b'treemanifest')
+        requirements.add(repository.TREEMANIFEST_REQUIREMENT)
 
     revlogv2 = ui.config(b'experimental', b'revlogv2')
     if revlogv2 == b'enable-unstable-format-and-corrupt-my-data':