##// END OF EJS Templates
templatekw: convert list of key/value pairs to sortdict...
Yuya Nishihara -
r24237:9ad02823 default
parent child Browse files
Show More
@@ -241,7 +241,8 b' def showextras(**args):'
241 """:extras: List of dicts with key, value entries of the 'extras'
241 """:extras: List of dicts with key, value entries of the 'extras'
242 field of this changeset."""
242 field of this changeset."""
243 extras = args['ctx'].extra()
243 extras = args['ctx'].extra()
244 c = [{'key': x[0], 'value': x[1]} for x in sorted(extras.items())]
244 extras = util.sortdict((k, extras[k]) for k in sorted(extras))
245 c = [{'key': k, 'value': extras[k]} for k in extras]
245 f = _showlist('extra', c, plural='extras', **args)
246 f = _showlist('extra', c, plural='extras', **args)
246 return _hybrid(f, c, lambda x: '%s=%s' % (x['key'], x['value']))
247 return _hybrid(f, c, lambda x: '%s=%s' % (x['key'], x['value']))
247
248
@@ -267,7 +268,8 b' def showfilecopies(**args):'
267 if rename:
268 if rename:
268 copies.append((fn, rename[0]))
269 copies.append((fn, rename[0]))
269
270
270 c = [{'name': x[0], 'source': x[1]} for x in copies]
271 copies = util.sortdict(copies)
272 c = [{'name': k, 'source': copies[k]} for k in copies]
271 f = _showlist('file_copy', c, plural='file_copies', **args)
273 f = _showlist('file_copy', c, plural='file_copies', **args)
272 return _hybrid(f, c, lambda x: '%s (%s)' % (x['name'], x['source']))
274 return _hybrid(f, c, lambda x: '%s (%s)' % (x['name'], x['source']))
273
275
@@ -279,7 +281,8 b' def showfilecopiesswitch(**args):'
279 only if the --copied switch is set.
281 only if the --copied switch is set.
280 """
282 """
281 copies = args['revcache'].get('copies') or []
283 copies = args['revcache'].get('copies') or []
282 c = [{'name': x[0], 'source': x[1]} for x in copies]
284 copies = util.sortdict(copies)
285 c = [{'name': k, 'source': copies[k]} for k in copies]
283 f = _showlist('file_copy', c, plural='file_copies', **args)
286 f = _showlist('file_copy', c, plural='file_copies', **args)
284 return _hybrid(f, c, lambda x: '%s (%s)' % (x['name'], x['source']))
287 return _hybrid(f, c, lambda x: '%s (%s)' % (x['name'], x['source']))
285
288
General Comments 0
You need to be logged in to leave comments. Login now