##// END OF EJS Templates
revlog: use real Booleans instead of 0/1 in nodesbetween
Martin Geisler -
r14219:c3342708 default
parent child Browse files
Show More
@@ -506,7 +506,7 b' class revlog(object):'
506 # Turn heads into a dictionary so we can remove 'fake' heads.
506 # Turn heads into a dictionary so we can remove 'fake' heads.
507 # Also, later we will be using it to filter out the heads we can't
507 # Also, later we will be using it to filter out the heads we can't
508 # find from roots.
508 # find from roots.
509 heads = dict.fromkeys(heads, 0)
509 heads = dict.fromkeys(heads, False)
510 # Start at the top and keep marking parents until we're done.
510 # Start at the top and keep marking parents until we're done.
511 nodestotag = set(heads)
511 nodestotag = set(heads)
512 # Remember where the top was so we can use it as a limit later.
512 # Remember where the top was so we can use it as a limit later.
@@ -596,16 +596,16 b' class revlog(object):'
596 # We're trying to figure out which heads are reachable
596 # We're trying to figure out which heads are reachable
597 # from roots.
597 # from roots.
598 # Mark this head as having been reached
598 # Mark this head as having been reached
599 heads[n] = 1
599 heads[n] = True
600 elif ancestors is None:
600 elif ancestors is None:
601 # Otherwise, we're trying to discover the heads.
601 # Otherwise, we're trying to discover the heads.
602 # Assume this is a head because if it isn't, the next step
602 # Assume this is a head because if it isn't, the next step
603 # will eventually remove it.
603 # will eventually remove it.
604 heads[n] = 1
604 heads[n] = True
605 # But, obviously its parents aren't.
605 # But, obviously its parents aren't.
606 for p in self.parents(n):
606 for p in self.parents(n):
607 heads.pop(p, None)
607 heads.pop(p, None)
608 heads = [n for n in heads.iterkeys() if heads[n] != 0]
608 heads = [n for n, flag in heads.iteritems() if flag]
609 roots = list(roots)
609 roots = list(roots)
610 assert orderedout
610 assert orderedout
611 assert roots
611 assert roots
General Comments 0
You need to be logged in to leave comments. Login now