##// END OF EJS Templates
run-tests: support per-line conditional output in tests...
run-tests: support per-line conditional output in tests Duplicating entire tests just because the output is different is both error prone and can make the tests harder to read. This harnesses the existing '(?)' infrastructure, both to improve readability, and because it seemed like the path of least resistance. The form is: $ test_cmd output (hghave-feature !) # required if hghave.has_feature(), else optional out2 (no-hghave-feature2 !) # req if not hghave.has_feature2(), else optional I originally extended the '(?)' syntax. For example, this: 2 r4/.hg/cache/checkisexec (execbit ?) pretty naturally reads as "checkisexec, if execbit". In some ways though, this inverts the meaning of '?'. For '(?)', the line is purely optional. In the example, it is mandatory iff execbit. Otherwise, it is carried forward as optional, to preserve the test output. I tried it the other way, (listing 'no-exec' in the example), but that is too confusing to read. Kostia suggested using '!', and that seems fine.

File last commit:

r31702:00f996f0 default
r31829:4eec2f04 default
Show More
map-cmdline.default
82 lines | 3.2 KiB | text/plain | TextLexer
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766 # Base templates. Due to name clashes with existing keywords, we have
# to replace some keywords with 'lkeyword', for 'labelled keyword'
Denis Laxalde
templates: display evolution "troubles" in command line style
r30713 changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{summary}\n'
Yuya Nishihara
templates: fix "log -q" output of default style...
r24304 changeset_quiet = '{lnode}'
Denis Laxalde
templates: display evolution "troubles" in command line style
r30713 changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{ltroubles}{lfiles}{lfile_copies_switch}{description}\n'
changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{ltroubles}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766
# File templates
lfiles = '{if(files,
label("ui.note log.files",
"files: {files}\n"))}'
lfile_mods = '{if(file_mods,
label("ui.debug log.files",
"files: {file_mods}\n"))}'
lfile_adds = '{if(file_adds,
label("ui.debug log.files",
"files+: {file_adds}\n"))}'
lfile_dels = '{if(file_dels,
label("ui.debug log.files",
"files-: {file_dels}\n"))}'
lfile_copies_switch = '{if(file_copies_switch,
label("ui.note log.copies",
"copies: {file_copies_switch
% ' {name} ({source})'}\n"))}'
# General templates
Denis Laxalde
templates: display evolution "troubles" in command line style
r30713 _trouble_label = 'trouble.{trouble}'
Denis Laxalde
templates: shorten definition of changeset labels in command-line style...
r31701 _troubles_labels = '{if(troubles, "changeset.troubled {troubles%_trouble_label}")}'
Denis Laxalde
templates: add "changeset.obsolete" label in command line style...
r31702 _obsolete_label = '{if(obsolete, "changeset.obsolete")}'
_cset_labels = '{separate(" ", "log.changeset", "changeset.{phase}", "{_obsolete_label}", "{_troubles_labels}")}'
Denis Laxalde
templates-default: factor out definition of changeset labels...
r30696 cset = '{label("{_cset_labels}",
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766 "changeset: {rev}:{node|short}")}\n'
lphase = '{label("log.phase",
"phase: {phase}")}\n'
Denis Laxalde
templates-default: factor out definition of changeset labels...
r30696 fullcset = '{label("{_cset_labels}",
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766 "changeset: {rev}:{node}")}\n'
parent = '{label("log.parent changeset.{phase}",
"parent: {rev}:{node|formatnode}")}\n'
Yuya Nishihara
templates: fix "log -q" output of default style...
r24304 lnode = '{label("log.node",
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766 "{rev}:{node|short}")}\n'
manifest = '{label("ui.debug log.manifest",
"manifest: {rev}:{node}")}\n'
branch = '{label("log.branch",
"branch: {branch}")}\n'
tag = '{label("log.tag",
"tag: {tag}")}\n'
bookmark = '{label("log.bookmark",
"bookmark: {bookmark}")}\n'
user = '{label("log.user",
"user: {author}")}\n'
Yuya Nishihara
templates-default: do not show description or summary if empty...
r24637 summary = '{if(desc|strip, "{label('log.summary',
'summary: {desc|firstline}')}\n")}'
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766
ldate = '{label("log.date",
"date: {date|date}")}\n'
Denis Laxalde
log: drop unnecessary ui.note label from "trouble: " line...
r30720 ltroubles = '{if(troubles, "{label('log.trouble',
Denis Laxalde
templates: display evolution "troubles" in command line style
r30713 'trouble: {join(troubles, ", ")}')}\n")}'
Jordi Gutiérrez Hermoso
log: rewrite default template to use labels (issue2866)...
r22766 extra = '{label("ui.debug log.extra",
"extra: {key}={value|stringescape}")}\n'
Yuya Nishihara
templates-default: do not show description or summary if empty...
r24637 description = '{if(desc|strip, "{label('ui.note log.description',
'description:')}
{label('ui.note log.description',
'{desc|strip}')}\n\n")}'
Matt Mackall
templates: add a default template style for status...
r25514
status = '{status} {path}\n{if(copy, " {copy}\n")}'