mercurial/templater.py
changeset 26485 43bf9471fae9
parent 26334 0a5a774f5956
child 26504 875e5d89dc86
equal deleted inserted replaced
26484:93c80e7ed8c8 26485:43bf9471fae9
   510         raise error.ParseError(_("label expects two arguments"))
   510         raise error.ParseError(_("label expects two arguments"))
   511 
   511 
   512     # ignore args[0] (the label string) since this is supposed to be a a no-op
   512     # ignore args[0] (the label string) since this is supposed to be a a no-op
   513     yield args[1][0](context, mapping, args[1][1])
   513     yield args[1][0](context, mapping, args[1][1])
   514 
   514 
       
   515 def latesttag(context, mapping, args):
       
   516     """:latesttag([pattern]): The global tags matching the given pattern on the
       
   517     most recent globally tagged ancestor of this changeset."""
       
   518     if len(args) > 1:
       
   519         # i18n: "latesttag" is a keyword
       
   520         raise error.ParseError(_("latesttag expects at most one argument"))
       
   521 
       
   522     pattern = None
       
   523     if len(args) == 1:
       
   524         pattern = stringify(args[0][0](context, mapping, args[0][1]))
       
   525 
       
   526     return templatekw.showlatesttags(pattern, **mapping)
       
   527 
   515 def localdate(context, mapping, args):
   528 def localdate(context, mapping, args):
   516     """:localdate(date[, tz]): Converts a date to the specified timezone.
   529     """:localdate(date[, tz]): Converts a date to the specified timezone.
   517     The default is local date."""
   530     The default is local date."""
   518     if not (1 <= len(args) <= 2):
   531     if not (1 <= len(args) <= 2):
   519         # i18n: "localdate" is a keyword
   532         # i18n: "localdate" is a keyword
   731     "ifcontains": ifcontains,
   744     "ifcontains": ifcontains,
   732     "ifeq": ifeq,
   745     "ifeq": ifeq,
   733     "indent": indent,
   746     "indent": indent,
   734     "join": join,
   747     "join": join,
   735     "label": label,
   748     "label": label,
       
   749     "latesttag": latesttag,
   736     "localdate": localdate,
   750     "localdate": localdate,
   737     "pad": pad,
   751     "pad": pad,
   738     "revset": revset,
   752     "revset": revset,
   739     "rstdoc": rstdoc,
   753     "rstdoc": rstdoc,
   740     "shortest": shortest,
   754     "shortest": shortest,