mercurial/templates/map-cmdline.default
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 16 Oct 2019 17:49:30 +0200
changeset 43254 181d28ba05da
parent 39370 46f3ff64bea7
permissions -rw-r--r--
copies: avoid instancing more changectx to access parent revisions We just need to know the revision numbers of the parents, creating full context is needlessly expensive. This provide a small, but noticeable performance boost. revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 before: ! wall 2.885636 comb 2.900000 user 2.870000 sys 0.030000 (median of 10) after: ! wall 2.702270 comb 2.710000 user 2.690000 sys 0.020000 (median of 10) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 before: ! wall 4.298271 comb 4.290000 user 4.240000 sys 0.050000 (median of 10) after: ! wall 3.976610 comb 3.970000 user 3.920000 sys 0.050000 (median of 10) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 before: ! wall 0.773397 comb 0.770000 user 0.770000 sys 0.000000 (median of 11) after: ! wall 0.701634 comb 0.700000 user 0.700000 sys 0.000000 (median of 13) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f before: ! wall 0.013585 comb 0.010000 user 0.010000 sys 0.000000 (median of 217) after: ! wall 0.013550 comb 0.010000 user 0.010000 sys 0.000000 (median of 218) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 before: ! wall 0.003202 comb 0.000000 user 0.000000 sys 0.000000 (median of 929) after: ! wall 0.002993 comb 0.010000 user 0.010000 sys 0.000000 (median of 992) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e before: ! wall 0.000077 comb 0.000000 user 0.000000 sys 0.000000 (median of 12060) after: ! wall 0.000072 comb 0.000000 user 0.000000 sys 0.000000 (median of 12804) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe before: ! wall 0.510614 comb 0.500000 user 0.500000 sys 0.000000 (median of 18) after: ! wall 0.473681 comb 0.470000 user 0.470000 sys 0.000000 (median of 20) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d before: ! wall 0.126552 comb 0.130000 user 0.130000 sys 0.000000 (median of 77) after: ! wall 0.115240 comb 0.110000 user 0.110000 sys 0.000000 (median of 85) Differential Revision: https://phab.mercurial-scm.org/D7122
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     1
# Base templates. Due to name clashes with existing keywords, we have
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     2
# to replace some keywords with 'lkeyword', for 'labelled keyword'
34714
f4aeb952ab77 templater: load template fragments from [templates] section in map file
Yuya Nishihara <yuya@tcha.org>
parents: 33783
diff changeset
     3
f4aeb952ab77 templater: load template fragments from [templates] section in map file
Yuya Nishihara <yuya@tcha.org>
parents: 33783
diff changeset
     4
[templates]
38947
f9a98075a37e templates: rename "user" to "luser" defined in default map file (API)
Yuya Nishihara <yuya@tcha.org>
parents: 34901
diff changeset
     5
changeset = '{cset}{branches}{bookmarks}{tags}{parents}{luser}{ldate}{ltroubles}{lobsfate}{summary}\n'
24304
6136704b975d templates: fix "log -q" output of default style
Yuya Nishihara <yuya@tcha.org>
parents: 22766
diff changeset
     6
changeset_quiet = '{lnode}'
38947
f9a98075a37e templates: rename "user" to "luser" defined in default map file (API)
Yuya Nishihara <yuya@tcha.org>
parents: 34901
diff changeset
     7
changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{luser}{ldate}{ltroubles}{lobsfate}{lfiles}{lfile_copies_switch}{description}\n'
f9a98075a37e templates: rename "user" to "luser" defined in default map file (API)
Yuya Nishihara <yuya@tcha.org>
parents: 34901
diff changeset
     8
changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{luser}{ldate}{ltroubles}{lobsfate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     9
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    10
# File templates
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    11
lfiles = '{if(files,
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    12
               label("ui.note log.files",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    13
                     "files:       {files}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    14
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    15
lfile_mods = '{if(file_mods,
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    16
                  label("ui.debug log.files",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    17
                        "files:       {file_mods}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    18
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    19
lfile_adds = '{if(file_adds,
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    20
                  label("ui.debug log.files",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    21
                        "files+:      {file_adds}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    22
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    23
lfile_dels = '{if(file_dels,
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    24
                  label("ui.debug log.files",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    25
                        "files-:      {file_dels}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    26
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    27
lfile_copies_switch = '{if(file_copies_switch,
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    28
                           label("ui.note log.copies",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    29
                                 "copies:     {file_copies_switch
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    30
                                               % ' {name} ({source})'}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    31
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    32
# General templates
34716
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    33
cset = '{labelcset("changeset:   {rev}:{node|short}")}\n'
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    34
fullcset = '{labelcset("changeset:   {rev}:{node}")}\n'
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    35
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    36
lphase = '{label("log.phase",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    37
                 "phase:       {phase}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    38
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    39
parent = '{label("log.parent changeset.{phase}",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    40
                  "parent:      {rev}:{node|formatnode}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    41
24304
6136704b975d templates: fix "log -q" output of default style
Yuya Nishihara <yuya@tcha.org>
parents: 22766
diff changeset
    42
lnode = '{label("log.node",
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    43
                "{rev}:{node|short}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    44
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    45
manifest = '{label("ui.debug log.manifest",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    46
                   "manifest:    {rev}:{node}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    47
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    48
branch = '{label("log.branch",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    49
                 "branch:      {branch}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    50
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    51
tag = '{label("log.tag",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    52
              "tag:         {tag}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    53
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    54
bookmark = '{label("log.bookmark",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    55
                   "bookmark:    {bookmark}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    56
38947
f9a98075a37e templates: rename "user" to "luser" defined in default map file (API)
Yuya Nishihara <yuya@tcha.org>
parents: 34901
diff changeset
    57
luser = '{label("log.user",
f9a98075a37e templates: rename "user" to "luser" defined in default map file (API)
Yuya Nishihara <yuya@tcha.org>
parents: 34901
diff changeset
    58
                "user:        {author}")}\n'
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    59
24637
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    60
summary = '{if(desc|strip, "{label('log.summary',
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    61
                                   'summary:     {desc|firstline}')}\n")}'
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    62
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    63
ldate = '{label("log.date",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    64
                "date:        {date|date}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    65
33783
db6b666ce1e6 label: rename log.trouble into log.instability
Boris Feld <boris.feld@octobus.net>
parents: 33782
diff changeset
    66
ltroubles = '{if(instabilities, "{label('log.instability',
33709
511d6ae462f3 template: rename troubles templatekw into instabilities
Boris Feld <boris.feld@octobus.net>
parents: 31702
diff changeset
    67
                                   'instability: {join(instabilities, ", ")}')}\n")}'
30713
6d0b1a69f98c templates: display evolution "troubles" in command line style
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 30696
diff changeset
    68
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    69
extra = '{label("ui.debug log.extra",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    70
                "extra:       {key}={value|stringescape}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    71
24637
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    72
description = '{if(desc|strip, "{label('ui.note log.description',
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    73
                                       'description:')}
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    74
                                {label('ui.note log.description',
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    75
                                       '{desc|strip}')}\n\n")}'
25514
9b1a8ce1f03b templates: add a default template style for status
Matt Mackall <mpm@selenic.com>
parents: 24637
diff changeset
    76
39370
46f3ff64bea7 status: rename {copy} to {source} for compatibility with {file_copies} (BC)
Yuya Nishihara <yuya@tcha.org>
parents: 39369
diff changeset
    77
status = '{status} {path|relpath}\n{if(source, "  {source|relpath}\n")}'
34716
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    78
34853
962f7df21a73 obsfate: add obsfate to default mapfile
Boris Feld <boris.feld@octobus.net>
parents: 34717
diff changeset
    79
# Obsfate templates, it would be removed once we introduce the obsfate
962f7df21a73 obsfate: add obsfate to default mapfile
Boris Feld <boris.feld@octobus.net>
parents: 34717
diff changeset
    80
# template fragment
34901
ec765a71bd65 obsfate: rename obsfate into obsolete in default mapfile
Boris Feld <boris.feld@octobus.net>
parents: 34853
diff changeset
    81
lobsfate = '{if(obsfate, "{label('log.obsfate', '{obsfate % "obsolete:    {fate}\n"}')}")}'
34853
962f7df21a73 obsfate: add obsfate to default mapfile
Boris Feld <boris.feld@octobus.net>
parents: 34717
diff changeset
    82
34716
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    83
[templatealias]
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    84
labelcset(expr) = label(separate(" ",
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    85
                                 "log.changeset",
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    86
                                 "changeset.{phase}",
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    87
                                 if(obsolete, "changeset.obsolete"),
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    88
                                 if(instabilities, "changeset.unstable"),
34717
06b52671552b templates: fix missed space between instability labels
Yuya Nishihara <yuya@tcha.org>
parents: 34716
diff changeset
    89
                                 join(instabilities
06b52671552b templates: fix missed space between instability labels
Yuya Nishihara <yuya@tcha.org>
parents: 34716
diff changeset
    90
                                      % "instability.{instability}", " ")),
34716
d36a36ca7bc2 templates: introduce labelcset() function in map-cmdline.default as example
Yuya Nishihara <yuya@tcha.org>
parents: 34714
diff changeset
    91
                        expr)