Show More
@@ -550,19 +550,15 b' class filectx(object):' | |||||
550 | return None |
|
550 | return None | |
551 |
|
551 | |||
552 | def ancestors(self): |
|
552 | def ancestors(self): | |
553 |
|
|
553 | visit = {} | |
554 |
|
|
554 | c = self | |
555 |
while |
|
555 | while True: | |
556 |
|
|
556 | for parent in c.parents(): | |
557 |
|
|
557 | visit[(parent.rev(), parent.node())] = parent | |
558 | # make sure we return ancestors in reverse revision order |
|
558 | if not visit: | |
559 | parents = reversed(parents) |
|
559 | break | |
560 | for parent in parents: |
|
560 | c = visit.pop(max(visit)) | |
561 | s = str(parent) |
|
561 | yield c | |
562 | if s not in seen: |
|
|||
563 | visit.append(parent) |
|
|||
564 | seen.add(s) |
|
|||
565 | yield parent |
|
|||
566 |
|
562 | |||
567 | class workingctx(changectx): |
|
563 | class workingctx(changectx): | |
568 | """A workingctx object makes access to data related to |
|
564 | """A workingctx object makes access to data related to |
General Comments 0
You need to be logged in to leave comments.
Login now