# HG changeset patch # User Anton Shestakov # Date 1653560218 -14400 # Node ID 945d27da146c6fab6b46933df9bb40eaadfdd9d3 # Parent 91d9a279b84abb9df1f8a89dd851711e160b2906 topic: format fqbn correctly from only a branch if it contains // diff -r 91d9a279b84a -r 945d27da146c hgext3rd/topic/common.py --- a/hgext3rd/topic/common.py Sat May 14 23:29:48 2022 +0400 +++ b/hgext3rd/topic/common.py Thu May 26 14:16:58 2022 +0400 @@ -51,6 +51,8 @@ '//namespace/topic' >>> formatfqbn(branch=b'branch') 'branch' + >>> formatfqbn(branch=b'branch//') + 'branch////' >>> formatfqbn(namespace=b'namespace') '//namespace/' >>> formatfqbn(branch=b'/topic') @@ -61,11 +63,13 @@ 'branch//namespace/topic' >>> formatfqbn(branch=b'foo/bar', namespace=b'user26', topic=b'feature') 'foo/bar//user26/feature' + >>> formatfqbn(branch=b'http://example.com/branch', namespace=b'namespace', topic=b'topic') + 'http://example.com/branch//namespace/topic' """ result = b'' if branch: result += branch - if namespace or topic: + if namespace or topic or b'//' in branch: result += b'//' if namespace: result += namespace + b'/'