Mercurial > hg > mercurial-crew-with-dirclash
diff 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 |
line wrap: on
line diff
--- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -613,8 +613,12 @@ class localrepository: self.dirstate.update([dest], "a") self.dirstate.copy(source, dest) - def heads(self): - return self.changelog.heads() + def heads(self, start=nullid): + heads = self.changelog.heads(start) + # sort the output in rev descending order + heads = [(-self.changelog.rev(h), h) for h in heads] + heads.sort() + return [n for (r, n) in heads] # branchlookup returns a dict giving a list of branches for # each head. A branch is defined as the tag of a node or