##// END OF EJS Templates
obsfate: makes successorsetverb takes the markers as argument...
Boris Feld -
r35011:b81ad5b7 default
parent child Browse files
Show More
@@ -751,8 +751,9 b' def successorsandmarkers(repo, ctx):'
751 751
752 752 return values
753 753
754 def successorsetverb(successorset):
755 """ Return the verb summarizing the successorset
754 def obsfateverb(successorset, markers):
755 """ Return the verb summarizing the successorset and potentially using
756 information from the markers
756 757 """
757 758 if not successorset:
758 759 verb = 'pruned'
@@ -795,7 +796,7 b' def obsfateprinter(successors, markers, '
795 796 line = []
796 797
797 798 # Verb
798 line.append(successorsetverb(successors))
799 line.append(obsfateverb(successors, markers))
799 800
800 801 # Operations
801 802 operations = markersoperations(markers)
@@ -1005,17 +1005,18 b' def obsfateusers(context, mapping, args)'
1005 1005 "obsmakers")
1006 1006 raise error.ParseError(msg)
1007 1007
1008 @templatefunc('obsfateverb(successors)')
1008 @templatefunc('obsfateverb(successors, markers)')
1009 1009 def obsfateverb(context, mapping, args):
1010 1010 """Compute obsfate related information based on successors (EXPERIMENTAL)"""
1011 if len(args) != 1:
1011 if len(args) != 2:
1012 1012 # i18n: "obsfateverb" is a keyword
1013 raise error.ParseError(_("obsfateverb expects one arguments"))
1013 raise error.ParseError(_("obsfateverb expects two arguments"))
1014 1014
1015 1015 successors = evalfuncarg(context, mapping, args[0])
1016 markers = evalfuncarg(context, mapping, args[1])
1016 1017
1017 1018 try:
1018 return obsutil.successorsetverb(successors)
1019 return obsutil.obsfateverb(successors, markers)
1019 1020 except TypeError:
1020 1021 # i18n: "obsfateverb" is a keyword
1021 1022 errmsg = _("obsfateverb first argument should be countable")
@@ -13,7 +13,7 b' Global setup'
13 13 > evolution=true
14 14 > [templates]
15 15 > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}"
16 > obsfateverb = "{obsfateverb(successors)}"
16 > obsfateverb = "{obsfateverb(successors, markers)}"
17 17 > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}"
18 18 > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}"
19 19 > obsfatedate = "{if(obsfatedate(markers), "{ifeq(min(obsfatedate(markers)), max(obsfatedate(markers)), " (at {min(obsfatedate(markers))|isodate})", " (between {min(obsfatedate(markers))|isodate} and {max(obsfatedate(markers))|isodate})")}")}"
General Comments 0
You need to be logged in to leave comments. Login now