view tests/test-revlog-v2.t @ 43256:00de32aa834e

copies: use an unfiltered repository for the changeset centric algorithm Since the algorithm work form heads to ancestors, we don't need to check filtering for anything but the two entries. Using an unfiltered version is noticeably more efficient. Some timing on the pypy repo: revision: large amount; added files: large amount; rename small amount; c3b14617fbd7 9ba6ab77fd29 before: ! wall 2.717861 comb 2.720000 user 2.700000 sys 0.020000 (median of 10) after: ! wall 2.582204 comb 2.580000 user 2.560000 sys 0.020000 (median of 10) revision: large amount; added files: small amount; rename small amount; c3b14617fbd7 f650a9b140d2 before: ! wall 4.003146 comb 4.010000 user 3.970000 sys 0.040000 (median of 10) after: ! wall 3.814613 comb 3.810000 user 3.760000 sys 0.050000 (median of 10) revision: large amount; added files: large amount; rename large amount; 08ea3258278e d9fa043f30c0 before: ! wall 0.704204 comb 0.700000 user 0.700000 sys 0.000000 (median of 13) after: ! wall 0.657387 comb 0.650000 user 0.640000 sys 0.010000 (best of 14) revision: small amount; added files: large amount; rename large amount; df6f7a526b60 a83dc6a2d56f before: ! wall 0.013493 comb 0.020000 user 0.020000 sys 0.000000 (median of 219) after: ! wall 0.013523 comb 0.020000 user 0.020000 sys 0.000000 (median of 218) revision: small amount; added files: large amount; rename small amount; 4aa4e1f8e19a 169138063d63 before: ! wall 0.003017 comb 0.000000 user 0.000000 sys 0.000000 (median of 985) after: ! wall 0.002876 comb 0.000000 user 0.000000 sys 0.000000 (median of 1000) revision: small amount; added files: small amount; rename small amount; 4bc173b045a6 964879152e2e before: ! wall 0.000073 comb 0.000000 user 0.000000 sys 0.000000 (median of 12672) after: ! wall 0.000082 comb 0.000000 user 0.000000 sys 0.000000 (median of 11456) revision: medium amount; added files: large amount; rename medium amount; c95f1ced15f2 2c68e87c3efe before: ! wall 0.478061 comb 0.470000 user 0.470000 sys 0.000000 (median of 19) after: ! wall 0.452420 comb 0.450000 user 0.450000 sys 0.000000 (median of 21) revision: medium amount; added files: medium amount; rename small amount; d343da0c55a8 d7746d32bf9d before: ! wall 0.116015 comb 0.110000 user 0.110000 sys 0.000000 (median of 84) after: ! wall 0.109153 comb 0.100000 user 0.100000 sys 0.000000 (median of 90) Differential Revision: https://phab.mercurial-scm.org/D7123
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 15 Oct 2019 18:42:03 +0200
parents e7a2cc84dbc0
children 15d35f2ba474
line wrap: on
line source

#require reporevlogstore

A repo with unknown revlogv2 requirement string cannot be opened

  $ hg init invalidreq
  $ cd invalidreq
  $ echo exp-revlogv2.unknown >> .hg/requires
  $ hg log
  abort: repository requires features unknown to this Mercurial: exp-revlogv2.unknown!
  (see https://mercurial-scm.org/wiki/MissingRequirement for more information)
  [255]
  $ cd ..

Can create and open repo with revlog v2 requirement

  $ cat >> $HGRCPATH << EOF
  > [experimental]
  > revlogv2 = enable-unstable-format-and-corrupt-my-data
  > EOF

  $ hg init empty-repo
  $ cd empty-repo
  $ cat .hg/requires
  dotencode
  exp-revlogv2.1
  fncache
  sparserevlog
  store

  $ hg log

Unknown flags to revlog are rejected

  >>> with open('.hg/store/00changelog.i', 'wb') as fh:
  ...     fh.write(b'\x00\x04\xde\xad') and None

  $ hg log
  abort: unknown flags (0x04) in version 57005 revlog 00changelog.i!
  [255]

  $ cd ..

Writing a simple revlog v2 works

  $ hg init simple
  $ cd simple
  $ touch foo
  $ hg -q commit -A -m initial

  $ hg log
  changeset:   0:96ee1d7354c4
  tag:         tip
  user:        test
  date:        Thu Jan 01 00:00:00 1970 +0000
  summary:     initial
  
Header written as expected

  $ f --hexdump --bytes 4 .hg/store/00changelog.i
  .hg/store/00changelog.i:
  0000: 00 01 de ad                                     |....|

  $ f --hexdump --bytes 4 .hg/store/data/foo.i
  .hg/store/data/foo.i:
  0000: 00 01 de ad                                     |....|