Show More
@@ -751,8 +751,9 b' def successorsandmarkers(repo, ctx):' | |||||
751 |
|
751 | |||
752 | return values |
|
752 | return values | |
753 |
|
753 | |||
754 |
def |
|
754 | def obsfateverb(successorset, markers): | |
755 | """ Return the verb summarizing the successorset |
|
755 | """ Return the verb summarizing the successorset and potentially using | |
|
756 | information from the markers | |||
756 | """ |
|
757 | """ | |
757 | if not successorset: |
|
758 | if not successorset: | |
758 | verb = 'pruned' |
|
759 | verb = 'pruned' | |
@@ -795,7 +796,7 b' def obsfateprinter(successors, markers, ' | |||||
795 | line = [] |
|
796 | line = [] | |
796 |
|
797 | |||
797 | # Verb |
|
798 | # Verb | |
798 |
line.append( |
|
799 | line.append(obsfateverb(successors, markers)) | |
799 |
|
800 | |||
800 | # Operations |
|
801 | # Operations | |
801 | operations = markersoperations(markers) |
|
802 | operations = markersoperations(markers) |
@@ -1005,17 +1005,18 b' def obsfateusers(context, mapping, args)' | |||||
1005 | "obsmakers") |
|
1005 | "obsmakers") | |
1006 | raise error.ParseError(msg) |
|
1006 | raise error.ParseError(msg) | |
1007 |
|
1007 | |||
1008 | @templatefunc('obsfateverb(successors)') |
|
1008 | @templatefunc('obsfateverb(successors, markers)') | |
1009 | def obsfateverb(context, mapping, args): |
|
1009 | def obsfateverb(context, mapping, args): | |
1010 | """Compute obsfate related information based on successors (EXPERIMENTAL)""" |
|
1010 | """Compute obsfate related information based on successors (EXPERIMENTAL)""" | |
1011 |
if len(args) != |
|
1011 | if len(args) != 2: | |
1012 | # i18n: "obsfateverb" is a keyword |
|
1012 | # i18n: "obsfateverb" is a keyword | |
1013 |
raise error.ParseError(_("obsfateverb expects o |
|
1013 | raise error.ParseError(_("obsfateverb expects two arguments")) | |
1014 |
|
1014 | |||
1015 | successors = evalfuncarg(context, mapping, args[0]) |
|
1015 | successors = evalfuncarg(context, mapping, args[0]) | |
|
1016 | markers = evalfuncarg(context, mapping, args[1]) | |||
1016 |
|
1017 | |||
1017 | try: |
|
1018 | try: | |
1018 |
return obsutil. |
|
1019 | return obsutil.obsfateverb(successors, markers) | |
1019 | except TypeError: |
|
1020 | except TypeError: | |
1020 | # i18n: "obsfateverb" is a keyword |
|
1021 | # i18n: "obsfateverb" is a keyword | |
1021 | errmsg = _("obsfateverb first argument should be countable") |
|
1022 | errmsg = _("obsfateverb first argument should be countable") |
@@ -13,7 +13,7 b' Global setup' | |||||
13 | > evolution=true |
|
13 | > evolution=true | |
14 | > [templates] |
|
14 | > [templates] | |
15 | > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}" |
|
15 | > obsfatesuccessors = "{if(successors, " as ")}{join(successors, ", ")}" | |
16 | > obsfateverb = "{obsfateverb(successors)}" |
|
16 | > obsfateverb = "{obsfateverb(successors, markers)}" | |
17 | > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}" |
|
17 | > obsfateoperations = "{if(obsfateoperations(markers), " using {join(obsfateoperations(markers), ", ")}")}" | |
18 | > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}" |
|
18 | > obsfateusers = "{if(obsfateusers(markers), " by {join(obsfateusers(markers), ", ")}")}" | |
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})")}")}" |
|
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