# HG changeset patch
# User Pulkit Goyal <pulkit@yandex-team.ru>
# Date 2019-03-31 13:20:17
# Node ID 29c22496dd973a568caae2953866b3d24eae3d6f
# Parent  f0fa0fc4900ac6c62b39d88dbd65867d0e6a82cb

branchmap: prevent using __getitem__() in branchheads()

branchheads() can directly use self._entries instead.

Differential Revision: https://phab.mercurial-scm.org/D6205

diff --git a/mercurial/branchmap.py b/mercurial/branchmap.py
--- a/mercurial/branchmap.py
+++ b/mercurial/branchmap.py
@@ -290,7 +290,7 @@ class branchcache(object):
         return (n for n in nodes if n not in self._closednodes)
 
     def branchheads(self, branch, closed=False):
-        heads = self[branch]
+        heads = self._entries[branch]
         if not closed:
             heads = list(self.iteropen(heads))
         return heads