Comments
Patch
@@ -76,7 +76,7 @@ def _walkrevtree(pfunc, revs, startdepth
heapq.heappush(pendingheap, (heapsign * prev, pdepth))
def filectxancestors(fctx, followfirst=False):
- """Like filectx.ancestors()"""
+ """Like filectx.ancestors(), but includes the given fctx itself"""
visit = {}
c = fctx
if followfirst:
@@ -84,6 +84,7 @@ def filectxancestors(fctx, followfirst=F
else:
cut = None
+ yield c
while True:
for parent in c.parents()[:cut]:
visit[(parent.linkrev(), parent.filenode())] = parent
@@ -929,11 +929,9 @@ def _follow(repo, subset, x, name, follo
s = set()
for fname in files:
- fctx = c[fname]
+ fctx = c[fname].introfilectx()
a = dagop.filectxancestors(fctx, followfirst)
s = s.union(set(c.rev() for c in a))
- # include the revision responsible for the most recent version
- s.add(fctx.introrev())
else:
s = dagop.revancestors(repo, baseset([c.rev()]), followfirst)