tests/test-exchange-obsmarkers-case-B7.t
author Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
Tue, 02 Jul 2019 12:59:58 -0400
changeset 42621 99ebde4fec99
parent 31919 2bf73e351eb1
permissions -rw-r--r--
commit: improve the files field of changelog for merges Currently, the files list of merge commits repeats all the deletions (either actual deletions, or files that got renamed) that happened between base and p2 of the merge. If p2 is the main branch, the list can easily be much bigger than the change being merged. This results in various problems worth improving: - changelog is bigger than necessary - `hg log directory` lists many unrelated merge commits, and `hg log -v -r commit` frequently fills multiple screens worth of files - it possibly slows down adjustlinkrev, by forcing it to read more manifests, and that function can certainly be a bottleneck - the server side of pulls can waste a lot of time simply opening the filelogs for pointless files (the constant factors for opening even a tiny filelog is apparently pretty bad) So stop listing such files as described in the code. Impacted merge commits and their descendants get a different hash than they would have without this. This doesn't seem problematic, except for convert. The previous commit helped with that in the hg->hg case (but if you do svn->hg twice from scratch, hashes can still change). The rest of the description is numbers. I don't have much to report, because recreating the files list of existing repositories is not easy: - debugupgradeformat and bundle/unbundle don't recreate the list - export/import tends to choke quickly applying patches or on description that contain diffs, - merge commits from the convert extension don't have the right files list for reasons orthogonal to the current commit - replaying the merge with hg update/hg merge/hg revert --all/hg commit can end up failing in hg revert - I wasn't sure that using debugsetparents + debugrebuilddirstate would really build the right thing I measured commit time before and after this change, in a case with no files filtered out, several files filtered out (no difference) and 5k files filtered out (+1% time). Recreating the 100 more recent merges in a private repo, the concatenated uncompressed files lists goes from 1.12MB to 0.52MB. Excluding 3 merges that are not representative, then the size goes from 570k to 15k. I converted part of mozilla-central, and observed file list shrinking quite a bit too, starting at the very first merge, 733641d9feaf, going from 550 files to 10 files (although they have relatively few merges, so they probably wouldn't care). Differential Revision: https://phab.mercurial-scm.org/D6613
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
31919
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
============================================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing obsolescence markers push: Cases B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
============================================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
Mercurial pushes obsolescences markers relevant to the "pushed-set", the set of
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
all changesets that requested to be "in sync" after the push (even if they are
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
already on both side).
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     9
This test belongs to a series of tests checking such set is properly computed
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
and applied. This does not tests "obsmarkers" discovery capabilities.
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
Category B: pruning case
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
TestCase 7: Prune on non-targeted common changeset
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
B.7 Prune above non-targeted common changeset
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
=============================================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. (very similar to B1, but the prune changeset is unknown on remote)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
.. {{{
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
..     ⊗ B
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
..     |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
..     ◕ A
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
..     |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
..     ● O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. }}}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
.. Marker exist from:
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
..  * B (prune)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
.. Command runs:
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
..  * hg push -r O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
.. Expected exclude:
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
..  * B (prune)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
Setup
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
-----
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
  $ . $TESTDIR/testlib/exchange-obsmarker-util.sh
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    45
Initial
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ setuprepos B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  creating test repo for test case B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  - pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  - main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  - pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  cd into `main` and proceed with env setup
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  $ cd main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    54
  $ mkcommit A
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  $ hg push -q ../pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  $ hg push -q ../pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  $ mkcommit B
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  $ hg prune -qd '0 0' .
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    59
  $ hg log -G --hidden
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  x  f6fbb35d8ac9 (draft): B
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  @  f5bc6836db60 (draft): A
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  |
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  o  a9bdc8b26820 (public): O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  $ inspect_obsmarkers
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  obsstore content
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    68
  ================
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
  $ cd ..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
  $ cd ..
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
Actual Test
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
-------------------------------------
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    75
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  $ dotest B.7 O
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  ## Running testcase B.7
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
  # testing echange of "O" (a9bdc8b26820)
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  ## initial state
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
  # obstore: main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    82
  # obstore: pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  # obstore: pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
  ## pushing "O" from main to pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
  pushing to pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
  searching for changes
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    87
  no changes found
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    88
  ## post push state
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    89
  # obstore: main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    90
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    91
  # obstore: pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    92
  # obstore: pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    93
  ## pulling "a9bdc8b26820" from main into pulldest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    94
  pulling from main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    95
  no changes found
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    96
  ## post pull state
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    97
  # obstore: main
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    98
  f6fbb35d8ac958bbe70035e4c789c18471cdc0af 0 {f5bc6836db60e308a17ba08bf050154ba9c4fad7} (Thu Jan 01 00:00:00 1970 +0000) {'user': 'test'}
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    99
  # obstore: pushdest
2bf73e351eb1 obsolescence: add test case B-7 for obsolescence markers exchange
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   100
  # obstore: pulldest