comparison mercurial/revlog.py @ 3360:ef8307585b41

nodesbetween: fix a bug with duplicate heads
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Thu, 12 Oct 2006 11:40:26 +0200
parents 9061613c1593
children a74addddd092
comparison
equal deleted inserted replaced
3359:41741218504d 3360:ef8307585b41
597 else: 597 else:
598 heads = list(heads) 598 heads = list(heads)
599 if not heads: 599 if not heads:
600 return nonodes 600 return nonodes
601 ancestors = {} 601 ancestors = {}
602 # Start at the top and keep marking parents until we're done.
603 nodestotag = heads[:]
604 # Turn heads into a dictionary so we can remove 'fake' heads. 602 # Turn heads into a dictionary so we can remove 'fake' heads.
605 # Also, later we will be using it to filter out the heads we can't 603 # Also, later we will be using it to filter out the heads we can't
606 # find from roots. 604 # find from roots.
607 heads = dict.fromkeys(heads, 0) 605 heads = dict.fromkeys(heads, 0)
606 # Start at the top and keep marking parents until we're done.
607 nodestotag = heads.keys()
608 # Remember where the top was so we can use it as a limit later. 608 # Remember where the top was so we can use it as a limit later.
609 highestrev = max([self.rev(n) for n in nodestotag]) 609 highestrev = max([self.rev(n) for n in nodestotag])
610 while nodestotag: 610 while nodestotag:
611 # grab a node to tag 611 # grab a node to tag
612 n = nodestotag.pop() 612 n = nodestotag.pop()