##// 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 return _hybrid(f, extras, makemap,
464 return _hybrid(f, extras, makemap,
465 lambda k: '%s=%s' % (k, util.escapestr(extras[k])))
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 @templatekeyword('file_adds')
472 @templatekeyword('file_adds')
468 def showfileadds(**args):
473 def showfileadds(**args):
469 """List of strings. Files added by this changeset."""
474 """List of strings. Files added by this changeset."""
470 args = pycompat.byteskwargs(args)
475 args = pycompat.byteskwargs(args)
471 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
476 return _showfilesbystat(args, 'file_add', 1)
472 return showlist('file_add', getfiles(repo, ctx, revcache)[1], args,
473 element='file')
474
477
475 @templatekeyword('file_copies')
478 @templatekeyword('file_copies')
476 def showfilecopies(**args):
479 def showfilecopies(**args):
@@ -512,17 +515,13 b' def showfilecopiesswitch(**args):'
512 def showfiledels(**args):
515 def showfiledels(**args):
513 """List of strings. Files removed by this changeset."""
516 """List of strings. Files removed by this changeset."""
514 args = pycompat.byteskwargs(args)
517 args = pycompat.byteskwargs(args)
515 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
518 return _showfilesbystat(args, 'file_del', 2)
516 return showlist('file_del', getfiles(repo, ctx, revcache)[2], args,
517 element='file')
518
519
519 @templatekeyword('file_mods')
520 @templatekeyword('file_mods')
520 def showfilemods(**args):
521 def showfilemods(**args):
521 """List of strings. Files modified by this changeset."""
522 """List of strings. Files modified by this changeset."""
522 args = pycompat.byteskwargs(args)
523 args = pycompat.byteskwargs(args)
523 repo, ctx, revcache = args['repo'], args['ctx'], args['revcache']
524 return _showfilesbystat(args, 'file_mod', 0)
524 return showlist('file_mod', getfiles(repo, ctx, revcache)[0], args,
525 element='file')
526
525
527 @templatekeyword('files')
526 @templatekeyword('files')
528 def showfiles(**args):
527 def showfiles(**args):
General Comments 0
You need to be logged in to leave comments. Login now