diff mercurial/bundle2.py @ 45372:77b8588dd84e

requirements: introduce new requirements related module It was not clear where all requirements should and related APIs should be, this patch introduces a requirements module which will have all exitsing requirements and related APIs. Differential Revision: https://phab.mercurial-scm.org/D8917
author Pulkit Goyal <7895pulkit@gmail.com>
date Sat, 08 Aug 2020 16:24:12 +0530
parents e58e234096de
children 10284ce3d5ed
line wrap: on
line diff
--- a/mercurial/bundle2.py	Sat Aug 08 15:48:17 2020 +0530
+++ b/mercurial/bundle2.py	Sat Aug 08 16:24:12 2020 +0530
@@ -166,13 +166,13 @@
     phases,
     pushkey,
     pycompat,
+    requirements,
     scmutil,
     streamclone,
     tags,
     url,
     util,
 )
-from .interfaces import repository
 from .utils import stringutil
 
 urlerr = util.urlerr
@@ -1966,7 +1966,7 @@
         nbchangesets = int(inpart.params.get(b'nbchanges'))
     if (
         b'treemanifest' in inpart.params
-        and repository.TREEMANIFEST_REQUIREMENT not in op.repo.requirements
+        and requirements.TREEMANIFEST_REQUIREMENT not in op.repo.requirements
     ):
         if len(op.repo.changelog) != 0:
             raise error.Abort(
@@ -1975,7 +1975,7 @@
                     b"non-empty and does not use tree manifests"
                 )
             )
-        op.repo.requirements.add(repository.TREEMANIFEST_REQUIREMENT)
+        op.repo.requirements.add(requirements.TREEMANIFEST_REQUIREMENT)
         op.repo.svfs.options = localrepo.resolvestorevfsoptions(
             op.repo.ui, op.repo.requirements, op.repo.features
         )
@@ -2577,7 +2577,7 @@
 
         part = bundler.newpart(b'changegroup', data=cgdata)
         part.addparam(b'version', cgversion)
-        if repository.TREEMANIFEST_REQUIREMENT in repo.requirements:
+        if requirements.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')