Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/templatefuncs.py @ 44597:fc1fa3a07af6
templater: introduce wrapper for smartset (API)
I want to add a template function which takes a revset as an argument:
{somefunc(..., revset(...))}
^^^^^^^^^^^
evaluates to a revslist
This wrapper will provide a method to get an underlying smartset. It should
also be good for performance since count(revset(...)) will no longer have to
fully consume the smartset for example, but that isn't the point of this
change.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sun, 15 Mar 2020 15:12:44 +0900 |
parents | fa246ada356b |
children | 1f81f680912f |
comparison
equal
deleted
inserted
replaced
44596:2a98b0cd4995 | 44597:fc1fa3a07af6 |
---|---|
666 if raw in revsetcache: | 666 if raw in revsetcache: |
667 revs = revsetcache[raw] | 667 revs = revsetcache[raw] |
668 else: | 668 else: |
669 revs = query(raw) | 669 revs = query(raw) |
670 revsetcache[raw] = revs | 670 revsetcache[raw] = revs |
671 return templatekw.showrevslist(context, mapping, b"revision", revs) | 671 return templateutil.revslist(repo, revs, name=b'revision') |
672 | 672 |
673 | 673 |
674 @templatefunc(b'rstdoc(text, style)') | 674 @templatefunc(b'rstdoc(text, style)') |
675 def rstdoc(context, mapping, args): | 675 def rstdoc(context, mapping, args): |
676 """Format reStructuredText.""" | 676 """Format reStructuredText.""" |