comparison mercurial/templatekw.py @ 38283:0e0d03d09ecd

templater: rename mappable to hybriditem as it is the primary use case This frees up the name 'mappable' for new interface type.
author Yuya Nishihara <yuya@tcha.org>
date Sat, 09 Jun 2018 12:36:06 +0900
parents ec37df9042f9
children 8d6109b49b31
comparison
equal deleted inserted replaced
38282:1a05e205832a 38283:0e0d03d09ecd
29 from .utils import ( 29 from .utils import (
30 stringutil, 30 stringutil,
31 ) 31 )
32 32
33 _hybrid = templateutil.hybrid 33 _hybrid = templateutil.hybrid
34 _mappable = templateutil.mappable
35 hybriddict = templateutil.hybriddict 34 hybriddict = templateutil.hybriddict
36 hybridlist = templateutil.hybridlist 35 hybridlist = templateutil.hybridlist
37 compatdict = templateutil.compatdict 36 compatdict = templateutil.compatdict
38 compatlist = templateutil.compatlist 37 compatlist = templateutil.compatlist
39 _showcompatlist = templateutil._showcompatlist 38 _showcompatlist = templateutil._showcompatlist
467 mhex = hex(mnode) 466 mhex = hex(mnode)
468 mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex}) 467 mapping = context.overlaymap(mapping, {'rev': mrev, 'node': mhex})
469 f = context.process('manifest', mapping) 468 f = context.process('manifest', mapping)
470 # TODO: perhaps 'ctx' should be dropped from mapping because manifest 469 # TODO: perhaps 'ctx' should be dropped from mapping because manifest
471 # rev and node are completely different from changeset's. 470 # rev and node are completely different from changeset's.
472 return _mappable(f, None, f, lambda x: {'rev': mrev, 'node': mhex}) 471 return templateutil.hybriditem(f, None, f,
472 lambda x: {'rev': mrev, 'node': mhex})
473 473
474 @templatekeyword('obsfate', requires={'ui', 'repo', 'ctx'}) 474 @templatekeyword('obsfate', requires={'ui', 'repo', 'ctx'})
475 def showobsfate(context, mapping): 475 def showobsfate(context, mapping):
476 # this function returns a list containing pre-formatted obsfate strings. 476 # this function returns a list containing pre-formatted obsfate strings.
477 # 477 #