##// END OF EJS Templates
templatekw: extract function that computes and caches file status
Yuya Nishihara -
r39633:16482756 default
parent child Browse files
Show More
@@ -291,12 +291,16 b' def showextras(context, mapping):'
291 291 return _hybrid(f, extras, makemap,
292 292 lambda k: '%s=%s' % (k, stringutil.escapestr(extras[k])))
293 293
294 def _showfilesbystat(context, mapping, name, index):
294 def _getfilestatus(context, mapping):
295 295 ctx = context.resource(mapping, 'ctx')
296 296 revcache = context.resource(mapping, 'revcache')
297 297 if 'files' not in revcache:
298 298 revcache['files'] = ctx.p1().status(ctx)[:3]
299 files = revcache['files'][index]
299 return revcache['files']
300
301 def _showfilesbystat(context, mapping, name, index):
302 stat = _getfilestatus(context, mapping)
303 files = stat[index]
300 304 return templateutil.compatfileslist(context, mapping, name, files)
301 305
302 306 @templatekeyword('file_adds', requires={'ctx', 'revcache'})
General Comments 0
You need to be logged in to leave comments. Login now