mercurial/templater.py
changeset 33994 38f08eaba6b0
parent 33993 3d0f8918351b
child 33995 c35c0f54f420
equal deleted inserted replaced
33993:3d0f8918351b 33994:38f08eaba6b0
   848         raise error.ParseError(_("mod expects two arguments"))
   848         raise error.ParseError(_("mod expects two arguments"))
   849 
   849 
   850     func = lambda a, b: a % b
   850     func = lambda a, b: a % b
   851     return runarithmetic(context, mapping, (func, args[0], args[1]))
   851     return runarithmetic(context, mapping, (func, args[0], args[1]))
   852 
   852 
       
   853 @templatefunc('obsfateusers(markers)')
       
   854 def obsfateusers(context, mapping, args):
       
   855     """Compute obsfate related information based on markers (EXPERIMENTAL)"""
       
   856     if len(args) != 1:
       
   857         # i18n: "obsfateusers" is a keyword
       
   858         raise error.ParseError(_("obsfateusers expects one arguments"))
       
   859 
       
   860     markers = evalfuncarg(context, mapping, args[0])
       
   861 
       
   862     try:
       
   863         data = obsutil.markersusers(markers)
       
   864         return templatekw.hybridlist(data, name='user')
       
   865     except (TypeError, KeyError, ValueError):
       
   866         # i18n: "obsfateusers" is a keyword
       
   867         msg = _("obsfateusers first argument should be an iterable of "
       
   868                 "obsmakers")
       
   869         raise error.ParseError(msg)
       
   870 
   853 @templatefunc('obsfateverb(successors)')
   871 @templatefunc('obsfateverb(successors)')
   854 def obsfateverb(context, mapping, args):
   872 def obsfateverb(context, mapping, args):
   855     """Compute obsfate related information based on successors (EXPERIMENTAL)"""
   873     """Compute obsfate related information based on successors (EXPERIMENTAL)"""
   856     if len(args) != 1:
   874     if len(args) != 1:
   857         # i18n: "obsfateverb" is a keyword
   875         # i18n: "obsfateverb" is a keyword