mercurial/templateutil.py
changeset 40935 4591c9791a82
parent 40475 8fa26f3baf30
child 42337 832c59d1196e
equal deleted inserted replaced
40934:d3e688b9ef2e 40935:4591c9791a82
   492         # mark this as non-empty.
   492         # mark this as non-empty.
   493         return True
   493         return True
   494 
   494 
   495     def tovalue(self, context, mapping):
   495     def tovalue(self, context, mapping):
   496         return super(mappingdict, self).tovalue(context, mapping)[0]
   496         return super(mappingdict, self).tovalue(context, mapping)[0]
       
   497 
       
   498 class mappingnone(wrappedvalue):
       
   499     """Wrapper for None, but supports map operation
       
   500 
       
   501     This represents None of Optional[mappable]. It's similar to
       
   502     mapplinglist([]), but the underlying value is not [], but None.
       
   503     """
       
   504 
       
   505     def __init__(self):
       
   506         super(mappingnone, self).__init__(None)
       
   507 
       
   508     def itermaps(self, context):
       
   509         return iter([])
   497 
   510 
   498 class mappedgenerator(wrapped):
   511 class mappedgenerator(wrapped):
   499     """Wrapper for generator of strings which acts as a list
   512     """Wrapper for generator of strings which acts as a list
   500 
   513 
   501     The function ``make(context, *args)`` should return a generator of
   514     The function ``make(context, *args)`` should return a generator of