mercurial/templates/map-cmdline.default
author Durham Goode <durham@fb.com>
Fri, 05 Feb 2016 13:23:24 -0800
changeset 28000 d4247c306d82
parent 25514 9b1a8ce1f03b
child 30696 667d9c93c412
permissions -rw-r--r--
copies: optimize forward copy detection logic for rebases Forward copy detection (i.e. detecting what files have been moved/copied in commit X since ancestor Y) previously required diff'ing the manifests of both X and Y. This was expensive since it required reading both entire manifests and doing a set difference (they weren't already in a set because of the lazymanifest work). This cost almost 1 second on very large repositories, and happens N times for a rebase of N commits. This patch optimizes it for the case of rebase. In a rebase, we are comparing a commit against it's immediate parent, and therefore we can know what files changed by looking at ctx.files(). This lets us drastically decrease the size of the set comparison, and makes it O(# of changes) instead of O(size of manifest). This makes it take 1ms instead of 1000ms.
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'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     3
changeset = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{summary}\n'
24304
6136704b975d templates: fix "log -q" output of default style
Yuya Nishihara <yuya@tcha.org>
parents: 22766
diff changeset
     4
changeset_quiet = '{lnode}'
22766
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     5
changeset_verbose = '{cset}{branches}{bookmarks}{tags}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     6
changeset_debug = '{fullcset}{branches}{bookmarks}{tags}{lphase}{parents}{manifest}{user}{ldate}{lfile_mods}{lfile_adds}{lfile_dels}{lfile_copies_switch}{extras}{description}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     7
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     8
# File templates
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
     9
lfiles = '{if(files,
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    10
               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
    11
                     "files:       {files}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    12
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    13
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
    14
                  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
    15
                        "files:       {file_mods}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    16
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    17
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
    18
                  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
    19
                        "files+:      {file_adds}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    20
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    21
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
    22
                  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
    23
                        "files-:      {file_dels}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    24
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    25
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
    26
                           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
    27
                                 "copies:     {file_copies_switch
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    28
                                               % ' {name} ({source})'}\n"))}'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    29
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    30
# General templates
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    31
cset = '{label("log.changeset changeset.{phase}",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    32
               "changeset:   {rev}:{node|short}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    33
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    34
lphase = '{label("log.phase",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    35
                 "phase:       {phase}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    36
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    37
fullcset = '{label("log.changeset changeset.{phase}",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    38
                   "changeset:   {rev}:{node}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    39
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    40
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
    41
                  "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
    42
24304
6136704b975d templates: fix "log -q" output of default style
Yuya Nishihara <yuya@tcha.org>
parents: 22766
diff changeset
    43
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
    44
                "{rev}:{node|short}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    45
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    46
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
    47
                   "manifest:    {rev}:{node}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    48
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    49
branch = '{label("log.branch",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    50
                 "branch:      {branch}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    51
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    52
tag = '{label("log.tag",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    53
              "tag:         {tag}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    54
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    55
bookmark = '{label("log.bookmark",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    56
                   "bookmark:    {bookmark}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    57
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    58
user = '{label("log.user",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    59
               "user:        {author}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    60
24637
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    61
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
    62
                                   '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
    63
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    64
ldate = '{label("log.date",
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    65
                "date:        {date|date}")}\n'
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    66
0ded0f0b1c04 log: rewrite default template to use labels (issue2866)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 15907
diff changeset
    67
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
    68
                "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
    69
24637
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    70
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
    71
                                       'description:')}
c1cb6523e968 templates-default: do not show description or summary if empty
Yuya Nishihara <yuya@tcha.org>
parents: 24304
diff changeset
    72
                                {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
                                       '{desc|strip}')}\n\n")}'
25514
9b1a8ce1f03b templates: add a default template style for status
Matt Mackall <mpm@selenic.com>
parents: 24637
diff changeset
    74
9b1a8ce1f03b templates: add a default template style for status
Matt Mackall <mpm@selenic.com>
parents: 24637
diff changeset
    75
status = '{status} {path}\n{if(copy, "  {copy}\n")}'