tests/test-upgrade-repo.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 02 Apr 2018 16:24:57 -0700
changeset 37281 806b07d7c7d6
parent 36373 0147a4730420
child 37338 cbc4425e81b5
permissions -rw-r--r--
tests: use debugdeltachain where appropriate Some tests are verifying delta chain type things. This metadata has more to do with a revlog implementation details than index data, which is theoretically generic. This commit ports some tests to `hg debugdeltachain`, as it is the more appropriate debug command for looking at delta metadata. Differential Revision: https://phab.mercurial-scm.org/D3026
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
30775
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     1
  $ cat >> $HGRCPATH << EOF
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     2
  > [extensions]
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     3
  > share =
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     4
  > EOF
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     5
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     6
store and revlogv1 are required in source
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     7
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     8
  $ hg --config format.usestore=false init no-store
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
     9
  $ hg -R no-store debugupgraderepo
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    10
  abort: cannot upgrade repository; requirement missing: store
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    11
  [255]
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    12
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    13
  $ hg init no-revlogv1
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    14
  $ cat > no-revlogv1/.hg/requires << EOF
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    15
  > dotencode
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    16
  > fncache
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    17
  > generaldelta
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    18
  > store
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    19
  > EOF
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    20
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    21
  $ hg -R no-revlogv1 debugupgraderepo
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    22
  abort: cannot upgrade repository; requirement missing: revlogv1
30774
eaa5607132a2 debugcommands: stub for debugupgraderepo command
Gregory Szorc <gregory.szorc@gmail.com>
parents:
diff changeset
    23
  [255]
30775
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    24
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    25
Cannot upgrade shared repositories
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    26
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    27
  $ hg init share-parent
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    28
  $ hg -q share share-parent share-child
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    29
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    30
  $ hg -R share-child debugupgraderepo
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    31
  abort: cannot upgrade repository; unsupported source requirement: shared
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    32
  [255]
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    33
36373
0147a4730420 cleanup: say goodbye to manifestv2 format
Augie Fackler <augie@google.com>
parents: 35378
diff changeset
    34
Do not yet support upgrading treemanifest repos
30775
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    35
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    36
  $ hg --config experimental.treemanifest=true init treemanifest
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    37
  $ hg -R treemanifest debugupgraderepo
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    38
  abort: cannot upgrade repository; unsupported source requirement: treemanifest
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    39
  [255]
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    40
36373
0147a4730420 cleanup: say goodbye to manifestv2 format
Augie Fackler <augie@google.com>
parents: 35378
diff changeset
    41
Cannot add treemanifest requirement during upgrade
30775
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    42
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    43
  $ hg init disallowaddedreq
36373
0147a4730420 cleanup: say goodbye to manifestv2 format
Augie Fackler <augie@google.com>
parents: 35378
diff changeset
    44
  $ hg -R disallowaddedreq --config experimental.treemanifest=true debugupgraderepo
0147a4730420 cleanup: say goodbye to manifestv2 format
Augie Fackler <augie@google.com>
parents: 35378
diff changeset
    45
  abort: cannot upgrade repository; do not support adding requirement: treemanifest
30775
513d68a90398 repair: implement requirements checking for upgrades
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30774
diff changeset
    46
  [255]
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
    47
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
    48
An upgrade of a repository created with recommended settings only suggests optimizations
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
    49
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
    50
  $ hg init empty
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
    51
  $ cd empty
35336
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
    52
  $ hg debugformat
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
    53
  format-variant repo
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
    54
  fncache:        yes
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
    55
  dotencode:      yes
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
    56
  generaldelta:   yes
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
    57
  plain-cl-delta: yes
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
    58
  compression:    zlib
35337
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    59
  $ hg debugformat --verbose
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    60
  format-variant repo config default
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    61
  fncache:        yes    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    62
  dotencode:      yes    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    63
  generaldelta:   yes    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    64
  plain-cl-delta: yes    yes     yes
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
    65
  compression:    zlib   zlib    zlib
35337
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    66
  $ hg debugformat --verbose --config format.usegfncache=no
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    67
  format-variant repo config default
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    68
  fncache:        yes    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    69
  dotencode:      yes    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    70
  generaldelta:   yes    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
    71
  plain-cl-delta: yes    yes     yes
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
    72
  compression:    zlib   zlib    zlib
35338
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
    73
  $ hg debugformat --verbose --config format.usegfncache=no --color=debug
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
    74
  format-variant repo config default
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
    75
  [formatvariant.name.uptodate|fncache:       ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
    76
  [formatvariant.name.uptodate|dotencode:     ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
    77
  [formatvariant.name.uptodate|generaldelta:  ][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
    78
  [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
    79
  [formatvariant.name.uptodate|compression:   ][formatvariant.repo.uptodate| zlib][formatvariant.config.default|   zlib][formatvariant.default|    zlib]
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    80
  $ hg debugformat -Tjson
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    81
  [
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    82
   {
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    83
    "config": true,
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    84
    "default": true,
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    85
    "name": "fncache",
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    86
    "repo": true
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    87
   },
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    88
   {
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    89
    "config": true,
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    90
    "default": true,
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    91
    "name": "dotencode",
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    92
    "repo": true
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    93
   },
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    94
   {
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    95
    "config": true,
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    96
    "default": true,
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    97
    "name": "generaldelta",
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
    98
    "repo": true
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
    99
   },
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   100
   {
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
   101
    "config": true,
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
   102
    "default": true,
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   103
    "name": "plain-cl-delta",
35378
9144e898cad5 debugformat: embed raw values in JSON and template output
Yuya Nishihara <yuya@tcha.org>
parents: 35377
diff changeset
   104
    "repo": true
35377
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   105
   },
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   106
   {
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   107
    "config": "zlib",
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   108
    "default": "zlib",
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   109
    "name": "compression",
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   110
    "repo": "zlib"
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   111
   }
c0b6fa74e007 debugformat: flush formatter output per item
Yuya Nishihara <yuya@tcha.org>
parents: 35363
diff changeset
   112
  ]
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   113
  $ hg debugupgraderepo
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   114
  (no feature deficiencies found in existing repository)
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   115
  performing an upgrade with "--run" will make the following changes:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   116
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   117
  requirements
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   118
     preserved: dotencode, fncache, generaldelta, revlogv1, store
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   119
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   120
  additional optimizations are available by specifying "--optimize <name>":
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   121
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   122
  redeltaparent
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   123
     deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   124
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   125
  redeltamultibase
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   126
     deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   127
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   128
  redeltaall
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   129
     deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   130
  
35345
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   131
  redeltafulladd
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   132
     every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   133
  
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   134
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   135
--optimize can be used to add optimizations
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   136
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   137
  $ hg debugupgrade --optimize redeltaparent
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   138
  (no feature deficiencies found in existing repository)
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   139
  performing an upgrade with "--run" will make the following changes:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   140
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   141
  requirements
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   142
     preserved: dotencode, fncache, generaldelta, revlogv1, store
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   143
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   144
  redeltaparent
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   145
     deltas within internal storage will choose a new base revision if needed
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   146
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   147
  additional optimizations are available by specifying "--optimize <name>":
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   148
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   149
  redeltamultibase
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   150
     deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   151
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   152
  redeltaall
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   153
     deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   154
  
35345
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   155
  redeltafulladd
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   156
     every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   157
  
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   158
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   159
Various sub-optimal detections work
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   160
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   161
  $ cat > .hg/requires << EOF
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   162
  > revlogv1
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   163
  > store
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   164
  > EOF
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   165
35336
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
   166
  $ hg debugformat
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
   167
  format-variant repo
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
   168
  fncache:         no
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
   169
  dotencode:       no
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
   170
  generaldelta:    no
c3e4f196b6e0 debugformat: add a 'debugformat' command
Boris Feld <boris.feld@octobus.net>
parents: 35303
diff changeset
   171
  plain-cl-delta: yes
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
   172
  compression:    zlib
35337
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   173
  $ hg debugformat --verbose
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   174
  format-variant repo config default
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   175
  fncache:         no    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   176
  dotencode:       no    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   177
  generaldelta:    no    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   178
  plain-cl-delta: yes    yes     yes
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
   179
  compression:    zlib   zlib    zlib
35337
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   180
  $ hg debugformat --verbose --config format.usegeneraldelta=no
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   181
  format-variant repo config default
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   182
  fncache:         no    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   183
  dotencode:       no    yes     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   184
  generaldelta:    no     no     yes
cfb403b92f43 debugformat: add data about the config when verbose
Boris Feld <boris.feld@octobus.net>
parents: 35336
diff changeset
   185
  plain-cl-delta: yes    yes     yes
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
   186
  compression:    zlib   zlib    zlib
35338
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
   187
  $ hg debugformat --verbose --config format.usegeneraldelta=no --color=debug
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
   188
  format-variant repo config default
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
   189
  [formatvariant.name.mismatchconfig|fncache:       ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
   190
  [formatvariant.name.mismatchconfig|dotencode:     ][formatvariant.repo.mismatchconfig|  no][formatvariant.config.default|    yes][formatvariant.default|     yes]
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
   191
  [formatvariant.name.mismatchdefault|generaldelta:  ][formatvariant.repo.mismatchdefault|  no][formatvariant.config.special|     no][formatvariant.default|     yes]
bd326f3e0e14 debugformat: update label depending on value difference
Boris Feld <boris.feld@octobus.net>
parents: 35337
diff changeset
   192
  [formatvariant.name.uptodate|plain-cl-delta:][formatvariant.repo.uptodate| yes][formatvariant.config.default|    yes][formatvariant.default|     yes]
35340
ead01b74be04 upgrade: register compression as a format variants
Boris Feld <boris.feld@octobus.net>
parents: 35338
diff changeset
   193
  [formatvariant.name.uptodate|compression:   ][formatvariant.repo.uptodate| zlib][formatvariant.config.default|   zlib][formatvariant.default|    zlib]
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   194
  $ hg debugupgraderepo
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   195
  repository lacks features recommended by current config options:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   196
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   197
  fncache
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   198
     long and reserved filenames may not work correctly; repository performance is sub-optimal
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   199
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   200
  dotencode
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   201
     storage of filenames beginning with a period or space may not work correctly
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   202
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   203
  generaldelta
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   204
     deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   205
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   206
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   207
  performing an upgrade with "--run" will make the following changes:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   208
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   209
  requirements
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   210
     preserved: revlogv1, store
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   211
     added: dotencode, fncache, generaldelta
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   212
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   213
  fncache
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   214
     repository will be more resilient to storing certain paths and performance of certain operations should be improved
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   215
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   216
  dotencode
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   217
     repository will be better able to store files beginning with a space or period
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   218
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   219
  generaldelta
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   220
     repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   221
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   222
  additional optimizations are available by specifying "--optimize <name>":
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   223
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   224
  redeltaparent
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   225
     deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   226
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   227
  redeltamultibase
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   228
     deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   229
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   230
  redeltaall
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   231
     deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   232
  
35345
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   233
  redeltafulladd
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   234
     every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   235
  
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   236
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   237
  $ hg --config format.dotencode=false debugupgraderepo
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   238
  repository lacks features recommended by current config options:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   239
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   240
  fncache
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   241
     long and reserved filenames may not work correctly; repository performance is sub-optimal
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   242
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   243
  generaldelta
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   244
     deltas within internal storage are unable to choose optimal revisions; repository is larger and slower than it could be; interaction with other repositories may require extra network and CPU resources, making "hg push" and "hg pull" slower
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   245
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   246
  repository lacks features used by the default config options:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   247
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   248
  dotencode
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   249
     storage of filenames beginning with a period or space may not work correctly
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   250
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   251
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   252
  performing an upgrade with "--run" will make the following changes:
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   253
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   254
  requirements
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   255
     preserved: revlogv1, store
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   256
     added: fncache, generaldelta
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   257
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   258
  fncache
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   259
     repository will be more resilient to storing certain paths and performance of certain operations should be improved
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   260
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   261
  generaldelta
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   262
     repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   263
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   264
  additional optimizations are available by specifying "--optimize <name>":
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   265
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   266
  redeltaparent
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   267
     deltas within internal storage will be recalculated to choose an optimal base revision where this was not already done; the size of the repository may shrink and various operations may become faster; the first time this optimization is performed could slow down upgrade execution considerably; subsequent invocations should not run noticeably slower
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   268
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   269
  redeltamultibase
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   270
     deltas within internal storage will be recalculated against multiple base revision and the smallest difference will be used; the size of the repository may shrink significantly when there are many merges; this optimization will slow down execution in proportion to the number of merges in the repository and the amount of files in the repository; this slow down should not be significant unless there are tens of thousands of files and thousands of merges
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   271
  
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   272
  redeltaall
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   273
     deltas within internal storage will always be recalculated without reusing prior deltas; this will likely make execution run several times slower; this optimization is typically not needed
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   274
  
35345
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   275
  redeltafulladd
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   276
     every revision will be re-added as if it was new content. It will go through the full storage mechanism giving extensions a chance to process it (eg. lfs). This is similar to "redeltaall" but even slower since more logic is involved.
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   277
  
30776
3997edc4a86d repair: determine what upgrade will do
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30775
diff changeset
   278
30777
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   279
  $ cd ..
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   280
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   281
Upgrading a repository that is already modern essentially no-ops
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   282
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   283
  $ hg init modern
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   284
  $ hg -R modern debugupgraderepo --run
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   285
  upgrade will perform the following actions:
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   286
  
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   287
  requirements
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   288
     preserved: dotencode, fncache, generaldelta, revlogv1, store
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   289
  
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   290
  beginning upgrade...
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   291
  repository locked and read-only
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   292
  creating temporary repository to stage migrated data: $TESTTMP/modern/.hg/upgrade.* (glob)
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   293
  (it is safe to interrupt this process any time before data migration completes)
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   294
  data fully migrated to temporary repository
30777
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   295
  marking source repository as being upgraded; clients will be unable to read from repository
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   296
  starting in-place swap of repository data
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   297
  replaced files will be backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   298
  replacing store...
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   299
  store replacement complete; repository was inconsistent for *s (glob)
30777
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   300
  finalizing requirements file and making repository readable again
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   301
  removing temporary repository $TESTTMP/modern/.hg/upgrade.* (glob)
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   302
  copy of old repository backed up at $TESTTMP/modern/.hg/upgradebackup.* (glob)
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   303
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   304
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   305
Upgrading a repository to generaldelta works
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   306
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   307
  $ hg --config format.usegeneraldelta=false init upgradegd
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   308
  $ cd upgradegd
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   309
  $ touch f0
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   310
  $ hg -q commit -A -m initial
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   311
  $ touch f1
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   312
  $ hg -q commit -A -m 'add f1'
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   313
  $ hg -q up -r 0
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   314
  $ touch f2
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   315
  $ hg -q commit -A -m 'add f2'
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   316
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   317
  $ hg debugupgraderepo --run
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   318
  upgrade will perform the following actions:
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   319
  
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   320
  requirements
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   321
     preserved: dotencode, fncache, revlogv1, store
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   322
     added: generaldelta
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   323
  
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   324
  generaldelta
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   325
     repository storage will be able to create optimal deltas; new repository data will be smaller and read times should decrease; interacting with other repositories using this storage model should require less network and CPU resources, making "hg push" and "hg pull" faster
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   326
  
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   327
  beginning upgrade...
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   328
  repository locked and read-only
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   329
  creating temporary repository to stage migrated data: $TESTTMP/upgradegd/.hg/upgrade.* (glob)
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   330
  (it is safe to interrupt this process any time before data migration completes)
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   331
  migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   332
  migrating 341 bytes in store; 401 bytes tracked data
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   333
  migrating 3 filelogs containing 3 revisions (0 bytes in store; 0 bytes tracked data)
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   334
  finished migrating 3 filelog revisions across 3 filelogs; change in size: 0 bytes
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   335
  migrating 1 manifests containing 3 revisions (157 bytes in store; 220 bytes tracked data)
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   336
  finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   337
  migrating changelog containing 3 revisions (184 bytes in store; 181 bytes tracked data)
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   338
  finished migrating 3 changelog revisions; change in size: 0 bytes
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   339
  finished migrating 9 total revisions; total change in store size: 0 bytes
30780
2603d04889e1 repair: copy non-revlog store files during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30779
diff changeset
   340
  copying phaseroots
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   341
  data fully migrated to temporary repository
30777
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   342
  marking source repository as being upgraded; clients will be unable to read from repository
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   343
  starting in-place swap of repository data
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   344
  replaced files will be backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   345
  replacing store...
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   346
  store replacement complete; repository was inconsistent for *s (glob)
30777
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   347
  finalizing requirements file and making repository readable again
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   348
  removing temporary repository $TESTTMP/upgradegd/.hg/upgrade.* (glob)
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   349
  copy of old repository backed up at $TESTTMP/upgradegd/.hg/upgradebackup.* (glob)
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   350
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   351
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   352
Original requirements backed up
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   353
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   354
  $ cat .hg/upgradebackup.*/requires
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   355
  dotencode
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   356
  fncache
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   357
  revlogv1
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   358
  store
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   359
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   360
generaldelta added to original requirements files
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   361
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   362
  $ cat .hg/requires
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   363
  dotencode
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   364
  fncache
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   365
  generaldelta
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   366
  revlogv1
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   367
  store
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   368
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   369
store directory has files we expect
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   370
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   371
  $ ls .hg/store
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   372
  00changelog.i
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   373
  00manifest.i
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   374
  data
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   375
  fncache
30780
2603d04889e1 repair: copy non-revlog store files during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30779
diff changeset
   376
  phaseroots
30779
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   377
  undo
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   378
  undo.backupfiles
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   379
  undo.phaseroots
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   380
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   381
manifest should be generaldelta
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   382
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   383
  $ hg debugrevlog -m | grep flags
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   384
  flags  : inline, generaldelta
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   385
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   386
verify should be happy
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   387
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   388
  $ hg verify
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   389
  checking changesets
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   390
  checking manifests
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   391
  crosschecking files in changesets and manifests
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   392
  checking files
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   393
  3 files, 3 changesets, 3 total revisions
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   394
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   395
old store should be backed up
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   396
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   397
  $ ls .hg/upgradebackup.*/store
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   398
  00changelog.i
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   399
  00manifest.i
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   400
  data
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   401
  fncache
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   402
  phaseroots
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   403
  undo
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   404
  undo.backup.fncache
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   405
  undo.backupfiles
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   406
  undo.phaseroots
38aa1ca97b6a repair: migrate revlogs during upgrade
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30777
diff changeset
   407
30777
7de7afd8bdd9 repair: begin implementation of in-place upgrading
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30776
diff changeset
   408
  $ cd ..
31798
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   409
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   410
store files with special filenames aren't encoded during copy
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   411
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   412
  $ hg init store-filenames
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   413
  $ cd store-filenames
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   414
  $ touch foo
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   415
  $ hg -q commit -A -m initial
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   416
  $ touch .hg/store/.XX_special_filename
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   417
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   418
  $ hg debugupgraderepo --run
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   419
  upgrade will perform the following actions:
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   420
  
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   421
  requirements
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   422
     preserved: dotencode, fncache, generaldelta, revlogv1, store
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   423
  
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   424
  beginning upgrade...
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   425
  repository locked and read-only
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   426
  creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   427
  (it is safe to interrupt this process any time before data migration completes)
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   428
  migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   429
  migrating 109 bytes in store; 107 bytes tracked data
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   430
  migrating 1 filelogs containing 1 revisions (0 bytes in store; 0 bytes tracked data)
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   431
  finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   432
  migrating 1 manifests containing 1 revisions (46 bytes in store; 45 bytes tracked data)
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   433
  finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   434
  migrating changelog containing 1 revisions (63 bytes in store; 62 bytes tracked data)
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   435
  finished migrating 1 changelog revisions; change in size: 0 bytes
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   436
  finished migrating 3 total revisions; total change in store size: 0 bytes
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   437
  copying .XX_special_filename
31799
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   438
  copying phaseroots
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   439
  data fully migrated to temporary repository
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   440
  marking source repository as being upgraded; clients will be unable to read from repository
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   441
  starting in-place swap of repository data
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   442
  replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   443
  replacing store...
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   444
  store replacement complete; repository was inconsistent for *s (glob)
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   445
  finalizing requirements file and making repository readable again
31798
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   446
  removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
31799
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   447
  copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
8110d49e0558 repair: use rawvfs when copying extra store files
Gregory Szorc <gregory.szorc@gmail.com>
parents: 31798
diff changeset
   448
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
35345
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   449
  $ hg debugupgraderepo --run --optimize redeltafulladd
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   450
  upgrade will perform the following actions:
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   451
  
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   452
  requirements
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   453
     preserved: dotencode, fncache, generaldelta, revlogv1, store
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   454
  
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   455
  redeltafulladd
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   456
     each revision will be added as new content to the internal storage; this will likely drastically slow down execution time, but some extensions might need it
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   457
  
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   458
  beginning upgrade...
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   459
  repository locked and read-only
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   460
  creating temporary repository to stage migrated data: $TESTTMP/store-filenames/.hg/upgrade.* (glob)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   461
  (it is safe to interrupt this process any time before data migration completes)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   462
  migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   463
  migrating 109 bytes in store; 107 bytes tracked data
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   464
  migrating 1 filelogs containing 1 revisions (0 bytes in store; 0 bytes tracked data)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   465
  finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   466
  migrating 1 manifests containing 1 revisions (46 bytes in store; 45 bytes tracked data)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   467
  finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   468
  migrating changelog containing 1 revisions (63 bytes in store; 62 bytes tracked data)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   469
  finished migrating 1 changelog revisions; change in size: 0 bytes
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   470
  finished migrating 3 total revisions; total change in store size: 0 bytes
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   471
  copying .XX_special_filename
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   472
  copying phaseroots
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   473
  data fully migrated to temporary repository
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   474
  marking source repository as being upgraded; clients will be unable to read from repository
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   475
  starting in-place swap of repository data
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   476
  replaced files will be backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   477
  replacing store...
35360
6699825f1242 test-upgrade-repo: glob away timing values
Matt Harbison <matt_harbison@yahoo.com>
parents: 35345
diff changeset
   478
  store replacement complete; repository was inconsistent for *s (glob)
35345
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   479
  finalizing requirements file and making repository readable again
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   480
  removing temporary repository $TESTTMP/store-filenames/.hg/upgrade.* (glob)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   481
  copy of old repository backed up at $TESTTMP/store-filenames/.hg/upgradebackup.* (glob)
6226668a7169 upgrade: add a 'redeltafullall' mode
Boris Feld <boris.feld@octobus.net>
parents: 35342
diff changeset
   482
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
31798
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   483
8c9178d647f7 tests: add test demonstrating buggy path handling
Gregory Szorc <gregory.szorc@gmail.com>
parents: 30781
diff changeset
   484
  $ cd ..
35303
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   485
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   486
Check upgrading a large file repository
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   487
---------------------------------------
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   488
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   489
  $ hg init largefilesrepo
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   490
  $ cat << EOF >> largefilesrepo/.hg/hgrc
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   491
  > [extensions]
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   492
  > largefiles =
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   493
  > EOF
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   494
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   495
  $ cd largefilesrepo
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   496
  $ touch foo
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   497
  $ hg add --large foo
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   498
  $ hg -q commit -m initial
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   499
  $ cat .hg/requires
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   500
  dotencode
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   501
  fncache
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   502
  generaldelta
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   503
  largefiles
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   504
  revlogv1
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   505
  store
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   506
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   507
  $ hg debugupgraderepo --run
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   508
  upgrade will perform the following actions:
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   509
  
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   510
  requirements
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   511
     preserved: dotencode, fncache, generaldelta, largefiles, revlogv1, store
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   512
  
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   513
  beginning upgrade...
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   514
  repository locked and read-only
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   515
  creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   516
  (it is safe to interrupt this process any time before data migration completes)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   517
  migrating 3 total revisions (1 in filelogs, 1 in manifests, 1 in changelog)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   518
  migrating 163 bytes in store; 160 bytes tracked data
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   519
  migrating 1 filelogs containing 1 revisions (42 bytes in store; 41 bytes tracked data)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   520
  finished migrating 1 filelog revisions across 1 filelogs; change in size: 0 bytes
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   521
  migrating 1 manifests containing 1 revisions (52 bytes in store; 51 bytes tracked data)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   522
  finished migrating 1 manifest revisions across 1 manifests; change in size: 0 bytes
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   523
  migrating changelog containing 1 revisions (69 bytes in store; 68 bytes tracked data)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   524
  finished migrating 1 changelog revisions; change in size: 0 bytes
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   525
  finished migrating 3 total revisions; total change in store size: 0 bytes
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   526
  copying phaseroots
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   527
  data fully migrated to temporary repository
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   528
  marking source repository as being upgraded; clients will be unable to read from repository
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   529
  starting in-place swap of repository data
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   530
  replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   531
  replacing store...
35360
6699825f1242 test-upgrade-repo: glob away timing values
Matt Harbison <matt_harbison@yahoo.com>
parents: 35345
diff changeset
   532
  store replacement complete; repository was inconsistent for *s (glob)
35303
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   533
  finalizing requirements file and making repository readable again
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   534
  removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   535
  copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   536
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   537
  $ cat .hg/requires
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   538
  dotencode
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   539
  fncache
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   540
  generaldelta
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   541
  largefiles
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   542
  revlogv1
67b7e39b441b largefiles: allow to run 'debugupgraderepo' on repo with largefiles
Boris Feld <boris.feld@octobus.net>
parents: 31799
diff changeset
   543
  store
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   544
35361
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   545
  $ cat << EOF >> .hg/hgrc
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   546
  > [extensions]
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   547
  > lfs =
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   548
  > [lfs]
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   549
  > threshold = 10
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   550
  > EOF
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   551
  $ echo '123456789012345' > lfs.bin
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   552
  $ hg ci -Am 'lfs.bin'
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   553
  adding lfs.bin
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   554
  $ grep lfs .hg/requires
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   555
  lfs
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   556
  $ find .hg/store/lfs -type f
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   557
  .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   558
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   559
  $ hg debugupgraderepo --run
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   560
  upgrade will perform the following actions:
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   561
  
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   562
  requirements
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   563
     preserved: dotencode, fncache, generaldelta, largefiles, lfs, revlogv1, store
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   564
  
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   565
  beginning upgrade...
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   566
  repository locked and read-only
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   567
  creating temporary repository to stage migrated data: $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   568
  (it is safe to interrupt this process any time before data migration completes)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   569
  migrating 6 total revisions (2 in filelogs, 2 in manifests, 2 in changelog)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   570
  migrating 417 bytes in store; 467 bytes tracked data
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   571
  migrating 2 filelogs containing 2 revisions (168 bytes in store; 182 bytes tracked data)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   572
  finished migrating 2 filelog revisions across 2 filelogs; change in size: 0 bytes
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   573
  migrating 1 manifests containing 2 revisions (113 bytes in store; 151 bytes tracked data)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   574
  finished migrating 2 manifest revisions across 1 manifests; change in size: 0 bytes
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   575
  migrating changelog containing 2 revisions (136 bytes in store; 134 bytes tracked data)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   576
  finished migrating 2 changelog revisions; change in size: 0 bytes
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   577
  finished migrating 6 total revisions; total change in store size: 0 bytes
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   578
  copying phaseroots
35363
b0ba1539af01 lfs: restore the local blob store after a repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35361
diff changeset
   579
  copying lfs blob d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
35361
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   580
  data fully migrated to temporary repository
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   581
  marking source repository as being upgraded; clients will be unable to read from repository
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   582
  starting in-place swap of repository data
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   583
  replaced files will be backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   584
  replacing store...
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   585
  store replacement complete; repository was inconsistent for *s (glob)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   586
  finalizing requirements file and making repository readable again
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   587
  removing temporary repository $TESTTMP/largefilesrepo/.hg/upgrade.* (glob)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   588
  copy of old repository backed up at $TESTTMP/largefilesrepo/.hg/upgradebackup.* (glob)
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   589
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   590
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   591
  $ grep lfs .hg/requires
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   592
  lfs
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   593
  $ find .hg/store/lfs -type f
35363
b0ba1539af01 lfs: restore the local blob store after a repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35361
diff changeset
   594
  .hg/store/lfs/objects/d0/beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
35361
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   595
  $ hg verify
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   596
  checking changesets
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   597
  checking manifests
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   598
  crosschecking files in changesets and manifests
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   599
  checking files
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   600
  2 files, 2 changesets, 2 total revisions
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   601
  $ hg debugdata lfs.bin 0
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   602
  version https://git-lfs.github.com/spec/v1
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   603
  oid sha256:d0beab232adff5ba365880366ad30b1edb85c4c5372442b5d2fe27adc96d653f
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   604
  size 16
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   605
  x-is-binary 0
b2f628dd99c3 tests: add coverage for preserving 'lfs' requirement on repo upgrade
Matt Harbison <matt_harbison@yahoo.com>
parents: 35360
diff changeset
   606
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   607
  $ cd ..
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   608
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   609
repository config is taken in account
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   610
-------------------------------------
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   611
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   612
  $ cat << EOF >> $HGRCPATH
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   613
  > [format]
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   614
  > maxchainlen = 1
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   615
  > EOF
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   616
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   617
  $ hg init localconfig
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   618
  $ cd localconfig
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   619
  $ cat << EOF > file
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   620
  > some content
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   621
  > with some length
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   622
  > to make sure we get a delta
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   623
  > after changes
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   624
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   625
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   626
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   627
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   628
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   629
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   630
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   631
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   632
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   633
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   634
  > very long
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   635
  > EOF
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   636
  $ hg -q commit -A -m A
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   637
  $ echo "new line" >> file
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   638
  $ hg -q commit -m B
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   639
  $ echo "new line" >> file
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   640
  $ hg -q commit -m C
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   641
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   642
  $ cat << EOF >> .hg/hgrc
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   643
  > [format]
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   644
  > maxchainlen = 9001
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   645
  > EOF
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   646
  $ hg config format
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   647
  format.maxchainlen=9001
37281
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   648
  $ hg debugdeltachain file
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   649
      rev  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   650
        0       1        1       -1    base         77        182         77   0.42308        77         0    0.00000
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   651
        1       1        2        0      p1         21        191         98   0.51309        98         0    0.00000
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   652
        2       2        1       -1    base         84        200         84   0.42000        84         0    0.00000
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   653
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   654
  $ hg debugupgraderepo --run --optimize redeltaall
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   655
  upgrade will perform the following actions:
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   656
  
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   657
  requirements
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   658
     preserved: dotencode, fncache, generaldelta, revlogv1, store
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   659
  
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   660
  redeltaall
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   661
     deltas within internal storage will be fully recomputed; this will likely drastically slow down execution time
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   662
  
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   663
  beginning upgrade...
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   664
  repository locked and read-only
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   665
  creating temporary repository to stage migrated data: $TESTTMP/localconfig/.hg/upgrade.* (glob)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   666
  (it is safe to interrupt this process any time before data migration completes)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   667
  migrating 9 total revisions (3 in filelogs, 3 in manifests, 3 in changelog)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   668
  migrating 497 bytes in store; 882 bytes tracked data
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   669
  migrating 1 filelogs containing 3 revisions (182 bytes in store; 573 bytes tracked data)
35342
75520786ad2f upgrade: use the repository 'ui' as the base for the new repository
Boris Feld <boris.feld@octobus.net>
parents: 35341
diff changeset
   670
  finished migrating 3 filelog revisions across 1 filelogs; change in size: -63 bytes
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   671
  migrating 1 manifests containing 3 revisions (141 bytes in store; 138 bytes tracked data)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   672
  finished migrating 3 manifest revisions across 1 manifests; change in size: 0 bytes
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   673
  migrating changelog containing 3 revisions (174 bytes in store; 171 bytes tracked data)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   674
  finished migrating 3 changelog revisions; change in size: 0 bytes
35342
75520786ad2f upgrade: use the repository 'ui' as the base for the new repository
Boris Feld <boris.feld@octobus.net>
parents: 35341
diff changeset
   675
  finished migrating 9 total revisions; total change in store size: -63 bytes
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   676
  copying phaseroots
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   677
  data fully migrated to temporary repository
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   678
  marking source repository as being upgraded; clients will be unable to read from repository
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   679
  starting in-place swap of repository data
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   680
  replaced files will be backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   681
  replacing store...
35360
6699825f1242 test-upgrade-repo: glob away timing values
Matt Harbison <matt_harbison@yahoo.com>
parents: 35345
diff changeset
   682
  store replacement complete; repository was inconsistent for *s (glob)
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   683
  finalizing requirements file and making repository readable again
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   684
  removing temporary repository $TESTTMP/localconfig/.hg/upgrade.* (glob)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   685
  copy of old repository backed up at $TESTTMP/localconfig/.hg/upgradebackup.* (glob)
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   686
  the old repository will not be deleted; remove it to free up disk space once the upgraded repository is verified
37281
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   687
  $ hg debugdeltachain file
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   688
      rev  chain# chainlen     prev   delta       size    rawsize  chainsize     ratio   lindist extradist extraratio
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   689
        0       1        1       -1    base         77        182         77   0.42308        77         0    0.00000
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   690
        1       1        2        0      p1         21        191         98   0.51309        98         0    0.00000
806b07d7c7d6 tests: use debugdeltachain where appropriate
Gregory Szorc <gregory.szorc@gmail.com>
parents: 36373
diff changeset
   691
        2       1        3        1      p1         21        200        119   0.59500       119         0    0.00000
35341
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   692
  $ cd ..
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   693
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   694
  $ cat << EOF >> $HGRCPATH
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   695
  > [format]
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   696
  > maxchainlen = 9001
cb7a0ae053c6 upgrade: add a test to show the repository config being ignored
Boris Feld <boris.feld@octobus.net>
parents: 35340
diff changeset
   697
  > EOF