Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
1550:ccb9b62de892 | 1551:e793cbc8be00 |
---|---|
407 assert orderedout | 407 assert orderedout |
408 assert roots | 408 assert roots |
409 assert heads | 409 assert heads |
410 return (orderedout, roots, heads) | 410 return (orderedout, roots, heads) |
411 | 411 |
412 def heads(self, start=nullid): | 412 def heads(self, start=None): |
413 """return the list of all nodes that have no children | 413 """return the list of all nodes that have no children |
414 if start is specified, only heads that are children of | 414 |
415 start will be returned""" | 415 if start is specified, only heads that are descendants of |
416 start will be returned | |
417 | |
418 """ | |
419 if start is None: | |
420 start = nullid | |
416 reachable = {start: 1} | 421 reachable = {start: 1} |
417 heads = {start: 1} | 422 heads = {start: 1} |
418 startrev = self.rev(start) | 423 startrev = self.rev(start) |
419 | 424 |
420 for r in xrange(startrev + 1, self.count()): | 425 for r in xrange(startrev + 1, self.count()): |