Mercurial > public > mercurial-scm > hg
comparison mercurial/streamclone.py @ 39850: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 |
comparison
equal
deleted
inserted
replaced
39849:d3d4b4b5f725 | 39850:d89d5bc06eaa |
---|---|
166 # new format-related remote requirements | 166 # new format-related remote requirements |
167 # requirements from the streamed-in repository | 167 # requirements from the streamed-in repository |
168 repo.requirements = requirements | ( | 168 repo.requirements = requirements | ( |
169 repo.requirements - repo.supportedformats) | 169 repo.requirements - repo.supportedformats) |
170 repo.svfs.options = localrepo.resolvestorevfsoptions( | 170 repo.svfs.options = localrepo.resolvestorevfsoptions( |
171 repo.ui, repo.requirements) | 171 repo.ui, repo.requirements, repo.features) |
172 repo._writerequirements() | 172 repo._writerequirements() |
173 | 173 |
174 if rbranchmap: | 174 if rbranchmap: |
175 branchmap.replacecache(repo, rbranchmap) | 175 branchmap.replacecache(repo, rbranchmap) |
176 | 176 |
641 # new format-related remote requirements | 641 # new format-related remote requirements |
642 # requirements from the streamed-in repository | 642 # requirements from the streamed-in repository |
643 repo.requirements = set(requirements) | ( | 643 repo.requirements = set(requirements) | ( |
644 repo.requirements - repo.supportedformats) | 644 repo.requirements - repo.supportedformats) |
645 repo.svfs.options = localrepo.resolvestorevfsoptions( | 645 repo.svfs.options = localrepo.resolvestorevfsoptions( |
646 repo.ui, repo.requirements) | 646 repo.ui, repo.requirements, repo.features) |
647 repo._writerequirements() | 647 repo._writerequirements() |