mercurial/templater.py
changeset 3647 734e337cb816
parent 3643 b4ad640a3bcf
child 3877 abaee83ce0a6
child 3904 0dd07dd63db3
equal deleted inserted replaced
3646:069f3acdad6c 3647:734e337cb816
   154             return fmt(t, n)
   154             return fmt(t, n)
   155 
   155 
   156 def stringify(thing):
   156 def stringify(thing):
   157     '''turn nested template iterator into string.'''
   157     '''turn nested template iterator into string.'''
   158     if hasattr(thing, '__iter__'):
   158     if hasattr(thing, '__iter__'):
   159         return "".join([stringify(t) for t in thing])
   159         return "".join([stringify(t) for t in thing if t is not None])
   160     if thing is None: return ""
       
   161     return str(thing)
   160     return str(thing)
   162 
   161 
   163 para_re = None
   162 para_re = None
   164 space_re = None
   163 space_re = None
   165 
   164