diff hgext3rd/topic/__init__.py @ 6600:421dc5c11108

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().
author Anton Shestakov <av6@dwimlabs.net>
date Sun, 29 Oct 2023 15:56:57 -0300
parents 6035b539aa3b
children 6116a0208449
line wrap: on
line diff
--- 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,