Skip to content
Snippets Groups Projects
Commit fb22c7a6 authored by Sushil Khanchi's avatar Sushil Khanchi :koala:
Browse files

topic: add topicidx template keyword

This keyword will be useful where we want to see the index of
the changeset in the stack when we run `hg stack`.
parent 0c84b48c
No related branches found
No related tags found
No related merge requests found
......@@ -546,8 +546,14 @@
""":topic: String. The topic of the changeset"""
ctx = context.resource(mapping, 'ctx')
return ctx.topic()
@templatekeyword('topicidx', requires={'ctx'})
def topicidxkw(context, mapping):
""":topicidx: Integer. Index of the changeset as a stack alias"""
ctx = context.resource(mapping, 'ctx')
return ctx.topicidx()
else:
def topickw(**args):
""":topic: String. The topic of the changeset"""
return args['ctx'].topic()
......@@ -549,8 +555,12 @@
else:
def topickw(**args):
""":topic: String. The topic of the changeset"""
return args['ctx'].topic()
def topicidxkw(**args):
""":topicidx: Integer. Index of the changeset as a stack alias"""
return args['ctx'].topicidx()
def wrapinit(orig, self, repo, *args, **kwargs):
orig(self, repo, *args, **kwargs)
if constants.extrakey not in self._extra:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment