##// END OF EJS Templates
context: be even more careful about result order in ancestors() (issue2642)...
Matt Mackall -
r13481:4eb1e9d6 stable
parent child Browse files
Show More
@@ -550,19 +550,15 class filectx(object):
550 550 return None
551 551
552 552 def ancestors(self):
553 seen = set()
554 visit = [self]
555 while visit:
556 parents = visit.pop(0).parents()
557 if len(parents) > 1 and parents[1].rev() > parents[0].rev():
558 # make sure we return ancestors in reverse revision order
559 parents = reversed(parents)
560 for parent in parents:
561 s = str(parent)
562 if s not in seen:
563 visit.append(parent)
564 seen.add(s)
565 yield parent
553 visit = {}
554 c = self
555 while True:
556 for parent in c.parents():
557 visit[(parent.rev(), parent.node())] = parent
558 if not visit:
559 break
560 c = visit.pop(max(visit))
561 yield c
566 562
567 563 class workingctx(changectx):
568 564 """A workingctx object makes access to data related to
General Comments 0
You need to be logged in to leave comments. Login now