Mercurial > hg-stable
changeset 14219:c33427080671
revlog: use real Booleans instead of 0/1 in nodesbetween
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Fri, 06 May 2011 12:09:20 +0200 |
parents | 202ff575d49b |
children | 21b8ce4d3331 |
files | mercurial/revlog.py |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revlog.py Fri May 06 11:31:40 2011 +0200 +++ b/mercurial/revlog.py Fri May 06 12:09:20 2011 +0200 @@ -506,7 +506,7 @@ # Turn heads into a dictionary so we can remove 'fake' heads. # Also, later we will be using it to filter out the heads we can't # find from roots. - heads = dict.fromkeys(heads, 0) + heads = dict.fromkeys(heads, False) # Start at the top and keep marking parents until we're done. nodestotag = set(heads) # Remember where the top was so we can use it as a limit later. @@ -596,16 +596,16 @@ # We're trying to figure out which heads are reachable # from roots. # Mark this head as having been reached - heads[n] = 1 + heads[n] = True elif ancestors is None: # Otherwise, we're trying to discover the heads. # Assume this is a head because if it isn't, the next step # will eventually remove it. - heads[n] = 1 + heads[n] = True # But, obviously its parents aren't. for p in self.parents(n): heads.pop(p, None) - heads = [n for n in heads.iterkeys() if heads[n] != 0] + heads = [n for n, flag in heads.iteritems() if flag] roots = list(roots) assert orderedout assert roots