# HG changeset patch # User Anton Shestakov # Date 1663333248 -14400 # Node ID 466702ac6c286c0f8a97fc10926ad529270c9825 # Parent 43166bd57d6cf76b91d556e560744cf59478de38 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. diff -r 43166bd57d6c -r 466702ac6c28 hgext3rd/topic/__init__.py --- 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: