Details
Details
- Reviewers
pulkit - Group Reviewers
hg-reviewers - Commits
- rHGb47e9712000b: templatekw: move showfileadds() close to showfile{mods,dels}()
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Lint
Lint Skipped - Unit
Unit Tests Skipped
pulkit |
hg-reviewers |
Lint Skipped |
Unit Tests Skipped |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/templatekw.py (14 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
Martin von Zweigbergk | May 11 2019, 3:17 AM |
Status | Author | Revision | |
---|---|---|---|
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
revcache = context.resource(mapping, 'revcache') | revcache = context.resource(mapping, 'revcache') | ||||
if 'filestatusmap' not in revcache or revcache['filestatusall'] < listall: | if 'filestatusmap' not in revcache or revcache['filestatusall'] < listall: | ||||
stat = _getfilestatus(context, mapping, listall=listall) | stat = _getfilestatus(context, mapping, listall=listall) | ||||
revcache['filestatusmap'] = statmap = {} | revcache['filestatusmap'] = statmap = {} | ||||
for char, files in zip(pycompat.iterbytestr('MAR!?IC'), stat): | for char, files in zip(pycompat.iterbytestr('MAR!?IC'), stat): | ||||
statmap.update((f, char) for f in files) | statmap.update((f, char) for f in files) | ||||
return revcache['filestatusmap'] # {path: statchar} | return revcache['filestatusmap'] # {path: statchar} | ||||
@templatekeyword('file_adds', requires={'ctx', 'revcache'}) | |||||
def showfileadds(context, mapping): | |||||
"""List of strings. Files added by this changeset.""" | |||||
ctx = context.resource(mapping, 'ctx') | |||||
return templateutil.compatfileslist(context, mapping, 'file_add', | |||||
ctx.added()) | |||||
@templatekeyword('file_copies', | @templatekeyword('file_copies', | ||||
requires={'repo', 'ctx', 'cache', 'revcache'}) | requires={'repo', 'ctx', 'cache', 'revcache'}) | ||||
def showfilecopies(context, mapping): | def showfilecopies(context, mapping): | ||||
"""List of strings. Files copied in this changeset with | """List of strings. Files copied in this changeset with | ||||
their sources. | their sources. | ||||
""" | """ | ||||
repo = context.resource(mapping, 'repo') | repo = context.resource(mapping, 'repo') | ||||
ctx = context.resource(mapping, 'ctx') | ctx = context.resource(mapping, 'ctx') | ||||
def showfilecopiesswitch(context, mapping): | def showfilecopiesswitch(context, mapping): | ||||
"""List of strings. Like "file_copies" but displayed | """List of strings. Like "file_copies" but displayed | ||||
only if the --copied switch is set. | only if the --copied switch is set. | ||||
""" | """ | ||||
copies = context.resource(mapping, 'revcache').get('copies') or [] | copies = context.resource(mapping, 'revcache').get('copies') or [] | ||||
return templateutil.compatfilecopiesdict(context, mapping, 'file_copy', | return templateutil.compatfilecopiesdict(context, mapping, 'file_copy', | ||||
copies) | copies) | ||||
@templatekeyword('file_adds', requires={'ctx', 'revcache'}) | |||||
def showfileadds(context, mapping): | |||||
"""List of strings. Files added by this changeset.""" | |||||
ctx = context.resource(mapping, 'ctx') | |||||
return templateutil.compatfileslist(context, mapping, 'file_add', | |||||
ctx.added()) | |||||
@templatekeyword('file_dels', requires={'ctx', 'revcache'}) | @templatekeyword('file_dels', requires={'ctx', 'revcache'}) | ||||
def showfiledels(context, mapping): | def showfiledels(context, mapping): | ||||
"""List of strings. Files removed by this changeset.""" | """List of strings. Files removed by this changeset.""" | ||||
ctx = context.resource(mapping, 'ctx') | ctx = context.resource(mapping, 'ctx') | ||||
return templateutil.compatfileslist(context, mapping, 'file_del', | return templateutil.compatfileslist(context, mapping, 'file_del', | ||||
ctx.removed()) | ctx.removed()) | ||||
@templatekeyword('file_mods', requires={'ctx', 'revcache'}) | @templatekeyword('file_mods', requires={'ctx', 'revcache'}) |