tests/test-persistent-nodemap.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Wed, 13 Jan 2021 23:41:37 +0100
changeset 46311 014ac7a32048
parent 46310 fc2d5c0aed7f
child 46314 95a615dd77bf
permissions -rw-r--r--
persistent-nodemap: add a "abort" option to the slow-path config We make it the default, and document the behavior in the help for the main config option. Differential Revision: https://phab.mercurial-scm.org/D9762
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
44350
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
===================================
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
Test the persistent on-disk nodemap
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
===================================
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
44868
b81486b609a3 nodemap: gate the feature behind a new requirement
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44866
diff changeset
     5
  $ cat << EOF >> $HGRCPATH
44870
d688a8d537b9 nodemap: move the main switch to the `format` section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44868
diff changeset
     6
  > [format]
d688a8d537b9 nodemap: move the main switch to the `format` section
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44868
diff changeset
     7
  > use-persistent-nodemap=yes
44356
6f9e8e142cea nodemap: add a (python) index class for persistent nodemap testing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44355
diff changeset
     8
  > [devel]
6f9e8e142cea nodemap: add a (python) index class for persistent nodemap testing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44355
diff changeset
     9
  > persistent-nodemap=yes
44351
5962fd0d1045 nodemap: write nodemap data on disk
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44350
diff changeset
    10
  > EOF
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    11
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    12
  $ hg init test-repo --config storage.revlog.persistent-nodemap.slow-path=allow
44868
b81486b609a3 nodemap: gate the feature behind a new requirement
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44866
diff changeset
    13
  $ cd test-repo
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    14
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    15
Check handling of the default slow-path value
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    16
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    17
#if no-pure no-rust
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    18
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    19
  $ hg id
46311
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
    20
  abort: accessing `persistent-nodemap` repository without associated fast implementation.
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    21
  (check `hg help config.format.use-persistent-nodemap` for details)
46311
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
    22
  [255]
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    23
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    24
Unlock further check (we are here to test the feature)
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    25
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    26
  $ cat << EOF >> $HGRCPATH
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    27
  > [storage]
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    28
  > # to avoid spamming the test
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    29
  > revlog.persistent-nodemap.slow-path=allow
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    30
  > EOF
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    31
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    32
#endif
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    33
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    34
44876
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    35
  $ hg debugformat
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    36
  format-variant     repo
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    37
  fncache:            yes
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    38
  dotencode:          yes
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    39
  generaldelta:       yes
46017
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45053
diff changeset
    40
  exp-sharesafe:       no
44876
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    41
  sparserevlog:       yes
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    42
  sidedata:            no
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    43
  persistent-nodemap: yes
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    44
  copies-sdc:          no
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    45
  plain-cl-delta:     yes
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    46
  compression:        zlib
ea9563e9e65a nodemap: teach `hg debugformat` about the persistent nodemap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44873
diff changeset
    47
  compression-level:  default
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    48
  $ hg debugbuilddag .+5000 --new-file
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
    49
44368
6614b301ea58 nodemap: add a flag to dump the details of the docket
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44367
diff changeset
    50
  $ hg debugnodemap --metadata
6614b301ea58 nodemap: add a flag to dump the details of the docket
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44367
diff changeset
    51
  uid: ???????????????? (glob)
44369
e41a164db7a9 nodemap: track the maximum revision tracked in the nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44368
diff changeset
    52
  tip-rev: 5000
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    53
  tip-node: 6b02b8c7b96654c25e86ba69eda198d7e6ad8b3c
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    54
  data-length: 121088
44370
8374b69aef75 nodemap: track the total and unused amount of data in the rawdata file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44369
diff changeset
    55
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
    56
  data-unused: 0.000%
44354
2b72c4ff8ed1 nodemap: use an intermediate "docket" file to carry small metadata
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44352
diff changeset
    57
  $ f --size .hg/store/00changelog.n
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
    58
  .hg/store/00changelog.n: size=70
44482
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    59
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    60
Simple lookup works
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    61
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    62
  $ ANYNODE=`hg log --template '{node|short}\n' --rev tip`
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    63
  $ hg log -r "$ANYNODE" --template '{rev}\n'
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    64
  5000
23df5ecfa365 nodemap: check that a simple lookup works fine
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44465
diff changeset
    65
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    66
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    67
#if rust
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    68
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    69
  $ f --sha256 .hg/store/00changelog-*.nd
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    70
  .hg/store/00changelog-????????????????.nd: sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd (glob)
44863
640d5b3bd060 nodemap: also use persistent nodemap for manifest
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44862
diff changeset
    71
640d5b3bd060 nodemap: also use persistent nodemap for manifest
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44862
diff changeset
    72
  $ f --sha256 .hg/store/00manifest-*.nd
640d5b3bd060 nodemap: also use persistent nodemap for manifest
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44862
diff changeset
    73
  .hg/store/00manifest-????????????????.nd: sha256=97117b1c064ea2f86664a124589e47db0e254e8d34739b5c5cc5bf31c9da2b51 (glob)
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    74
  $ hg debugnodemap --dump-new | f --sha256 --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    75
  size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    76
  $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    77
  size=121088, sha256=2e029d3200bd1a986b32784fc2ef1a3bd60dc331f025718bcf5ff44d93f026fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    78
  0000: 00 00 00 91 00 00 00 20 00 00 00 bb 00 00 00 e7 |....... ........|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    79
  0010: 00 00 00 66 00 00 00 a1 00 00 01 13 00 00 01 22 |...f..........."|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    80
  0020: 00 00 00 23 00 00 00 fc 00 00 00 ba 00 00 00 5e |...#...........^|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    81
  0030: 00 00 00 df 00 00 01 4e 00 00 01 65 00 00 00 ab |.......N...e....|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    82
  0040: 00 00 00 a9 00 00 00 95 00 00 00 73 00 00 00 38 |...........s...8|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    83
  0050: 00 00 00 cc 00 00 00 92 00 00 00 90 00 00 00 69 |...............i|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    84
  0060: 00 00 00 ec 00 00 00 8d 00 00 01 4f 00 00 00 12 |...........O....|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    85
  0070: 00 00 02 0c 00 00 00 77 00 00 00 9c 00 00 00 8f |.......w........|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    86
  0080: 00 00 00 d5 00 00 00 6b 00 00 00 48 00 00 00 b3 |.......k...H....|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    87
  0090: 00 00 00 e5 00 00 00 b5 00 00 00 8e 00 00 00 ad |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    88
  00a0: 00 00 00 7b 00 00 00 7c 00 00 00 0b 00 00 00 2b |...{...|.......+|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    89
  00b0: 00 00 00 c6 00 00 00 1e 00 00 01 08 00 00 00 11 |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    90
  00c0: 00 00 01 30 00 00 00 26 00 00 01 9c 00 00 00 35 |...0...&.......5|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    91
  00d0: 00 00 00 b8 00 00 01 31 00 00 00 2c 00 00 00 55 |.......1...,...U|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    92
  00e0: 00 00 00 8a 00 00 00 9a 00 00 00 0c 00 00 01 1e |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    93
  00f0: 00 00 00 a4 00 00 00 83 00 00 00 c9 00 00 00 8c |................|
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    94
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    95
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    96
#else
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
    97
44355
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
    98
  $ f --sha256 .hg/store/00changelog-*.nd
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
    99
  .hg/store/00changelog-????????????????.nd: sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79 (glob)
44352
6c07480d6659 nodemap: add a function to read the data from disk
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44351
diff changeset
   100
  $ hg debugnodemap --dump-new | f --sha256 --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   101
  size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
44352
6c07480d6659 nodemap: add a function to read the data from disk
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44351
diff changeset
   102
  $ hg debugnodemap --dump-disk | f --sha256 --bytes=256 --hexdump --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   103
  size=121088, sha256=f544f5462ff46097432caf6d764091f6d8c46d6121be315ead8576d548c9dd79
44350
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   104
  0000: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   105
  0010: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   106
  0020: ff ff ff ff ff ff f5 06 ff ff ff ff ff ff f3 e7 |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   107
  0030: ff ff ef ca ff ff ff ff ff ff ff ff ff ff ff ff |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   108
  0040: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   109
  0050: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ed 08 |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   110
  0060: ff ff ed 66 ff ff ff ff ff ff ff ff ff ff ff ff |...f............|
44350
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   111
  0070: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   112
  0080: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   113
  0090: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f6 ed |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   114
  00a0: ff ff ff ff ff ff fe 61 ff ff ff ff ff ff ff ff |.......a........|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   115
  00b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   116
  00c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
44350
c577bb4a04d4 nodemap: have some python code writing a nodemap in persistent binary form
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   117
  00d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff |................|
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   118
  00e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff f1 02 |................|
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   119
  00f0: ff ff ff ff ff ff ed 1b ff ff ff ff ff ff ff ff |................|
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   120
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   121
#endif
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   122
44361
20e125cdd719 nodemap: add basic checking of the on disk nodemap content
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44356
diff changeset
   123
  $ hg debugnodemap --check
20e125cdd719 nodemap: add basic checking of the on disk nodemap content
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44356
diff changeset
   124
  revision in index:   5001
20e125cdd719 nodemap: add basic checking of the on disk nodemap content
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44356
diff changeset
   125
  revision in nodemap: 5001
44355
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   126
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   127
add a new commit
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   128
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   129
  $ hg up
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   130
  5001 files updated, 0 files merged, 0 files removed, 0 files unresolved
44355
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   131
  $ echo foo > foo
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   132
  $ hg add foo
44866
6b01799e9db0 nodemap: add a new mode value, "strict"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44865
diff changeset
   133
46309
2c9c88879ab7 persistent-node: check the value of the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46306
diff changeset
   134
2c9c88879ab7 persistent-node: check the value of the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46306
diff changeset
   135
Check slow-path config value handling
2c9c88879ab7 persistent-node: check the value of the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46306
diff changeset
   136
-------------------------------------
2c9c88879ab7 persistent-node: check the value of the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46306
diff changeset
   137
46311
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   138
#if no-pure no-rust
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   139
46309
2c9c88879ab7 persistent-node: check the value of the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46306
diff changeset
   140
  $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
2c9c88879ab7 persistent-node: check the value of the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46306
diff changeset
   141
  unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
46311
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   142
  falling back to default value: abort
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   143
  abort: accessing `persistent-nodemap` repository without associated fast implementation.
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   144
  (check `hg help config.format.use-persistent-nodemap` for details)
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   145
  [255]
44866
6b01799e9db0 nodemap: add a new mode value, "strict"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44865
diff changeset
   146
46310
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   147
  $ hg log -r . --config "storage.revlog.persistent-nodemap.slow-path=warn"
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   148
  warning: accessing `persistent-nodemap` repository without associated fast implementation.
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   149
  (check `hg help config.format.use-persistent-nodemap` for details)
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   150
  changeset:   5000:6b02b8c7b966
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   151
  tag:         tip
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   152
  user:        debugbuilddag
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   153
  date:        Thu Jan 01 01:23:20 1970 +0000
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   154
  summary:     r5000
fc2d5c0aed7f persistent-nodemap: add a "warn" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46309
diff changeset
   155
  
46311
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   156
  $ hg ci -m 'foo' --config "storage.revlog.persistent-nodemap.slow-path=abort"
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   157
  abort: accessing `persistent-nodemap` repository without associated fast implementation.
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   158
  (check `hg help config.format.use-persistent-nodemap` for details)
44866
6b01799e9db0 nodemap: add a new mode value, "strict"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44865
diff changeset
   159
  [255]
6b01799e9db0 nodemap: add a new mode value, "strict"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44865
diff changeset
   160
46311
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   161
#else
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   162
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   163
  $ hg id --config "storage.revlog.persistent-nodemap.slow-path=invalid-value"
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   164
  unknown value for config "storage.revlog.persistent-nodemap.slow-path": "invalid-value"
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   165
  falling back to default value: abort
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   166
  6b02b8c7b966+ tip
014ac7a32048 persistent-nodemap: add a "abort" option to the slow-path config
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46310
diff changeset
   167
44866
6b01799e9db0 nodemap: add a new mode value, "strict"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44865
diff changeset
   168
#endif
6b01799e9db0 nodemap: add a new mode value, "strict"
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44865
diff changeset
   169
44355
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   170
  $ hg ci -m 'foo'
44370
8374b69aef75 nodemap: track the total and unused amount of data in the rawdata file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44369
diff changeset
   171
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   172
#if no-pure no-rust
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   173
  $ hg debugnodemap --metadata
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   174
  uid: ???????????????? (glob)
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   175
  tip-rev: 5001
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   176
  tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   177
  data-length: 121088
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   178
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   179
  data-unused: 0.000%
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   180
#else
44368
6614b301ea58 nodemap: add a flag to dump the details of the docket
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44367
diff changeset
   181
  $ hg debugnodemap --metadata
6614b301ea58 nodemap: add a flag to dump the details of the docket
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44367
diff changeset
   182
  uid: ???????????????? (glob)
44369
e41a164db7a9 nodemap: track the maximum revision tracked in the nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44368
diff changeset
   183
  tip-rev: 5001
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   184
  tip-node: 16395c3cf7e231394735e6b1717823ada303fb0c
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   185
  data-length: 121344
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   186
  data-unused: 256
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   187
  data-unused: 0.211%
44370
8374b69aef75 nodemap: track the total and unused amount of data in the rawdata file
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44369
diff changeset
   188
#endif
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   189
44355
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   190
  $ f --size .hg/store/00changelog.n
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   191
  .hg/store/00changelog.n: size=70
44367
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   192
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   193
(The pure code use the debug code that perform incremental update, the C code reencode from scratch)
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   194
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   195
#if pure
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   196
  $ f --sha256 .hg/store/00changelog-*.nd --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   197
  .hg/store/00changelog-????????????????.nd: size=121344, sha256=cce54c5da5bde3ad72a4938673ed4064c86231b9c64376b082b163fdb20f8f66 (glob)
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   198
#endif
44367
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   199
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   200
#if rust
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   201
  $ f --sha256 .hg/store/00changelog-*.nd --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   202
  .hg/store/00changelog-????????????????.nd: size=121344, sha256=952b042fcf614ceb37b542b1b723e04f18f83efe99bee4e0f5ccd232ef470e58 (glob)
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   203
#endif
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   204
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   205
#if no-pure no-rust
44355
563dfdfd01a4 nodemap: delete older raw data file when creating a new ones
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44354
diff changeset
   206
  $ f --sha256 .hg/store/00changelog-*.nd --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   207
  .hg/store/00changelog-????????????????.nd: size=121088, sha256=df7c06a035b96cb28c7287d349d603baef43240be7736fe34eea419a49702e17 (glob)
44367
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   208
#endif
50ad851efd9b nodemap: introduce append-only incremental update of the persistent data
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44361
diff changeset
   209
44361
20e125cdd719 nodemap: add basic checking of the on disk nodemap content
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44356
diff changeset
   210
  $ hg debugnodemap --check
20e125cdd719 nodemap: add basic checking of the on disk nodemap content
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44356
diff changeset
   211
  revision in index:   5002
20e125cdd719 nodemap: add basic checking of the on disk nodemap content
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44356
diff changeset
   212
  revision in nodemap: 5002
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   213
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   214
Test code path without mmap
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   215
---------------------------
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   216
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   217
  $ echo bar > bar
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   218
  $ hg add bar
46306
7d096e5a5b90 persistent-nodemap: rename the storage.revlog.nodemap.mmap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46253
diff changeset
   219
  $ hg ci -m 'bar' --config storage.revlog.persistent-nodemap.mmap=no
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   220
46306
7d096e5a5b90 persistent-nodemap: rename the storage.revlog.nodemap.mmap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46253
diff changeset
   221
  $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=yes
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   222
  revision in index:   5003
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   223
  revision in nodemap: 5003
46306
7d096e5a5b90 persistent-nodemap: rename the storage.revlog.nodemap.mmap option
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46253
diff changeset
   224
  $ hg debugnodemap --check --config storage.revlog.persistent-nodemap.mmap=no
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   225
  revision in index:   5003
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   226
  revision in nodemap: 5003
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   227
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   228
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   229
#if pure
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   230
  $ hg debugnodemap --metadata
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   231
  uid: ???????????????? (glob)
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   232
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   233
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   234
  data-length: 121600
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   235
  data-unused: 512
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   236
  data-unused: 0.421%
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   237
  $ f --sha256 .hg/store/00changelog-*.nd --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   238
  .hg/store/00changelog-????????????????.nd: size=121600, sha256=def52503d049ccb823974af313a98a935319ba61f40f3aa06a8be4d35c215054 (glob)
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   239
#endif
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   240
#if rust
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   241
  $ hg debugnodemap --metadata
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   242
  uid: ???????????????? (glob)
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   243
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   244
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   245
  data-length: 121600
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   246
  data-unused: 512
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   247
  data-unused: 0.421%
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   248
  $ f --sha256 .hg/store/00changelog-*.nd --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   249
  .hg/store/00changelog-????????????????.nd: size=121600, sha256=dacf5b5f1d4585fee7527d0e67cad5b1ba0930e6a0928f650f779aefb04ce3fb (glob)
44523
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   250
#endif
e7fff9c3cdac rust-nodemap: automatically use the rust index for persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44507
diff changeset
   251
#if no-pure no-rust
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   252
  $ hg debugnodemap --metadata
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   253
  uid: ???????????????? (glob)
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   254
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   255
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   256
  data-length: 121088
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   257
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   258
  data-unused: 0.000%
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   259
  $ f --sha256 .hg/store/00changelog-*.nd --size
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   260
  .hg/store/00changelog-????????????????.nd: size=121088, sha256=59fcede3e3cc587755916ceed29e3c33748cd1aa7d2f91828ac83e7979d935e8 (glob)
44397
f7459da77f23 nodemap: introduce an option to use mmap to read the nodemap mapping
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44370
diff changeset
   261
#endif
44465
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   262
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   263
Test force warming the cache
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   264
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   265
  $ rm .hg/store/00changelog.n
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   266
  $ hg debugnodemap --metadata
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   267
  $ hg debugupdatecache
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   268
#if pure
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   269
  $ hg debugnodemap --metadata
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   270
  uid: ???????????????? (glob)
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   271
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   272
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   273
  data-length: 121088
44465
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   274
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   275
  data-unused: 0.000%
44465
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   276
#else
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   277
  $ hg debugnodemap --metadata
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   278
  uid: ???????????????? (glob)
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   279
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   280
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   281
  data-length: 121088
44465
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   282
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   283
  data-unused: 0.000%
44465
336ec75ed1ac nodemap: warm the persistent nodemap on disk with debugupdatecache
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44397
diff changeset
   284
#endif
44507
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   285
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   286
Check out of sync nodemap
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   287
=========================
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   288
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   289
First copy old data on the side.
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   290
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   291
  $ mkdir ../tmp-copies
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   292
  $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   293
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   294
Nodemap lagging behind
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   295
----------------------
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   296
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   297
make a new commit
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   298
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   299
  $ echo bar2 > bar
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   300
  $ hg ci -m 'bar2'
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   301
  $ NODE=`hg log -r tip -T '{node}\n'`
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   302
  $ hg log -r "$NODE" -T '{rev}\n'
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   303
  5003
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   304
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   305
If the nodemap is lagging behind, it can catch up fine
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   306
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   307
  $ hg debugnodemap --metadata
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   308
  uid: ???????????????? (glob)
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   309
  tip-rev: 5003
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   310
  tip-node: c9329770f979ade2d16912267c38ba5f82fd37b3
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   311
  data-length: 121344 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   312
  data-length: 121344 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   313
  data-length: 121152 (no-rust no-pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   314
  data-unused: 192 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   315
  data-unused: 192 (rust !)
44507
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   316
  data-unused: 0 (no-rust no-pure !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   317
  data-unused: 0.158% (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   318
  data-unused: 0.158% (rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   319
  data-unused: 0.000% (no-rust no-pure !)
44507
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   320
  $ cp -f ../tmp-copies/* .hg/store/
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   321
  $ hg debugnodemap --metadata
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   322
  uid: ???????????????? (glob)
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   323
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   324
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   325
  data-length: 121088
44507
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   326
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   327
  data-unused: 0.000%
44507
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   328
  $ hg log -r "$NODE" -T '{rev}\n'
1376cb1c8e34 nodemap: test that an outdated nodemap can catch up
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44482
diff changeset
   329
  5003
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   330
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   331
changelog altered
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   332
-----------------
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   333
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   334
If the nodemap is not gated behind a requirements, an unaware client can alter
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   335
the repository so the revlog used to generate the nodemap is not longer
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   336
compatible with the persistent nodemap. We need to detect that.
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   337
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   338
  $ hg up "$NODE~5"
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   339
  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   340
  $ echo bar > babar
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   341
  $ hg add babar
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   342
  $ hg ci -m 'babar'
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   343
  created new head
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   344
  $ OTHERNODE=`hg log -r tip -T '{node}\n'`
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   345
  $ hg log -r "$OTHERNODE" -T '{rev}\n'
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   346
  5004
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   347
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   348
  $ hg --config extensions.strip= strip --rev "$NODE~1" --no-backup
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   349
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   350
the nodemap should detect the changelog have been tampered with and recover.
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   351
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   352
  $ hg debugnodemap --metadata
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   353
  uid: ???????????????? (glob)
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   354
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   355
  tip-node: b355ef8adce0949b8bdf6afc72ca853740d65944
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   356
  data-length: 121536 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   357
  data-length: 121088 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   358
  data-length: 121088 (no-pure no-rust !)
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   359
  data-unused: 448 (pure !)
44640
c70bcaf7927b nodemap: automatically "vacuum" the persistent nodemap when too sparse
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44639
diff changeset
   360
  data-unused: 0 (rust !)
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   361
  data-unused: 0 (no-pure no-rust !)
44640
c70bcaf7927b nodemap: automatically "vacuum" the persistent nodemap when too sparse
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44639
diff changeset
   362
  data-unused: 0.000% (rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   363
  data-unused: 0.369% (pure !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   364
  data-unused: 0.000% (no-pure no-rust !)
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   365
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   366
  $ cp -f ../tmp-copies/* .hg/store/
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   367
  $ hg debugnodemap --metadata
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   368
  uid: ???????????????? (glob)
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   369
  tip-rev: 5002
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   370
  tip-node: 880b18d239dfa9f632413a2071bfdbcc4806a4fd
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   371
  data-length: 121088
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   372
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   373
  data-unused: 0.000%
44525
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   374
  $ hg log -r "$OTHERNODE" -T '{rev}\n'
6c906eaedd0d nodemap: track the tip_node for validation
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44523
diff changeset
   375
  5002
44526
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   376
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   377
Check transaction related property
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   378
==================================
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   379
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   380
An up to date nodemap should be available to shell hooks,
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   381
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   382
  $ echo dsljfl > a
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   383
  $ hg add a
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   384
  $ hg ci -m a
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   385
  $ hg debugnodemap --metadata
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   386
  uid: ???????????????? (glob)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   387
  tip-rev: 5003
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   388
  tip-node: a52c5079765b5865d97b993b303a18740113bbb2
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   389
  data-length: 121088
44526
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   390
  data-unused: 0
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   391
  data-unused: 0.000%
44526
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   392
  $ echo babar2 > babar
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   393
  $ hg ci -m 'babar2' --config "hooks.pretxnclose.nodemap-test=hg debugnodemap --metadata"
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   394
  uid: ???????????????? (glob)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   395
  tip-rev: 5004
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   396
  tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   397
  data-length: 121280 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   398
  data-length: 121280 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   399
  data-length: 121088 (no-pure no-rust !)
44526
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   400
  data-unused: 192 (pure !)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   401
  data-unused: 192 (rust !)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   402
  data-unused: 0 (no-pure no-rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   403
  data-unused: 0.158% (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   404
  data-unused: 0.158% (rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   405
  data-unused: 0.000% (no-pure no-rust !)
44526
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   406
  $ hg debugnodemap --metadata
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   407
  uid: ???????????????? (glob)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   408
  tip-rev: 5004
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   409
  tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   410
  data-length: 121280 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   411
  data-length: 121280 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   412
  data-length: 121088 (no-pure no-rust !)
44526
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   413
  data-unused: 192 (pure !)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   414
  data-unused: 192 (rust !)
64e2f603de9d nodemap: make sure hooks have access to an up-to-date version
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44525
diff changeset
   415
  data-unused: 0 (no-pure no-rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   416
  data-unused: 0.158% (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   417
  data-unused: 0.158% (rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   418
  data-unused: 0.000% (no-pure no-rust !)
44637
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   419
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   420
Another process does not see the pending nodemap content during run.
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   421
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   422
  $ PATH=$RUNTESTDIR/testlib/:$PATH
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   423
  $ echo qpoasp > a
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   424
  $ hg ci -m a2 \
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   425
  > --config "hooks.pretxnclose=wait-on-file 20 sync-repo-read sync-txn-pending" \
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   426
  > --config "hooks.txnclose=touch sync-txn-close" > output.txt 2>&1 &
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   427
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   428
(read the repository while the commit transaction is pending)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   429
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   430
  $ wait-on-file 20 sync-txn-pending && \
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   431
  > hg debugnodemap --metadata && \
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   432
  > wait-on-file 20 sync-txn-close sync-repo-read
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   433
  uid: ???????????????? (glob)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   434
  tip-rev: 5004
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   435
  tip-node: 2f5fb1c06a16834c5679d672e90da7c5f3b1a984
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   436
  data-length: 121280 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   437
  data-length: 121280 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   438
  data-length: 121088 (no-pure no-rust !)
44637
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   439
  data-unused: 192 (pure !)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   440
  data-unused: 192 (rust !)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   441
  data-unused: 0 (no-pure no-rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   442
  data-unused: 0.158% (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   443
  data-unused: 0.158% (rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   444
  data-unused: 0.000% (no-pure no-rust !)
44637
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   445
  $ hg debugnodemap --metadata
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   446
  uid: ???????????????? (glob)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   447
  tip-rev: 5005
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   448
  tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   449
  data-length: 121536 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   450
  data-length: 121536 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   451
  data-length: 121088 (no-pure no-rust !)
44637
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   452
  data-unused: 448 (pure !)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   453
  data-unused: 448 (rust !)
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   454
  data-unused: 0 (no-pure no-rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   455
  data-unused: 0.369% (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   456
  data-unused: 0.369% (rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   457
  data-unused: 0.000% (no-pure no-rust !)
44637
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   458
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   459
  $ cat output.txt
dd5b47fb0860 nodemap: test that concurrent process don't see the pending transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44526
diff changeset
   460
44638
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   461
Check that a failing transaction will properly revert the data
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   462
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   463
  $ echo plakfe > a
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   464
  $ f --size --sha256 .hg/store/00changelog-*.nd
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   465
  .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   466
  .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   467
  .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
44638
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   468
  $ hg ci -m a3 --config "extensions.abort=$RUNTESTDIR/testlib/crash_transaction_late.py"
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   469
  transaction abort!
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   470
  rollback completed
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   471
  abort: This is a late abort
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   472
  [255]
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   473
  $ hg debugnodemap --metadata
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   474
  uid: ???????????????? (glob)
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   475
  tip-rev: 5005
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   476
  tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   477
  data-length: 121536 (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   478
  data-length: 121536 (rust !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   479
  data-length: 121088 (no-pure no-rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   480
  data-unused: 448 (pure !)
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   481
  data-unused: 448 (rust !)
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   482
  data-unused: 0 (no-pure no-rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   483
  data-unused: 0.369% (pure !)
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   484
  data-unused: 0.369% (rust !)
44639
99ea74cbed74 nodemap: display percentage of unused in `hg debugnodemap`
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44638
diff changeset
   485
  data-unused: 0.000% (no-pure no-rust !)
44638
01b0805534bb nodemap: make sure on disk change get rolled back with the transaction
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44637
diff changeset
   486
  $ f --size --sha256 .hg/store/00changelog-*.nd
45053
91f4662b7fa7 test: restore expected output in test-persistent-nodemap.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44995
diff changeset
   487
  .hg/store/00changelog-????????????????.nd: size=121536, sha256=bb414468d225cf52d69132e1237afba34d4346ee2eb81b505027e6197b107f03 (glob) (pure !)
91f4662b7fa7 test: restore expected output in test-persistent-nodemap.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44995
diff changeset
   488
  .hg/store/00changelog-????????????????.nd: size=121536, sha256=909ac727bc4d1c0fda5f7bff3c620c98bd4a2967c143405a1503439e33b377da (glob) (rust !)
44862
2c073d82fbfa nodemap: create files in the repository used in the test
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   489
  .hg/store/00changelog-????????????????.nd: size=121088, sha256=342d36d30d86dde67d3cb6c002606c4a75bcad665595d941493845066d9c8ee0 (glob) (no-pure no-rust !)
44803
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   490
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   491
Check that removing content does not confuse the nodemap
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   492
--------------------------------------------------------
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   493
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   494
removing data with rollback
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   495
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   496
  $ echo aso > a
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   497
  $ hg ci -m a4
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   498
  $ hg rollback
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   499
  repository tip rolled back to revision 5005 (undo commit)
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   500
  working directory now based on revision 5005
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   501
  $ hg id -r .
44995
78cafd48b9b2 merge with stable
Augie Fackler <augie@google.com>
parents: 44900 44803
diff changeset
   502
  90d5d3ba2fc4 tip
44803
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   503
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   504
roming data with strip
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   505
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   506
  $ echo aso > a
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   507
  $ hg ci -m a4
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   508
  $ hg --config extensions.strip= strip -r . --no-backup
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   509
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
affe0fb42250 nodemap: fix validity checking when revlog is too short
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44640
diff changeset
   510
  $ hg id -r . --traceback
44995
78cafd48b9b2 merge with stable
Augie Fackler <augie@google.com>
parents: 44900 44803
diff changeset
   511
  90d5d3ba2fc4 tip
78cafd48b9b2 merge with stable
Augie Fackler <augie@google.com>
parents: 44900 44803
diff changeset
   512
44900
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   513
Test upgrade / downgrade
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   514
========================
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   515
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   516
downgrading
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   517
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   518
  $ cat << EOF >> .hg/hgrc
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   519
  > [format]
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   520
  > use-persistent-nodemap=no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   521
  > EOF
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   522
  $ hg debugformat -v
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   523
  format-variant     repo config default
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   524
  fncache:            yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   525
  dotencode:          yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   526
  generaldelta:       yes    yes     yes
46017
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45053
diff changeset
   527
  exp-sharesafe:       no     no      no
44900
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   528
  sparserevlog:       yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   529
  sidedata:            no     no      no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   530
  persistent-nodemap: yes     no      no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   531
  copies-sdc:          no     no      no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   532
  plain-cl-delta:     yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   533
  compression:        zlib   zlib    zlib
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   534
  compression-level:  default default default
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   535
  $ hg debugupgraderepo --run --no-backup --quiet
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   536
  upgrade will perform the following actions:
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   537
  
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   538
  requirements
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   539
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   540
     removed: persistent-nodemap
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   541
  
46039
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   542
  processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   543
    - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   544
    - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   545
    - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   546
  
44900
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   547
  $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   548
  [1]
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   549
  $ hg debugnodemap --metadata
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   550
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   551
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   552
upgrading
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   553
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   554
  $ cat << EOF >> .hg/hgrc
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   555
  > [format]
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   556
  > use-persistent-nodemap=yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   557
  > EOF
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   558
  $ hg debugformat -v
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   559
  format-variant     repo config default
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   560
  fncache:            yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   561
  dotencode:          yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   562
  generaldelta:       yes    yes     yes
46017
705c37f22859 upgrade: add support for experimental safe share mode
Pulkit Goyal <7895pulkit@gmail.com>
parents: 45053
diff changeset
   563
  exp-sharesafe:       no     no      no
44900
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   564
  sparserevlog:       yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   565
  sidedata:            no     no      no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   566
  persistent-nodemap:  no    yes      no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   567
  copies-sdc:          no     no      no
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   568
  plain-cl-delta:     yes    yes     yes
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   569
  compression:        zlib   zlib    zlib
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   570
  compression-level:  default default default
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   571
  $ hg debugupgraderepo --run --no-backup --quiet
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   572
  upgrade will perform the following actions:
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   573
  
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   574
  requirements
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   575
     preserved: dotencode, fncache, generaldelta, revlogv1, sparserevlog, store
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   576
     added: persistent-nodemap
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   577
  
46039
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   578
  processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   579
    - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   580
    - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   581
    - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   582
  
44900
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   583
  $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   584
  00changelog-*.nd (glob)
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   585
  00changelog.n
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   586
  00manifest-*.nd (glob)
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   587
  00manifest.n
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   588
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   589
  $ hg debugnodemap --metadata
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   590
  uid: * (glob)
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   591
  tip-rev: 5005
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   592
  tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   593
  data-length: 121088
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   594
  data-unused: 0
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   595
  data-unused: 0.000%
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   596
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   597
Running unrelated upgrade
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   598
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   599
  $ hg debugupgraderepo --run --no-backup --quiet --optimize re-delta-all
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   600
  upgrade will perform the following actions:
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   601
  
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   602
  requirements
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   603
     preserved: dotencode, fncache, generaldelta, persistent-nodemap, revlogv1, sparserevlog, store
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   604
  
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   605
  optimisations: re-delta-all
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   606
  
46039
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   607
  processed revlogs:
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   608
    - all-filelogs
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   609
    - changelog
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   610
    - manifest
6c960b708ac4 upgrade: display the list of processed revlog before proceeding
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46017
diff changeset
   611
  
44900
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   612
  $ ls -1 .hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   613
  00changelog-*.nd (glob)
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   614
  00changelog.n
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   615
  00manifest-*.nd (glob)
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   616
  00manifest.n
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   617
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   618
  $ hg debugnodemap --metadata
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   619
  uid: * (glob)
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   620
  tip-rev: 5005
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   621
  tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   622
  data-length: 121088
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   623
  data-unused: 0
526d69eeea31 upgrade: support upgrade and downgrade from persistent nodemap
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 44876
diff changeset
   624
  data-unused: 0.000%
46248
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   625
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   626
Persistent nodemap and local/streaming clone
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   627
============================================
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   628
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   629
  $ cd ..
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   630
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   631
standard clone
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   632
--------------
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   633
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   634
The persistent nodemap should exist after a streaming clone
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   635
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   636
  $ hg clone --pull --quiet -U test-repo standard-clone
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   637
  $ ls -1 standard-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   638
  00changelog-*.nd (glob)
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   639
  00changelog.n
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   640
  00manifest-*.nd (glob)
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   641
  00manifest.n
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   642
  $ hg -R standard-clone debugnodemap --metadata
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   643
  uid: * (glob)
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   644
  tip-rev: 5005
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   645
  tip-node: 90d5d3ba2fc47db50f712570487cb261a68c8ffe
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   646
  data-length: 121088
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   647
  data-unused: 0
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   648
  data-unused: 0.000%
7488067b8c1e persistent-nodemap: test that is it present after a clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46039
diff changeset
   649
46249
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   650
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   651
local clone
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   652
------------
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   653
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   654
The persistent nodemap should exist after a streaming clone
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   655
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   656
  $ hg clone -U test-repo local-clone
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   657
  $ ls -1 local-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   658
  [1]
3eb33aa237c0 persistent-nodemap: test it (does not) exist after a local clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46248
diff changeset
   659
  $ hg -R local-clone debugnodemap --metadata
46250
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   660
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   661
stream clone
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   662
------------
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   663
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   664
The persistent nodemap should exist after a streaming clone
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   665
46251
40ec2173f4dd persistent-nodemap: highlight that node is not sent when streaming
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46250
diff changeset
   666
  $ hg clone -U --stream --config ui.ssh="\"$PYTHON\" \"$TESTDIR/dummyssh\"" ssh://user@dummy/test-repo stream-clone --debug | egrep '00(changelog|manifest)'
46253
1cebad969d88 persistent-nodemap: also list related file as part of the store
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46251
diff changeset
   667
  adding [s] 00manifest.n (70 bytes)
46251
40ec2173f4dd persistent-nodemap: highlight that node is not sent when streaming
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46250
diff changeset
   668
  adding [s] 00manifest.i (313 KB)
40ec2173f4dd persistent-nodemap: highlight that node is not sent when streaming
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46250
diff changeset
   669
  adding [s] 00manifest.d (452 KB)
46253
1cebad969d88 persistent-nodemap: also list related file as part of the store
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46251
diff changeset
   670
  adding [s] 00changelog.n (70 bytes)
46251
40ec2173f4dd persistent-nodemap: highlight that node is not sent when streaming
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46250
diff changeset
   671
  adding [s] 00changelog.i (313 KB)
40ec2173f4dd persistent-nodemap: highlight that node is not sent when streaming
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46250
diff changeset
   672
  adding [s] 00changelog.d (360 KB)
46250
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   673
  $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   674
  [1]
de2ed219fd00 persistent-nodemap: test it (does not) exist after a stream clone
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 46249
diff changeset
   675
  $ hg -R stream-clone debugnodemap --metadata