From patchwork Thu Mar 22 00:12:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D2926: narrow: use featuresetupfuncs From: phabricator X-Patchwork-Id: 29743 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Thu, 22 Mar 2018 00:12:24 +0000 indygreg created this revision. Herald added a reviewer: durin42. Herald added a subscriber: mercurial-devel. Herald added a reviewer: hg-reviewers. REVISION SUMMARY 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. REPOSITORY rHG Mercurial REVISION DETAIL https://phab.mercurial-scm.org/D2926 AFFECTED FILES hgext/narrow/__init__.py CHANGE DETAILS To: indygreg, durin42, #hg-reviewers Cc: mercurial-devel 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 @@ # 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()