tests/test-single-head-obsolescence-topic-B2.t
author Anton Shestakov <av6@dwimlabs.net>
Thu, 07 May 2020 01:29:48 +0200
changeset 5349 e8660b28bfee
parent 5274 fa1324e58fcf
child 5279 35e769c9604f
permissions -rw-r--r--
obslog: makes --origin flag the default Test change have been carefully validated.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     1
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     2
=========================================
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     3
Testing single head enforcement: Case A-2
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     4
=========================================
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     5
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     6
A repository is set to only accept a single head per name (typically named
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     7
branch). However, obsolete changesets can make this enforcement more
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     8
complicated, because they can be kept visible by other changeset on other
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
     9
branch.
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    10
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    11
This case is part of a series of tests checking this behavior.
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    12
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    13
Category B: Involving obsolescence with topic
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    14
TestCase 2: A branch is split in two, effectively creating two heads
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    15
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    16
.. old-state:
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    17
..
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    18
.. * 2 changeset changeset on topic X
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    19
.. * 2 changeset changeset on topic Y on top of them.
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    20
..
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    21
.. new-state:
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    22
..
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    23
.. * 2 changeset changeset on topic Y at the same location
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    24
.. * 1 changeset changeset on topic X unchanged
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    25
.. * 1 changeset changeset on topic X superceeding the other ones
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    26
..
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    27
.. expected-result:
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    28
..
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    29
.. * two heads detected
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    30
..
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    31
.. graph-summary:
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    32
..
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    33
..   D       (topic-Y)
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    34
..     |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    35
..   C       (topic-Y)
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    36
..     |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    37
..   B ø⇠◔ B' (topic-X)
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    38
..     | |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    39
..   A ● |    (topic-X)
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    40
..     |/
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    41
..     ●
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    42
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    43
  $ . $TESTDIR/testlib/topic_setup.sh
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    44
  $ . $TESTDIR/testlib/push-checkheads-util.sh
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    45
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    46
Test setup
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    47
----------
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    48
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    49
  $ mkdir B2
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    50
  $ cd B2
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    51
  $ setuprepos single-head
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    52
  creating basic server and client repo
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    53
  updating to branch default
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    54
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    55
  $ cd client
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    56
  $ hg topic -r . topic-X
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    57
  switching to topic topic-X
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    58
  changed topic on 1 changesets to "topic-X"
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    59
  $ hg strip --config extensions.strip= --hidden 'hidden()' --no-backup # clean old A0
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    60
  $ mkcommit B0
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    61
  $ hg branch Z
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    62
  marked working directory as branch Z
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    63
  $ hg topic topic-Y
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    64
  $ mkcommit C0
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    65
  active topic 'topic-Y' grew its first changeset
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    66
  (see 'hg help topics' for more information)
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    67
  $ mkcommit D0
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    68
  $ hg push --new-branch
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    69
  pushing to $TESTTMP/B2/server
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    70
  searching for changes
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    71
  adding changesets
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    72
  adding manifests
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    73
  adding file changes
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    74
  added 4 changesets with 3 changes to 4 files (+1 heads)
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    75
  1 new obsolescence markers
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    76
  obsoleted 1 changesets
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    77
  $ hg up 0
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    78
  0 files updated, 0 files merged, 4 files removed, 0 files unresolved
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    79
  $ hg topic topic-X
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    80
  marked working directory as topic: topic-X
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    81
  $ mkcommit B1
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    82
  $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    83
  1 new obsolescence markers
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    84
  obsoleted 1 changesets
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    85
  2 new orphan changesets
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    86
  $ hg log -G --hidden
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    87
  @  5a4735b75167 [default:topic-X] (draft): B1
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    88
  |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    89
  | *  02490b2dd1c5 [Z:topic-Y] (draft): D0
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    90
  | |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    91
  | *  447ad8382abc [Z:topic-Y] (draft): C0
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    92
  | |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    93
  | x  1c1f62b56685 [default:topic-X] (draft): B0
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    94
  | |
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
    95
  | o  5a47a98cd8e5 [default:topic-X] (draft): A0
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    96
  |/
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    97
  o  1e4be0697311 [default] (public): root
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    98
  
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
    99
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   100
Actual testing
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   101
--------------
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   102
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   103
(force push to make sure we get the changeset on the remote)
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   104
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   105
  $ hg push -r 'desc("B1")' --force
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
   106
  pushing to $TESTTMP/B2/server
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   107
  searching for changes
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   108
  adding changesets
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   109
  adding manifests
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   110
  adding file changes
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   111
  transaction abort!
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   112
  rollback completed
5274
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
   113
  abort: rejecting multiple heads on branch "default:topic-X"
fa1324e58fcf head-checking: also test single head enforcement with topic
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 5272
diff changeset
   114
  (2 heads: 5a47a98cd8e5 5a4735b75167)
5272
b20d04641c0f head-checking: ignore obsolete section when checking for single heads
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
diff changeset
   115
  [255]