changeset 46197:2607a9346398

branchmap: micro-optimize branchinfo changelogrevision() is supposed to be used if not all data of changelog.read is used. This is the case here as only the extra field is used. This also improves extensibility as at least hgext.git doesn't implement changelog.read. Differential Revision: https://phab.mercurial-scm.org/D9626
author Joerg Sonnenberger <joerg@bec.de>
date Thu, 17 Dec 2020 13:29:50 +0100
parents 96b73671753a
children 72007a9ac064
files mercurial/changelog.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changelog.py	Wed Jan 06 19:41:15 2021 +0100
+++ b/mercurial/changelog.py	Thu Dec 17 13:29:50 2020 +0100
@@ -601,7 +601,7 @@
 
         This function exists because creating a changectx object
         just to access this is costly."""
-        extra = self.read(rev)[5]
+        extra = self.changelogrevision(rev).extra
         return encoding.tolocal(extra.get(b"branch")), b'close' in extra
 
     def _nodeduplicatecallback(self, transaction, node):