Mercurial > hg
comparison mercurial/revset.py @ 34019:205c47e30a93
revset: make match function follow given subset if specified (API)
This should be sensible default since mfunc(subset) is roughly equivalent
to 'subset & mfunc'. The order argument is still there so we can specify
'anyorder' if the order doesn't really matter.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Wed, 30 Aug 2017 22:51:28 +0900 |
parents | de286200f722 |
children | 37b82485097f |
comparison
equal
deleted
inserted
replaced
34018:de286200f722 | 34019:205c47e30a93 |
---|---|
2161 posttreebuilthook(tree, repo) | 2161 posttreebuilthook(tree, repo) |
2162 return makematcher(tree) | 2162 return makematcher(tree) |
2163 | 2163 |
2164 def makematcher(tree): | 2164 def makematcher(tree): |
2165 """Create a matcher from an evaluatable tree""" | 2165 """Create a matcher from an evaluatable tree""" |
2166 def mfunc(repo, subset=None, order=defineorder): | 2166 def mfunc(repo, subset=None, order=None): |
2167 if order is None: | |
2168 if subset is None: | |
2169 order = defineorder # 'x' | |
2170 else: | |
2171 order = followorder # 'subset & x' | |
2167 if subset is None: | 2172 if subset is None: |
2168 subset = fullreposet(repo) | 2173 subset = fullreposet(repo) |
2169 return getset(repo, subset, tree, order) | 2174 return getset(repo, subset, tree, order) |
2170 return mfunc | 2175 return mfunc |
2171 | 2176 |