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 (10 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 |
| 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} | ||||
| def _showfilesbystat(context, mapping, name, index): | def _showfilesbystat(context, mapping, name, index): | ||||
| stat = _getfilestatus(context, mapping) | stat = _getfilestatus(context, mapping) | ||||
| files = stat[index] | files = stat[index] | ||||
| return templateutil.compatfileslist(context, mapping, name, files) | return templateutil.compatfileslist(context, mapping, name, files) | ||||
| @templatekeyword('file_adds', requires={'ctx', 'revcache'}) | |||||
| def showfileadds(context, mapping): | |||||
| """List of strings. Files added by this changeset.""" | |||||
| return _showfilesbystat(context, mapping, 'file_add', 1) | |||||
| @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.""" | |||||
| return _showfilesbystat(context, mapping, 'file_add', 1) | |||||
| @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.""" | ||||
| return _showfilesbystat(context, mapping, 'file_del', 2) | return _showfilesbystat(context, mapping, 'file_del', 2) | ||||
| @templatekeyword('file_mods', requires={'ctx', 'revcache'}) | @templatekeyword('file_mods', requires={'ctx', 'revcache'}) | ||||
| def showfilemods(context, mapping): | def showfilemods(context, mapping): | ||||
| """List of strings. Files modified by this changeset.""" | """List of strings. Files modified by this changeset.""" | ||||