##// END OF EJS Templates
dagop: copy basefilectx.ancestors() to free function...
Yuya Nishihara -
r35271:0d27685b default
parent child Browse files
Show More
@@ -75,6 +75,23 b' def _walkrevtree(pfunc, revs, startdepth'
75 if prev != node.nullrev:
75 if prev != node.nullrev:
76 heapq.heappush(pendingheap, (heapsign * prev, pdepth))
76 heapq.heappush(pendingheap, (heapsign * prev, pdepth))
77
77
78 def filectxancestors(fctx, followfirst=False):
79 """Like filectx.ancestors()"""
80 visit = {}
81 c = fctx
82 if followfirst:
83 cut = 1
84 else:
85 cut = None
86
87 while True:
88 for parent in c.parents()[:cut]:
89 visit[(parent.linkrev(), parent.filenode())] = parent
90 if not visit:
91 break
92 c = visit.pop(max(visit))
93 yield c
94
78 def _genrevancestors(repo, revs, followfirst, startdepth, stopdepth, cutfunc):
95 def _genrevancestors(repo, revs, followfirst, startdepth, stopdepth, cutfunc):
79 if followfirst:
96 if followfirst:
80 cut = 1
97 cut = 1
@@ -930,7 +930,8 b' def _follow(repo, subset, x, name, follo'
930 s = set()
930 s = set()
931 for fname in files:
931 for fname in files:
932 fctx = c[fname]
932 fctx = c[fname]
933 s = s.union(set(c.rev() for c in fctx.ancestors(followfirst)))
933 a = dagop.filectxancestors(fctx, followfirst)
934 s = s.union(set(c.rev() for c in a))
934 # include the revision responsible for the most recent version
935 # include the revision responsible for the most recent version
935 s.add(fctx.introrev())
936 s.add(fctx.introrev())
936 else:
937 else:
General Comments 0
You need to be logged in to leave comments. Login now