# HG changeset patch # User Gregory Szorc # Date 2018-03-21 00:34:05 # Node ID e2d386b8a38f22f116ced72781a306bd66c101a8 # Parent ecac0006b90ee526def300f327accf97d1ef396c 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 diff --git a/hgext/narrow/__init__.py b/hgext/narrow/__init__.py --- a/hgext/narrow/__init__.py +++ b/hgext/narrow/__init__.py @@ -56,10 +56,12 @@ configitem('experimental', 'narrowserveb # 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()