changeset 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 7a9d3fde811f
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
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,