# HG changeset patch # User Matt Harbison # Date 1545972395 18000 # Node ID 8f40e21ca8420847d27fb580fda0a613ffc04008 # Parent 70ca0e846d256f563e87fef143510aa9dbc0b876 exthelper: reintroduce the ability to register filesets Same mechanism as revsets earlier in this series. The LFS extension is updated to provide test coverage. diff -r 70ca0e846d25 -r 8f40e21ca842 hgext/lfs/__init__.py --- a/hgext/lfs/__init__.py Thu Dec 27 21:55:22 2018 -0500 +++ b/hgext/lfs/__init__.py Thu Dec 27 23:46:35 2018 -0500 @@ -140,7 +140,6 @@ minifileset, node, pycompat, - registrar, repository, revlog, scmutil, @@ -168,6 +167,7 @@ configtable = eh.configtable extsetup = eh.finalextsetup uisetup = eh.finaluisetup +filesetpredicate = eh.filesetpredicate reposetup = eh.finalreposetup templatekeyword = eh.templatekeyword @@ -200,7 +200,6 @@ eh.configitem('lfs', 'retry', default=5, ) -filesetpredicate = registrar.filesetpredicate() lfsprocessor = ( wrapper.readfromstore, @@ -337,7 +336,7 @@ # "packed1". Using "packed1" with lfs will likely cause trouble. exchange._bundlespeccontentopts["v2"]["cg.version"] = "03" -@filesetpredicate('lfs()') +@eh.filesetpredicate('lfs()') def lfsfileset(mctx, x): """File that uses LFS storage.""" # i18n: "lfs" is a keyword diff -r 70ca0e846d25 -r 8f40e21ca842 mercurial/exthelper.py --- a/mercurial/exthelper.py Thu Dec 27 21:55:22 2018 -0500 +++ b/mercurial/exthelper.py Thu Dec 27 23:46:35 2018 -0500 @@ -40,6 +40,7 @@ self.command = registrar.command(self.cmdtable) self.configtable = {} self.configitem = registrar.configitem(self.configtable) + self.filesetpredicate = registrar.filesetpredicate() self.revsetpredicate = registrar.revsetpredicate() self.templatekeyword = registrar.templatekeyword() @@ -48,6 +49,7 @@ self._uipopulatecallables.extend(other._uipopulatecallables) self._extcallables.extend(other._extcallables) self._repocallables.extend(other._repocallables) + self.filesetpredicate._table.update(other.filesetpredicate._table) self.revsetpredicate._table.update(other.revsetpredicate._table) self.templatekeyword._table.update(other.templatekeyword._table) self._commandwrappers.extend(other._commandwrappers)