diff mercurial/bundle2.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/bundle2.py	Tue Jul 21 22:13:54 2020 +0200
+++ b/mercurial/bundle2.py	Sat Aug 08 15:48:17 2020 +0530
@@ -172,6 +172,7 @@
     url,
     util,
 )
+from .interfaces import repository
 from .utils import stringutil
 
 urlerr = util.urlerr
@@ -1965,7 +1966,7 @@
         nbchangesets = int(inpart.params.get(b'nbchanges'))
     if (
         b'treemanifest' in inpart.params
-        and b'treemanifest' not in op.repo.requirements
+        and repository.TREEMANIFEST_REQUIREMENT not in op.repo.requirements
     ):
         if len(op.repo.changelog) != 0:
             raise error.Abort(
@@ -1974,7 +1975,7 @@
                     b"non-empty and does not use tree manifests"
                 )
             )
-        op.repo.requirements.add(b'treemanifest')
+        op.repo.requirements.add(repository.TREEMANIFEST_REQUIREMENT)
         op.repo.svfs.options = localrepo.resolvestorevfsoptions(
             op.repo.ui, op.repo.requirements, op.repo.features
         )
@@ -2576,7 +2577,7 @@
 
         part = bundler.newpart(b'changegroup', data=cgdata)
         part.addparam(b'version', cgversion)
-        if b'treemanifest' in repo.requirements:
+        if repository.TREEMANIFEST_REQUIREMENT in repo.requirements:
             part.addparam(b'treemanifest', b'1')
         if b'exp-sidedata-flag' in repo.requirements:
             part.addparam(b'exp-sidedata', b'1')