comparison mercurial/fileset.py @ 38829:7e7e2b2ff284

fileset: add stub for weight-based optimization The main purpose of this change is to group basic patterns, which can be mapped to a plain matcher. I'm not so interested in a weight of each function.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 21 Jul 2018 15:52:26 +0900
parents 3ea6ce609747
children bfd5def3fe02
comparison
equal deleted inserted replaced
38828:3ea6ce609747 38829:7e7e2b2ff284
522 522
523 def match(ctx, expr, badfn=None): 523 def match(ctx, expr, badfn=None):
524 """Create a matcher for a single fileset expression""" 524 """Create a matcher for a single fileset expression"""
525 tree = filesetlang.parse(expr) 525 tree = filesetlang.parse(expr)
526 tree = filesetlang.analyze(tree) 526 tree = filesetlang.analyze(tree)
527 tree = filesetlang.optimize(tree)
527 mctx = matchctx(ctx, _buildstatus(ctx, tree), badfn=badfn) 528 mctx = matchctx(ctx, _buildstatus(ctx, tree), badfn=badfn)
528 return getmatch(mctx, tree) 529 return getmatch(mctx, tree)
529 530
530 def _buildstatus(ctx, tree, basectx=None): 531 def _buildstatus(ctx, tree, basectx=None):
531 # do we need status info? 532 # do we need status info?