# HG changeset patch
# User Dirkjan Ochtman <dirkjan@ochtman.nl>
# Date 1214226202 -7200
# Node ID 197d54d82f8d1606ea88d75e868d84242a044f4a
# Parent  521c6c6f3b9bc29c880a73a19ff443e9e0ec32b0
get repo.branchheads() to use working directory's branch by default

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -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 []