changeset 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 43166bd57d6c
children 921eb676983f
files hgext3rd/topic/__init__.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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: