revlog: use real Booleans instead of 0/1 in nodesbetween
authorMartin Geisler <mg@aragost.com>
Fri, 06 May 2011 12:09:20 +0200
changeset 14219 c33427080671
parent 14218 202ff575d49b
child 14220 21b8ce4d3331
revlog: use real Booleans instead of 0/1 in nodesbetween
mercurial/revlog.py
--- 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