diff -r c64b9adfb371 -r eefb5d603482 hgext/lfs/__init__.py --- a/hgext/lfs/__init__.py Wed Feb 07 23:42:48 2018 -0500 +++ b/hgext/lfs/__init__.py Sat Jan 27 17:58:19 2018 -0500 @@ -193,6 +193,7 @@ command = registrar.command(cmdtable) templatekeyword = registrar.templatekeyword() +filesetpredicate = registrar.filesetpredicate() def featuresetup(ui, supported): # don't die on seeing a repo with the lfs requirement @@ -349,6 +350,14 @@ # when writing a bundle via "hg bundle" command, upload related LFS blobs wrapfunction(bundle2, 'writenewbundle', wrapper.writenewbundle) +@filesetpredicate('lfs()') +def lfsfileset(mctx, x): + """File that uses LFS storage.""" + # i18n: "lfs" is a keyword + fileset.getargs(x, 0, 0, _("lfs takes no arguments")) + return [f for f in mctx.subset + if wrapper.pointerfromctx(mctx.ctx, f) is not None] + @templatekeyword('lfs_files') def lfsfiles(repo, ctx, **args): """List of strings. LFS files added or modified by the changeset."""