diff hgext3rd/topic/__init__.py @ 6311:466702ac6c28

topic: complete "//" format support in experimental.topic.linear-merge code This code is used for merging topics into bare branches (with "allow-from-bare-branch"), and it modifies branch name on a specific revision to be different from branch name on the merge destination. This allows merging the two changesets even when they belong to the same branch. Let's use formatfqbn() for consistency. The format doesn't matter much as long as the result is different from bare branch name. Topic namespace is ignored here by design, there needs to be a topic set for this linear-merge mode to work.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 16 Sep 2022 17:00:48 +0400
parents 075f365a53cf
children 3e488afe62f5
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Fri Sep 16 16:59:24 2022 +0400
+++ b/hgext3rd/topic/__init__.py	Fri Sep 16 17:00:48 2022 +0400
@@ -1455,9 +1455,11 @@
                     ret = super(overridebranch, self).__getitem__(rev)
                     if rev == node:
                         b = ret.branch()
+                        tns = ret.topic_namespace()
                         t = ret.topic()
+                        # topic is required for merging from bare branch
                         if t:
-                            ret.branch = lambda: b'%s//%s' % (b, t)
+                            ret.branch = lambda: common.formatfqbn(b, tns, t)
                     return ret
             unfi.__class__ = overridebranch
             if repo.filtername is not None: