Skip to content
Snippets Groups Projects
Commit de7e6c48 authored by Matthew Turk's avatar Matthew Turk
Browse files

template: modify showextras to return a hybrid

This modifies slightly the behavior introduced in 519120a96c63 to allow
showextras to return a hybrid, rather than showlist.  The example in the
template help file now executes and returns meaningful results.
parent 04036798
Branches
Tags
No related merge requests found
......@@ -222,8 +222,10 @@
def showextras(**args):
""":extras: List of dicts with key, value entries of the 'extras'
field of this changeset."""
yield showlist('extra', sorted(dict(key=a, value=b)
for (a, b) in args['ctx'].extra().items()), **args)
extras = args['ctx'].extra()
c = [{'key': x[0], 'value': x[1]} for x in sorted(extras.items())]
f = _showlist('extra', c, plural='extras', **args)
return _hybrid(f, c, lambda x: '%s=%s' % (x['key'], x['value']))
def showfileadds(**args):
""":file_adds: List of strings. Files added by this changeset."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment