comparison hgext3rd/topic/__init__.py @ 6745:71c4b6c2bcdc

topic: drop branchmap._entries compatibility for hg 4.9
author Anton Shestakov <av6@dwimlabs.net>
date Thu, 11 Jan 2024 15:31:13 -0300
parents 3076dba01b86
children 6adcc5c7c1f1
comparison
equal deleted inserted replaced
6744:3076dba01b86 6745:71c4b6c2bcdc
749 topicfilter = topicmap.topicfilter(self.filtername) 749 topicfilter = topicmap.topicfilter(self.filtername)
750 if not topic or topicfilter == self.filtername: 750 if not topic or topicfilter == self.filtername:
751 return super(topicrepo, self).branchmap() 751 return super(topicrepo, self).branchmap()
752 bm = self.filtered(topicfilter).branchmap() 752 bm = self.filtered(topicfilter).branchmap()
753 if convertbm: 753 if convertbm:
754 entries = compat.bcentries(bm) 754 for key in list(bm._entries):
755 for key in list(entries):
756 branch, tns, topic = common.parsefqbn(key) 755 branch, tns, topic = common.parsefqbn(key)
757 if topic: 756 if topic:
758 value = entries.pop(key) 757 value = bm._entries.pop(key)
759 # we lose namespace when converting to ":" format 758 # we lose namespace when converting to ":" format
760 key = b'%s:%s' % (branch, topic) 759 key = b'%s:%s' % (branch, topic)
761 entries[key] = value 760 bm._entries[key] = value
762 return bm 761 return bm
763 762
764 def branchmaptns(self, topic=None): 763 def branchmaptns(self, topic=None):
765 """branchmap using fqbn as keys""" 764 """branchmap using fqbn as keys"""
766 if topic is None: 765 if topic is None:
813 # pulling all topic namespaces, all changesets are visible 812 # pulling all topic namespaces, all changesets are visible
814 return self._repo.heads() 813 return self._repo.heads()
815 else: 814 else:
816 # only changesets in the selected topic namespaces are visible 815 # only changesets in the selected topic namespaces are visible
817 h = [] 816 h = []
818 entries = compat.bcentries(self._repo.branchmaptns()) 817 entries = self._repo.branchmaptns()._entries
819 for branch, nodes in compat.branchmapitems(entries): 818 for branch, nodes in compat.branchmapitems(entries):
820 namedbranch, tns, topic = common.parsefqbn(branch) 819 namedbranch, tns, topic = common.parsefqbn(branch)
821 if tns == b'none' or tns in namespaces: 820 if tns == b'none' or tns in namespaces:
822 h.extend(nodes) 821 h.extend(nodes)
823 return h 822 return h