Mercurial > hg
changeset 37136:e2d386b8a38f
narrow: use featuresetupfuncs
This is the preferred way to register repo requirements that can be
opened because it respects the set of loaded extensions at repo open
time.
Differential Revision: https://phab.mercurial-scm.org/D2926
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Tue, 20 Mar 2018 17:34:05 -0700 |
parents | ecac0006b90e |
children | db90a5793103 |
files | hgext/narrow/__init__.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/narrow/__init__.py Tue Mar 20 17:30:30 2018 -0700 +++ b/hgext/narrow/__init__.py Tue Mar 20 17:34:05 2018 -0700 @@ -56,10 +56,12 @@ # Export the commands table for Mercurial to see. cmdtable = narrowcommands.table -localrepo.localrepository._basesupported.add(changegroup.NARROW_REQUIREMENT) +def featuresetup(ui, features): + features.add(changegroup.NARROW_REQUIREMENT) def uisetup(ui): """Wraps user-facing mercurial commands with narrow-aware versions.""" + localrepo.featuresetupfuncs.add(featuresetup) narrowrevlog.setup() narrowbundle2.setup() narrowmerge.setup()