branchmap: micro-optimize branchinfo
authorJoerg Sonnenberger <joerg@bec.de>
Thu, 17 Dec 2020 13:29:50 +0100
changeset 46197 2607a9346398
parent 46196 96b73671753a
child 46198 72007a9ac064
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
mercurial/changelog.py
--- 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):