mercurial/templater.py
changeset 34287 7cdc8c5a481a
parent 34250 448725a2ef73
child 34324 e473f482b9b3
equal deleted inserted replaced
34286:ecc96506c49d 34287:7cdc8c5a481a
   876         raise error.ParseError(_("mod expects two arguments"))
   876         raise error.ParseError(_("mod expects two arguments"))
   877 
   877 
   878     func = lambda a, b: a % b
   878     func = lambda a, b: a % b
   879     return runarithmetic(context, mapping, (func, args[0], args[1]))
   879     return runarithmetic(context, mapping, (func, args[0], args[1]))
   880 
   880 
       
   881 @templatefunc('obsfateoperations(markers)')
       
   882 def obsfateoperations(context, mapping, args):
       
   883     """Compute obsfate related information based on markers (EXPERIMENTAL)"""
       
   884     if len(args) != 1:
       
   885         # i18n: "obsfateoperations" is a keyword
       
   886         raise error.ParseError(_("obsfateoperations expects one arguments"))
       
   887 
       
   888     markers = evalfuncarg(context, mapping, args[0])
       
   889 
       
   890     try:
       
   891         data = obsutil.markersoperations(markers)
       
   892         return templatekw.hybridlist(data, name='operation')
       
   893     except (TypeError, KeyError):
       
   894         # i18n: "obsfateoperations" is a keyword
       
   895         errmsg = _("obsfateoperations first argument should be an iterable")
       
   896         raise error.ParseError(errmsg)
       
   897 
   881 @templatefunc('obsfatedate(markers)')
   898 @templatefunc('obsfatedate(markers)')
   882 def obsfatedate(context, mapping, args):
   899 def obsfatedate(context, mapping, args):
   883     """Compute obsfate related information based on markers (EXPERIMENTAL)"""
   900     """Compute obsfate related information based on markers (EXPERIMENTAL)"""
   884     if len(args) != 1:
   901     if len(args) != 1:
   885         # i18n: "obsfatedate" is a keyword
   902         # i18n: "obsfatedate" is a keyword