# HG changeset patch # User Matt Mackall # Date 1308433971 18000 # Node ID b0566467c4929f3c68dcd609d6293cfe6dea5681 # Parent 785bbc8634f8b221c9d54307c1440ea6eb5d1ec0 fileset: drop matchfn This is now built into contexts diff -r 785bbc8634f8 -r b0566467c492 mercurial/commands.py --- a/mercurial/commands.py Sat Jun 18 16:52:51 2011 -0500 +++ b/mercurial/commands.py Sat Jun 18 16:52:51 2011 -0500 @@ -1610,9 +1610,8 @@ if ui.verbose: tree = fileset.parse(expr)[0] ui.note(tree, "\n") - matcher = lambda x: scmutil.match(repo[None], x, default='glob') - - for f in fileset.getfileset(repo[None], matcher, expr): + + for f in fileset.getfileset(repo[None], expr): ui.write("%s\n" % f) @command('debugfsinfo', [], _('[PATH]')) diff -r 785bbc8634f8 -r b0566467c492 mercurial/fileset.py --- a/mercurial/fileset.py Sat Jun 18 16:52:51 2011 -0500 +++ b/mercurial/fileset.py Sat Jun 18 16:52:51 2011 -0500 @@ -121,22 +121,20 @@ } class matchctx(object): - def __init__(self, ctx, matchfn, subset=None): + def __init__(self, ctx, subset=None): self.ctx = ctx - self.matchfn = matchfn self.subset = subset if subset is None: - self.subset = ctx.walk(matchfn([])) # optimize this later - def matcher(self, pattern): - return self.matchfn(pattern) + self.subset = ctx.walk(self.matcher([])) # optimize this later + def matcher(self, patterns): + return self.ctx.match(patterns) def filter(self, files): return [f for f in files if f in self.subset] def narrow(self, files): - return matchctx(self.ctx, self.matchfn, - self.filter(files)) + return matchctx(self.ctx, self.filter(files)) -def getfileset(ctx, matchfn, expr): +def getfileset(ctx, expr): tree, pos = parse(expr) if (pos != len(expr)): raise error.ParseError("invalid token", pos) - return getset(matchctx(ctx, matchfn), tree) + return getset(matchctx(ctx), tree)