Mercurial > public > mercurial-scm > hg
comparison mercurial/templateutil.py @ 38449:bc8d925342f0
templater: extend filter() to accept template expression for emptiness test
This utilizes the pass-by-name nature of template arguments.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 14 Jun 2018 23:10:14 +0900 |
parents | dae829b4de78 |
children | 382b055cc358 |
comparison
equal
deleted
inserted
replaced
38448:dae829b4de78 | 38449:bc8d925342f0 |
---|---|
413 | 413 |
414 def getmax(self, context, mapping): | 414 def getmax(self, context, mapping): |
415 raise error.ParseError(_('not comparable')) | 415 raise error.ParseError(_('not comparable')) |
416 | 416 |
417 def filter(self, context, mapping, select): | 417 def filter(self, context, mapping, select): |
418 # implement if necessary; we'll need a wrapped type for a mapping dict | |
418 raise error.ParseError(_('not filterable without template')) | 419 raise error.ParseError(_('not filterable without template')) |
419 | 420 |
420 def join(self, context, mapping, sep): | 421 def join(self, context, mapping, sep): |
421 mapsiter = _iteroverlaymaps(context, mapping, self.itermaps(context)) | 422 mapsiter = _iteroverlaymaps(context, mapping, self.itermaps(context)) |
422 if self._name: | 423 if self._name: |