##// END OF EJS Templates
templatekw: factor out function to build a list of files per status...
Yuya Nishihara -
r36532:e71a3c0a default
parent child Browse files
Show More
@@ -464,13 +464,16 b' def showextras(**args):'
464 464 return _hybrid(f, extras, makemap,
465 465 lambda k: '%s=%s' % (k, util.escapestr(extras[k])))
466 466
467 def _showfilesbystat(args, name, index):
468 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
469 files = getfiles(repo, ctx, revcache)[index]
470 return showlist(name, files, args, element='file')
471
467 472 @templatekeyword('file_adds')
468 473 def showfileadds(**args):
469 474 """List of strings. Files added by this changeset."""
470 475 args = pycompat.byteskwargs(args)
471 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
472 return showlist('file_add', getfiles(repo, ctx, revcache)[1], args,
473 element='file')
476 return _showfilesbystat(args, 'file_add', 1)
474 477
475 478 @templatekeyword('file_copies')
476 479 def showfilecopies(**args):
@@ -512,17 +515,13 b' def showfilecopiesswitch(**args):'
512 515 def showfiledels(**args):
513 516 """List of strings. Files removed by this changeset."""
514 517 args = pycompat.byteskwargs(args)
515 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
516 return showlist('file_del', getfiles(repo, ctx, revcache)[2], args,
517 element='file')
518 return _showfilesbystat(args, 'file_del', 2)
518 519
519 520 @templatekeyword('file_mods')
520 521 def showfilemods(**args):
521 522 """List of strings. Files modified by this changeset."""
522 523 args = pycompat.byteskwargs(args)
523 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
524 return showlist('file_mod', getfiles(repo, ctx, revcache)[0], args,
525 element='file')
524 return _showfilesbystat(args, 'file_mod', 0)
526 525
527 526 @templatekeyword('files')
528 527 def showfiles(**args):
General Comments 0
You need to be logged in to leave comments. Login now