get repo.branchheads() to use working directory's branch by default
authorDirkjan Ochtman <dirkjan@ochtman.nl>
Mon, 23 Jun 2008 15:03:22 +0200
changeset 6722 197d54d82f8d
parent 6721 521c6c6f3b9b
child 6723 1fe6f365df2e
get repo.branchheads() to use working directory's branch by default
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Mon Jun 23 13:12:32 2008 +0200
+++ b/mercurial/localrepo.py	Mon Jun 23 15:03:22 2008 +0200
@@ -1204,7 +1204,8 @@
         heads.sort()
         return [n for (r, n) in heads]
 
-    def branchheads(self, branch, start=None):
+    def branchheads(self, branch=None, start=None):
+        branch = branch or self.workingctx().branch()
         branches = self.branchtags()
         if branch not in branches:
             return []