mercurial/templater.py
changeset 31169 48a8b2e5fe31
parent 31024 0b8356705de6
child 31519 3725986b151a
equal deleted inserted replaced
31168:41a9edc5d00f 31169:48a8b2e5fe31
   542         except IndexError:
   542         except IndexError:
   543             pass
   543             pass
   544 
   544 
   545     return templatefilters.fill(text, width, initindent, hangindent)
   545     return templatefilters.fill(text, width, initindent, hangindent)
   546 
   546 
       
   547 @templatefunc('formatnode(node)')
       
   548 def formatnode(context, mapping, args):
       
   549     """Obtain the preferred form of a changeset hash. (DEPRECATED)"""
       
   550     if len(args) != 1:
       
   551         # i18n: "formatnode" is a keyword
       
   552         raise error.ParseError(_("formatnode expects one argument"))
       
   553 
       
   554     ui = mapping['ui']
       
   555     node = evalstring(context, mapping, args[0])
       
   556     if ui.debugflag:
       
   557         return node
       
   558     return templatefilters.short(node)
       
   559 
   547 @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])')
   560 @templatefunc('pad(text, width[, fillchar=\' \'[, left=False]])')
   548 def pad(context, mapping, args):
   561 def pad(context, mapping, args):
   549     """Pad text with a
   562     """Pad text with a
   550     fill character."""
   563     fill character."""
   551     if not (2 <= len(args) <= 4):
   564     if not (2 <= len(args) <= 4):