mercurial/fileset.py
changeset 38612 760cc5dc01e8
parent 38598 d046bf37f1ba
child 38613 5cbcbe51d38d
--- a/mercurial/fileset.py	Sat Jun 09 22:04:07 2018 +0900
+++ b/mercurial/fileset.py	Sat Jun 09 20:53:12 2018 +0900
@@ -620,9 +620,14 @@
     else:
         return list(ctx.walk(ctx.match([])))
 
-def getfileset(ctx, expr):
+def match(ctx, expr, badfn=None):
+    """Create a matcher for a single fileset expression"""
+    repo = ctx.repo()
     tree = parse(expr)
-    return getset(fullmatchctx(ctx, _buildstatus(ctx, tree)), tree)
+    fset = getset(fullmatchctx(ctx, _buildstatus(ctx, tree)), tree)
+    return matchmod.predicatematcher(repo.root, repo.getcwd(),
+                                     fset.__contains__,
+                                     predrepr='fileset', badfn=badfn)
 
 def _buildstatus(ctx, tree, basectx=None):
     # do we need status info?