Show More
@@ -554,17 +554,16 b' class templateresources(templater.resour' | |||
|
554 | 554 | } |
|
555 | 555 | |
|
556 | 556 | def availablekeys(self, mapping): |
|
557 |
return {k for k |
|
|
558 |
if g( |
|
|
557 | return {k for k in self.knownkeys() | |
|
558 | if self._getsome(mapping, k) is not None} | |
|
559 | 559 | |
|
560 | 560 | def knownkeys(self): |
|
561 | return self._knownkeys | |
|
561 | return {'cache', 'ctx', 'fctx', 'repo', 'revcache', 'ui'} | |
|
562 | 562 | |
|
563 | 563 | def lookup(self, mapping, key): |
|
564 | get = self._gettermap.get(key) | |
|
565 | if not get: | |
|
564 | if key not in self.knownkeys(): | |
|
566 | 565 | return None |
|
567 |
return get( |
|
|
566 | return self._getsome(mapping, key) | |
|
568 | 567 | |
|
569 | 568 | def populatemap(self, context, origmapping, newmapping): |
|
570 | 569 | mapping = {} |
@@ -585,16 +584,6 b' class templateresources(templater.resour' | |||
|
585 | 584 | def _hasctx(self, mapping): |
|
586 | 585 | return 'ctx' in mapping |
|
587 | 586 | |
|
588 | _gettermap = { | |
|
589 | 'cache': _getsome, | |
|
590 | 'ctx': _getsome, | |
|
591 | 'fctx': _getsome, | |
|
592 | 'repo': _getsome, | |
|
593 | 'revcache': _getsome, | |
|
594 | 'ui': _getsome, | |
|
595 | } | |
|
596 | _knownkeys = set(_gettermap.keys()) | |
|
597 | ||
|
598 | 587 | def formatter(ui, out, topic, opts): |
|
599 | 588 | template = opts.get("template", "") |
|
600 | 589 | if template == "json": |
General Comments 0
You need to be logged in to leave comments.
Login now