Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 1550:ccb9b62de892
add a -r/--rev option to heads to show only heads descendant from rev
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Wed, 16 Nov 2005 12:08:25 +0100 |
parents | 27077812fffb |
children | e793cbc8be00 |
comparison
equal
deleted
inserted
replaced
1547:4dea10839201 | 1550:ccb9b62de892 |
---|---|
611 wlock = self.wlock() | 611 wlock = self.wlock() |
612 if self.dirstate.state(dest) == '?': | 612 if self.dirstate.state(dest) == '?': |
613 self.dirstate.update([dest], "a") | 613 self.dirstate.update([dest], "a") |
614 self.dirstate.copy(source, dest) | 614 self.dirstate.copy(source, dest) |
615 | 615 |
616 def heads(self): | 616 def heads(self, start=nullid): |
617 return self.changelog.heads() | 617 heads = self.changelog.heads(start) |
618 # sort the output in rev descending order | |
619 heads = [(-self.changelog.rev(h), h) for h in heads] | |
620 heads.sort() | |
621 return [n for (r, n) in heads] | |
618 | 622 |
619 # branchlookup returns a dict giving a list of branches for | 623 # branchlookup returns a dict giving a list of branches for |
620 # each head. A branch is defined as the tag of a node or | 624 # each head. A branch is defined as the tag of a node or |
621 # the branch of the node's parents. If a node has multiple | 625 # the branch of the node's parents. If a node has multiple |
622 # branch tags, tags are eliminated if they are visible from other | 626 # branch tags, tags are eliminated if they are visible from other |