# HG changeset patch # User Anton Shestakov # Date 1698605817 10800 # Node ID 421dc5c1110870c6c790a170695843ec01f0680c # Parent 6035b539aa3b8681ea3b6e7a95513350b73caeed topic: use dirstate.branch() instead of wdir.branch() Since we wrap context.branch method to return branch in FQBN format already, we cannot simply use its result with formatfqbn() again. Let's use something that we don't wrap in topic extension, such as dirstate.branch(). diff -r 6035b539aa3b -r 421dc5c11108 hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Mon Oct 23 15:29:27 2023 -0300 +++ b/hgext3rd/topic/__init__.py Sun Oct 29 15:56:57 2023 -0300 @@ -746,7 +746,11 @@ def branchheads(self, branch=None, start=None, closed=False): if branch is None: - branch = self[None].branch() + # using dirstate.branch() instead of self[None].branch() + # because we wrap context.branch method to return branch + # already in FQBN format, and we can't give it to formatfqbn() + # again directly + branch = self.dirstate.branch() branch = common.formatfqbn(branch, self.currenttns, self.currenttopic) return super(topicrepo, self).branchheads(branch=branch, start=start,