mercurial/templates/map-cmdline.phases
author Martin von Zweigbergk <martinvonz@google.com>
Thu, 19 Mar 2015 11:08:42 -0700
changeset 24401 e6e023d57e94
parent 22768 66bf251ee672
child 24493 e810c7da1cae
permissions -rw-r--r--
treemanifest: create treemanifest class There are a number of problems with large and flat manifests. Copying from http://mercurial.selenic.com/wiki/ManifestShardingPlan: * manifest too large for RAM * manifest resolution too much CPU (long delta chains) * committing is slow because entire manifest has to be hashed * impossible for narrow clone to leave out part of manifest as all is needed to calculate new hash * diffing two revisions involves traversing entire subdirectories even if identical This is a first step in a series introducing a manifest revlog per directory. This change adds a new manifest class: treemanifest, which is a tree where each node has a dict of files (nodeids), a dict of flags, and a dict of subdirectories (treemanifests). So far, it behaves just like manifestdict, but it will later help us write one manifest revlog per directory. The new class is still unused; it will be used after the next change. The code is not yet optimized. Running with it (see below) makes most or all operations slower. Once we start storing manifest revlogs for every directory, it should be possible to make many of these operations much faster. The fastdelta() optimization has been intentionally not implemented for the treemanifests. We can implement it later if necessary. All tests pass when run with the following patch (and without, of couse): --- a/mercurial/manifest.py Thu Mar 19 11:08:42 2015 -0700 +++ b/mercurial/manifest.py Thu Mar 19 11:15:50 2015 -0700 @@ -596,7 +596,7 @@ class manifest(revlog.revlog): return None, None def add(self, m, transaction, link, p1, p2, added, removed): - if p1 in self._mancache: + if False and p1 in self._mancache: # If our first parent is in the manifest cache, we can # compute a delta here using properties we know about the # manifest up-front, which may save time later for the @@ -626,3 +626,5 @@ class manifest(revlog.revlog): self._mancache[n] = (m, arraytext) return n + +manifestdict = treemanifest
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22767
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     1
# Base templates. Due to name clashes with existing keywords, we have
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     2
# to replace some keywords with 'lkeyword', for 'labelled keyword'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     3
changeset = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{summary}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     4
changeset_quiet = '{node}'
22768
66bf251ee672 log: show phase in hg log -v with the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 22767
diff changeset
     5
changeset_verbose = '{cset}{branches}{bookmarks}{tags}{lphase}{parents}{user}{ldate}{lfiles}{lfile_copies_switch}{description}\n'
22767
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
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'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     7
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     8
# File templates
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
     9
lfiles = '{if(files,
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    10
               label("ui.note log.files",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    11
                     "files:       {files}\n"))}'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    12
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    13
lfile_mods = '{if(file_mods,
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    14
                  label("ui.debug log.files",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    15
                        "files:       {file_mods}\n"))}'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    16
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    17
lfile_adds = '{if(file_adds,
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    18
                  label("ui.debug log.files",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    19
                        "files+:      {file_adds}\n"))}'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    20
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    21
lfile_dels = '{if(file_dels,
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    22
                  label("ui.debug log.files",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    23
                        "files-:      {file_dels}\n"))}'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    24
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    25
lfile_copies_switch = '{if(file_copies_switch,
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    26
                           label("ui.note log.copies",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    27
                                 "copies:     {file_copies_switch
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    28
                                               % ' {name} ({source})'}\n"))}'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    29
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    30
# General templates
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    31
cset = '{label("log.changeset changeset.{phase}",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    32
               "changeset:   {rev}:{node|short}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    33
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    34
lphase = '{label("log.phase",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    35
                 "phase:       {phase}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    36
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    37
fullcset = '{label("log.changeset changeset.{phase}",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    38
                   "changeset:   {rev}:{node}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    39
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    40
parent = '{label("log.parent changeset.{phase}",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    41
                  "parent:      {rev}:{node|formatnode}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    42
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    43
node = '{label("log.node",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    44
                "{rev}:{node|short}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    45
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    46
manifest = '{label("ui.debug log.manifest",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    47
                   "manifest:    {rev}:{node}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    48
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    49
branch = '{label("log.branch",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    50
                 "branch:      {branch}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    51
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    52
tag = '{label("log.tag",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    53
              "tag:         {tag}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    54
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    55
bookmark = '{label("log.bookmark",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    56
                   "bookmark:    {bookmark}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    57
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    58
user = '{label("log.user",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    59
               "user:        {author}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    60
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    61
summary = '{label("log.summary",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    62
                  "summary:     {desc|firstline}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    63
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    64
ldate = '{label("log.date",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    65
                "date:        {date|date}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    66
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    67
extra = '{label("ui.debug log.extra",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    68
                "extra:       {key}={value|stringescape}")}\n'
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    69
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    70
description = '{label("ui.note log.description",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    71
                       "description:")}
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    72
               {label("ui.note log.description",
9579034d9eb2 log: add labels to the phase template
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 19126
diff changeset
    73
                       "{desc|strip}")}\n\n'