Show More
@@ -38,6 +38,11 b' def _genrevancestors(repo, revs, followf' | |||
|
38 | 38 | raise error.ProgrammingError('negative stopdepth') |
|
39 | 39 | |
|
40 | 40 | cl = repo.changelog |
|
41 | def pfunc(rev): | |
|
42 | try: | |
|
43 | return cl.parentrevs(rev)[:cut] | |
|
44 | except error.WdirUnsupported: | |
|
45 | return (pctx.rev() for pctx in repo[rev].parents()[:cut]) | |
|
41 | 46 | |
|
42 | 47 | # load input revs lazily to heap so earlier revisions can be yielded |
|
43 | 48 | # without fully computing the input revs |
@@ -65,14 +70,9 b' def _genrevancestors(repo, revs, followf' | |||
|
65 | 70 | yield currev |
|
66 | 71 | pdepth = curdepth + 1 |
|
67 | 72 | if foundnew and pdepth < stopdepth: |
|
68 | try: | |
|
69 |
f |
|
|
70 | if prev != node.nullrev: | |
|
71 | heapq.heappush(pendingheap, (-prev, pdepth)) | |
|
72 | except error.WdirUnsupported: | |
|
73 | for pctx in repo[currev].parents()[:cut]: | |
|
74 | if pctx.rev() != node.nullrev: | |
|
75 | heapq.heappush(pendingheap, (-pctx.rev(), pdepth)) | |
|
73 | for prev in pfunc(currev): | |
|
74 | if prev != node.nullrev: | |
|
75 | heapq.heappush(pendingheap, (-prev, pdepth)) | |
|
76 | 76 | |
|
77 | 77 | def revancestors(repo, revs, followfirst, startdepth=None, stopdepth=None): |
|
78 | 78 | """Like revlog.ancestors(), but supports additional options, includes |
General Comments 0
You need to be logged in to leave comments.
Login now