comparison mercurial/revset.py @ 35276:205c3c6c1a51

dagop: extend filectxancestors() to walk multiple files
author Yuya Nishihara <yuya@tcha.org>
date Thu, 22 Sep 2016 18:23:58 +0900
parents 70e86db6a913
children 2cb05e6043be
comparison
equal deleted inserted replaced
35275:b4b328ea6175 35276:205c3c6c1a51
925 matcher = matchmod.match(repo.root, repo.getcwd(), [x], 925 matcher = matchmod.match(repo.root, repo.getcwd(), [x],
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 s = set() 930 fctxs = [c[f].introfilectx() for f in files]
931 for fname in files: 931 a = dagop.filectxancestors(fctxs, followfirst)
932 fctx = c[fname].introfilectx() 932 s = set(c.rev() for c in a)
933 a = dagop.filectxancestors(fctx, followfirst)
934 s = s.union(set(c.rev() for c in a))
935 else: 933 else:
936 s = dagop.revancestors(repo, baseset([c.rev()]), followfirst) 934 s = dagop.revancestors(repo, baseset([c.rev()]), followfirst)
937 935
938 return subset & s 936 return subset & s
939 937