comparison mercurial/hgweb/webutil.py @ 38244:688fbb758ba9

templater: resolve type of dict key in getmember() This seems more correct and is consistent with the future wrapped.contains() function, where a key type has to be resolved depending on a container type.
author Yuya Nishihara <yuya@tcha.org>
date Fri, 04 May 2018 12:43:15 +0900
parents 06d11cd90516
children 41ae9b3cbfb9
comparison
equal deleted inserted replaced
38243:06d11cd90516 38244:688fbb758ba9
712 712
713 def __copy__(self): 713 def __copy__(self):
714 return sessionvars(copy.copy(self._vars), self._start) 714 return sessionvars(copy.copy(self._vars), self._start)
715 715
716 def getmember(self, context, mapping, key): 716 def getmember(self, context, mapping, key):
717 key = templateutil.unwrapvalue(context, mapping, key)
717 return self._vars.get(key) 718 return self._vars.get(key)
718 719
719 def itermaps(self, context): 720 def itermaps(self, context):
720 separator = self._start 721 separator = self._start
721 for key, value in sorted(self._vars.iteritems()): 722 for key, value in sorted(self._vars.iteritems()):