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
--- 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):