comparison mercurial/fileset.py @ 38613:760cc5dc01e8

fileset: restrict getfileset() to not return a computed set (API) And rename the functions accordingly. fileset.match() will be changed to not compute the initial subset. test-glog*.t get back to the state before 9f9ffe5f687c "match: compose 'set:' pattern as matcher."
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jun 2018 20:53:12 +0900
parents d046bf37f1ba
children 5cbcbe51d38d
comparison
equal deleted inserted replaced
38612:0ba4cf3f088f 38613:760cc5dc01e8
618 subset.extend(c) 618 subset.extend(c)
619 return subset 619 return subset
620 else: 620 else:
621 return list(ctx.walk(ctx.match([]))) 621 return list(ctx.walk(ctx.match([])))
622 622
623 def getfileset(ctx, expr): 623 def match(ctx, expr, badfn=None):
624 """Create a matcher for a single fileset expression"""
625 repo = ctx.repo()
624 tree = parse(expr) 626 tree = parse(expr)
625 return getset(fullmatchctx(ctx, _buildstatus(ctx, tree)), tree) 627 fset = getset(fullmatchctx(ctx, _buildstatus(ctx, tree)), tree)
628 return matchmod.predicatematcher(repo.root, repo.getcwd(),
629 fset.__contains__,
630 predrepr='fileset', badfn=badfn)
626 631
627 def _buildstatus(ctx, tree, basectx=None): 632 def _buildstatus(ctx, tree, basectx=None):
628 # do we need status info? 633 # do we need status info?
629 634
630 # temporaty boolean to simplify the next conditional 635 # temporaty boolean to simplify the next conditional