diff --git a/mercurial/bundle2.py b/mercurial/bundle2.py --- a/mercurial/bundle2.py +++ b/mercurial/bundle2.py @@ -1647,7 +1647,7 @@ cl = repo.unfiltered().changelog branchesdata = collections.defaultdict(lambda: (set(), set())) for node in outgoing.missing: - branch, close = cache.branchinfo(cl.rev(node)) + branch, close = cache.branchinfo(cl.rev(node), changelog=cl) branchesdata[branch][close].add(node) def generate(): diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -2037,8 +2037,9 @@ if full: rbc = self.revbranchcache() + cl = self.changelog for r in self.changelog: - rbc.branchinfo(r) + rbc.branchinfo(r, changelog=cl) rbc.write() # ensure the working copy parents are in the manifestfulltextcache diff --git a/mercurial/revset.py b/mercurial/revset.py --- a/mercurial/revset.py +++ b/mercurial/revset.py @@ -486,9 +486,10 @@ :hg:`help revisions.patterns`. """ getbi = repo.revbranchcache().branchinfo + cl = repo.changelog def getbranch(r): try: - return getbi(r)[0] + return getbi(r, changelog=cl)[0] except error.WdirUnsupported: return repo[r].branch()