# HG changeset patch # User Anton Shestakov # Date 1697399965 10800 # Node ID d511eba4cdb09622f3ad72e7a00d8fbcae76cc11 # Parent ef04d887c9a0593e839ed1ab308b46682639c24b topic: compatibility for branchmaptns with branchmap from hg 5.0 Since our new branchmaptns so heavily reuses the core branchmap, we need to make sure to use all the compatibility function with it as well, even though it lives completely in topic extension. diff -r ef04d887c9a0 -r d511eba4cdb0 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Fri Oct 13 15:16:18 2023 -0300 +++ b/hgext3rd/topic/__init__.py Sun Oct 15 16:59:25 2023 -0300 @@ -782,7 +782,8 @@ else: # only changesets in the selected topic namespaces are visible h = [] - for branch, nodes in self._repo.branchmaptns().items(): + entries = compat.bcentries(self._repo.branchmaptns()) + for branch, nodes in compat.branchmapitems(entries): namedbranch, tns, topic = common.parsefqbn(branch) if tns == b'none' or tns in namespaces: h.extend(nodes) diff -r ef04d887c9a0 -r d511eba4cdb0 hgext3rd/topic/discovery.py --- a/hgext3rd/topic/discovery.py Fri Oct 13 15:16:18 2023 -0300 +++ b/hgext3rd/topic/discovery.py Sun Oct 15 16:59:25 2023 -0300 @@ -184,9 +184,9 @@ """copied from wireprotov1server.branchmap()""" if not common.hastopicext(repo): return wireprotov1server.branchmap(repo, proto) - branchmaptns = repo.branchmaptns() heads = [] - for branch, nodes in branchmaptns.items(): + entries = compat.bcentries(repo.branchmaptns()) + for branch, nodes in compat.branchmapitems(entries): branchname = urlreq.quote(encoding.fromlocal(branch)) branchnodes = wireprototypes.encodelist(nodes) heads.append(b'%s %s' % (branchname, branchnodes)) diff -r ef04d887c9a0 -r d511eba4cdb0 hgext3rd/topic/server.py --- a/hgext3rd/topic/server.py Fri Oct 13 15:16:18 2023 -0300 +++ b/hgext3rd/topic/server.py Sun Oct 15 16:59:25 2023 -0300 @@ -18,6 +18,7 @@ from . import ( common, + compat, constants, ) @@ -75,7 +76,8 @@ else: # only changesets in the selected topic namespaces are visible h = [] - for branch, nodes in repo.branchmaptns().items(): + entries = compat.bcentries(repo.branchmaptns()) + for branch, nodes in compat.branchmapitems(entries): namedbranch, tns, topic = common.parsefqbn(branch) if tns == b'none' or tns in namespaces: h.extend(nodes)