diff hgext3rd/topic/__init__.py @ 6241:85abf58c3d8c

topic: namespace template keyword
author Anton Shestakov <av6@dwimlabs.net>
date Wed, 04 May 2022 15:55:34 +0400
parents 2686ecc90791
children a433fe0cea21
line wrap: on
line diff
--- a/hgext3rd/topic/__init__.py	Wed May 04 15:53:57 2022 +0400
+++ b/hgext3rd/topic/__init__.py	Wed May 04 15:55:34 2022 +0400
@@ -749,6 +749,12 @@
     ctx = context.resource(mapping, b'ctx')
     return ctx.topicidx()
 
+@templatekeyword(b'topic_namespace', requires={b'ctx'})
+def topicnamespacekw(context, mapping):
+    """:topic_namespace: String. The topic namespace of the changeset"""
+    ctx = context.resource(mapping, b'ctx')
+    return ctx.topic_namespace()
+
 def wrapinit(orig, self, repo, *args, **kwargs):
     orig(self, repo, *args, **kwargs)
     if not hastopicext(repo):