diff mercurial/revlog.py @ 1551:e793cbc8be00

Fixes to "hg heads -r FOO": Make it actually work (undefined variable 'rev'; allow to pass a rev parameter). repo.branchlookup() doesn't need a copy of heads because it doesn't modify it. Use None as default argument to heads() instead of nullid. Doc string PEPification.
author Thomas Arendsen Hein <thomas@intevation.de>
date Wed, 16 Nov 2005 12:56:19 +0100
parents ccb9b62de892
children 59b3639df0a9
line wrap: on
line diff
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -409,10 +409,15 @@ class revlog:
         assert heads
         return (orderedout, roots, heads)
 
-    def heads(self, start=nullid):
+    def heads(self, start=None):
         """return the list of all nodes that have no children
-        if start is specified, only heads that are children of
-        start will be returned"""
+
+        if start is specified, only heads that are descendants of
+        start will be returned
+
+        """
+        if start is None:
+            start = nullid
         reachable = {start: 1}
         heads = {start: 1}
         startrev = self.rev(start)