##// 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 return None
550 return None
551
551
552 def ancestors(self):
552 def ancestors(self):
553 seen = set()
553 visit = {}
554 visit = [self]
554 c = self
555 while visit:
555 while True:
556 parents = visit.pop(0).parents()
556 for parent in c.parents():
557 if len(parents) > 1 and parents[1].rev() > parents[0].rev():
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