tests/test-exchange-obsmarkers-case-B7.t
author Martin von Zweigbergk <martinvonz@google.com>
Thu, 17 Aug 2017 13:04:47 -0700
changeset 33886 13dc7f29531e
parent 31919 2bf73e351eb1
permissions -rw-r--r--
exchange: don't attempt phase exchange if phase-heads was in bundle The Mercurial core server doesn't yet include phase-heads parts in the bundle, but our Google-internal server wants to do that. Unfortunately, the usual exchange still happens even if phase-heads part is included (including the short-circuited one for old/publishing servers). That means that even if our server (again, the Google-internal one, but also future Mercurial core servers) includes a phase-heads part to indicate that some heads should be drafts, that would still get overwritten by the phase updating that happens after. So let's fix that by marking the phase step done if we receive at least one phase-heads part in the bundle. Differential Revision: https://phab.mercurial-scm.org/D440
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