Mercurial > public > mercurial-scm > hg
comparison mercurial/revset.py @ 35296:2cb05e6043be
dagop: add smartset interface to filectxancestors()
The original filectx API is kept public since we'll need it to walk ancestor
(rev, match) pairs efficiently. The current implementation scans ancestors
twice for 'hg log -fp FILE'.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 22 Oct 2017 18:57:42 +0900 |
parents | 205c3c6c1a51 |
children | 921680c3e2ea |
comparison
equal
deleted
inserted
replaced
35295:bea46aed1e1b | 35296:2cb05e6043be |
---|---|
926 ctx=repo[rev], default='path') | 926 ctx=repo[rev], default='path') |
927 | 927 |
928 files = c.manifest().walk(matcher) | 928 files = c.manifest().walk(matcher) |
929 | 929 |
930 fctxs = [c[f].introfilectx() for f in files] | 930 fctxs = [c[f].introfilectx() for f in files] |
931 a = dagop.filectxancestors(fctxs, followfirst) | 931 s = dagop.filerevancestors(fctxs, followfirst) |
932 s = set(c.rev() for c in a) | |
933 else: | 932 else: |
934 s = dagop.revancestors(repo, baseset([c.rev()]), followfirst) | 933 s = dagop.revancestors(repo, baseset([c.rev()]), followfirst) |
935 | 934 |
936 return subset & s | 935 return subset & s |
937 | 936 |