# HG changeset patch # User Anton Shestakov # Date 1652556588 -14400 # Node ID 91d9a279b84abb9df1f8a89dd851711e160b2906 # Parent a433fe0cea21401c6f13c05a96b9fddfb14753d3 topic: fqbn template keyword diff -r a433fe0cea21 -r 91d9a279b84a hgext3rd/topic/__init__.py --- a/hgext3rd/topic/__init__.py Tue May 24 19:30:27 2022 +0400 +++ b/hgext3rd/topic/__init__.py Sat May 14 23:29:48 2022 +0400 @@ -763,6 +763,12 @@ ctx = context.resource(mapping, b'ctx') return ctx.topic_namespace() +@templatekeyword(b'fqbn', requires={b'ctx'}) +def fqbnkw(context, mapping): + """:fqbn: String. The branch//namespace/topic of the changeset""" + ctx = context.resource(mapping, b'ctx') + return ctx.fqbn() + def wrapinit(orig, self, repo, *args, **kwargs): orig(self, repo, *args, **kwargs) if not hastopicext(repo): diff -r a433fe0cea21 -r 91d9a279b84a tests/test-namespaces.t --- a/tests/test-namespaces.t Tue May 24 19:30:27 2022 +0400 +++ b/tests/test-namespaces.t Sat May 14 23:29:48 2022 +0400 @@ -13,6 +13,9 @@ $ hg log -r 'wdir()' -T '{topic_namespace}\n' space-name + $ hg log -r 'wdir()' -T '{fqbn}\n' + default//space-name/ + $ hg branches $ hg debug-topic-namespace --clear @@ -39,6 +42,9 @@ $ hg log -r . -T '{rev}: {branch} {topic_namespace} {topic}\n' 0: stable alice feature + $ hg log -r . -T '{rev}: {fqbn}\n' + 0: stable//alice/feature + Parsing $ hg debugparsefqbn foo/bar//user26/feature -T '[{branch}] <{topic_namespace}> ({topic})\n'