Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/localrepo.py @ 6722:197d54d82f8d
get repo.branchheads() to use working directory's branch by default
author | Dirkjan Ochtman <dirkjan@ochtman.nl> |
---|---|
date | Mon, 23 Jun 2008 15:03:22 +0200 |
parents | 521c6c6f3b9b |
children | e85951aeec6e |
comparison
equal
deleted
inserted
replaced
6721:521c6c6f3b9b | 6722:197d54d82f8d |
---|---|
1202 # sort the output in rev descending order | 1202 # sort the output in rev descending order |
1203 heads = [(-self.changelog.rev(h), h) for h in heads] | 1203 heads = [(-self.changelog.rev(h), h) for h in heads] |
1204 heads.sort() | 1204 heads.sort() |
1205 return [n for (r, n) in heads] | 1205 return [n for (r, n) in heads] |
1206 | 1206 |
1207 def branchheads(self, branch, start=None): | 1207 def branchheads(self, branch=None, start=None): |
1208 branch = branch or self.workingctx().branch() | |
1208 branches = self.branchtags() | 1209 branches = self.branchtags() |
1209 if branch not in branches: | 1210 if branch not in branches: |
1210 return [] | 1211 return [] |
1211 # The basic algorithm is this: | 1212 # The basic algorithm is this: |
1212 # | 1213 # |