tests/test-manifestv2.t
author Gregory Szorc <gregory.szorc@gmail.com>
Mon, 13 Nov 2017 21:48:35 -0800
changeset 35139 1fb0846ad792
parent 34661 eb586ed5d8ce
permissions -rw-r--r--
bundle2: inline changegroup.readexactly() Profiling reveals this loop is pretty tight. Literally any function call elimination can make a big difference. This commit inlines the relatively trivial changegroup.readexactly() method inside the loop. The results with `hg perfbundleread` on a bundle of the Firefox repo speak for themselves: ! read(8k) ! wall 0.679730 comb 0.680000 user 0.140000 sys 0.540000 (best of 15) ! read(16k) ! wall 0.577228 comb 0.570000 user 0.080000 sys 0.490000 (best of 17) ! read(32k) ! wall 0.516060 comb 0.520000 user 0.040000 sys 0.480000 (best of 20) ! read(128k) ! wall 0.496378 comb 0.490000 user 0.010000 sys 0.480000 (best of 20) ! bundle2 iterparts() ! wall 3.460903 comb 3.460000 user 2.760000 sys 0.700000 (best of 3) ! wall 3.056811 comb 3.050000 user 2.340000 sys 0.710000 (best of 4) ! bundle2 iterparts() seekable ! wall 4.312722 comb 4.310000 user 3.480000 sys 0.830000 (best of 3) ! wall 4.007676 comb 4.000000 user 3.170000 sys 0.830000 (best of 3) ! bundle2 part seek() ! wall 6.754764 comb 6.740000 user 3.970000 sys 2.770000 (best of 3) ! wall 6.267110 comb 6.250000 user 3.480000 sys 2.770000 (best of 3) ! bundle2 part read(8k) ! wall 3.668004 comb 3.660000 user 2.960000 sys 0.700000 (best of 3) ! wall 3.404164 comb 3.400000 user 2.650000 sys 0.750000 (best of 3) ! bundle2 part read(16k) ! wall 3.489196 comb 3.480000 user 2.750000 sys 0.730000 (best of 3) ! wall 3.197972 comb 3.200000 user 2.490000 sys 0.710000 (best of 4) ! bundle2 part read(32k) ! wall 3.388569 comb 3.380000 user 2.640000 sys 0.740000 (best of 3) ! wall 3.060557 comb 3.060000 user 2.340000 sys 0.720000 (best of 4) ! bundle2 part read(128k) ! wall 3.276415 comb 3.270000 user 2.560000 sys 0.710000 (best of 4) ! wall 2.952209 comb 2.950000 user 2.230000 sys 0.720000 (best of 4) Differential Revision: https://phab.mercurial-scm.org/D1392
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24935
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
     1
Create repo with old manifest
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
     2
26917
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
     3
  $ cat << EOF >> $HGRCPATH
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
     4
  > [format]
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
     5
  > usegeneraldelta=yes
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
     6
  > EOF
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
     7
24935
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
     8
  $ hg init existing
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
     9
  $ cd existing
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    10
  $ echo footext > foo
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    11
  $ hg add foo
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    12
  $ hg commit -m initial
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    13
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    14
We're using v1, so no manifestv2 entry is in requires yet.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    15
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    16
  $ grep manifestv2 .hg/requires
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    17
  [1]
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    18
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    19
Let's clone this with manifestv2 enabled to switch to the new format for
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    20
future commits.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    21
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    22
  $ cd ..
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    23
  $ hg clone --pull existing new --config experimental.manifestv2=1
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    24
  requesting all changes
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    25
  adding changesets
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    26
  adding manifests
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    27
  adding file changes
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    28
  added 1 changesets with 1 changes to 1 files
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 26917
diff changeset
    29
  new changesets 0fc9a4fafa44
24935
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    30
  updating to branch default
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    31
  1 files updated, 0 files merged, 0 files removed, 0 files unresolved
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    32
  $ cd new
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    33
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    34
Check that entry was added to .hg/requires.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    35
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    36
  $ grep manifestv2 .hg/requires
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    37
  manifestv2
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    38
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    39
Make a new commit.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    40
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    41
  $ echo newfootext > foo
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    42
  $ hg commit -m new
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    43
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    44
Check that the manifest actually switched to v2.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    45
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    46
  $ hg debugdata -m 0
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    47
  foo\x0021e958b1dca695a60ee2e9cf151753204ee0f9e9 (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    48
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    49
  $ hg debugdata -m 1
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    50
  \x00 (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    51
  \x00foo\x00 (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    52
  I\xab\x7f\xb8(\x83\xcas\x15\x9d\xc2\xd3\xd3:5\x08\xbad5_ (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    53
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    54
Check that manifestv2 is used if the requirement is present, even if it's
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    55
disabled in the config.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    56
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    57
  $ echo newerfootext > foo
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    58
  $ hg --config experimental.manifestv2=False commit -m newer
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    59
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    60
  $ hg debugdata -m 2
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    61
  \x00 (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    62
  \x00foo\x00 (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    63
  \xa6\xb1\xfb\xef]\x91\xa1\x19`\xf3.#\x90S\xf8\x06 \xe2\x19\x00 (esc)
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    64
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    65
Check that we can still read v1 manifests.
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    66
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    67
  $ hg files -r 0
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    68
  foo
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    69
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    70
  $ cd ..
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    71
3035b75cd594 tests: test that we can convert to manifestv2 with clone
Drew Gottlieb <drgott@google.com>
parents: 24573
diff changeset
    72
Check that entry is added to .hg/requires on repo creation
24571
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    73
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    74
  $ hg --config experimental.manifestv2=True init repo
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    75
  $ cd repo
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    76
  $ grep manifestv2 .hg/requires
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    77
  manifestv2
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    78
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    79
Set up simple repo
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    80
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    81
  $ echo a > file1
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    82
  $ echo b > file2
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    83
  $ echo c > file3
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    84
  $ hg ci -Aqm 'initial'
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    85
  $ echo d > file2
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    86
  $ hg ci -m 'modify file2'
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    87
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    88
Check that 'hg verify', which uses manifest.readdelta(), works
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    89
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    90
  $ hg verify
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    91
  checking changesets
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    92
  checking manifests
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    93
  crosschecking files in changesets and manifests
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    94
  checking files
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    95
  3 files, 2 changesets, 4 total revisions
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    96
24573
701d3554de0e manifestv2: add support for writing new manifest format
Martin von Zweigbergk <martinvonz@google.com>
parents: 24571
diff changeset
    97
Check that manifest revlog is smaller than for v1
24571
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    98
919f8ce040be manifestv2: set requires at repo creation time
Martin von Zweigbergk <martinvonz@google.com>
parents:
diff changeset
    99
  $ hg debugindex -m
26917
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
   100
     rev    offset  length  delta linkrev nodeid       p1           p2
2329ca3ebc7a test: use generaldelta in test-manifestv2.t
Pierre-Yves David <pierre-yves.david@fb.com>
parents: 24935
diff changeset
   101
       0         0      81     -1       0 57361477c778 000000000000 000000000000
24573
701d3554de0e manifestv2: add support for writing new manifest format
Martin von Zweigbergk <martinvonz@google.com>
parents: 24571
diff changeset
   102
       1        81      33      0       1 aeaab5a2ef74 57361477c778 000000000000