diff mercurial/streamclone.py @ 39855:d89d5bc06eaa

localrepo: define "features" on repository instances (API) There are a handful of attributes/methods on repository instances that describe the behavior of the repository. Furthermore, there is an unbound set of repository descriptors that we may wish to expose. For example, an extension may wish to add a descriptor and have monkeypatched functions look for the presence of an attribute before taking actions. This commit introduces a "features" mechanism to allow repositories to self-advertise an arbitrary set of strings that describe repository behavior or capabilities. We implement basic support for advertising a few features to give an idea of what I want to use this for. Differential Revision: https://phab.mercurial-scm.org/D4709
author Gregory Szorc <gregory.szorc@gmail.com>
date Wed, 19 Sep 2018 14:36:57 -0700
parents 97f2992c26f6
children 51f10e6d66c7
line wrap: on
line diff
--- a/mercurial/streamclone.py	Wed Sep 19 17:27:37 2018 -0700
+++ b/mercurial/streamclone.py	Wed Sep 19 14:36:57 2018 -0700
@@ -168,7 +168,7 @@
         repo.requirements = requirements | (
                 repo.requirements - repo.supportedformats)
         repo.svfs.options = localrepo.resolvestorevfsoptions(
-            repo.ui, repo.requirements)
+            repo.ui, repo.requirements, repo.features)
         repo._writerequirements()
 
         if rbranchmap:
@@ -643,5 +643,5 @@
     repo.requirements = set(requirements) | (
             repo.requirements - repo.supportedformats)
     repo.svfs.options = localrepo.resolvestorevfsoptions(
-        repo.ui, repo.requirements)
+        repo.ui, repo.requirements, repo.features)
     repo._writerequirements()