tests/test-push-checkheads-unpushed-D5.t
author Boris Feld <boris.feld@octobus.net>
Fri, 13 Oct 2017 21:50:43 +0200
changeset 34754 a0a727104eed
parent 34661 eb586ed5d8ce
child 35393 4441705b7111
permissions -rw-r--r--
configitem: register the 'notify.changegroup' config
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
32017
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
====================================
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing head checking code: Case D-5
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
====================================
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
Mercurial checks for the introduction of new heads on push. Evolution comes
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
into play to detect if existing branches on the server are being replaced by
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
some of the new one we push.
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     9
This case is part of a series of tests checking this behavior.
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
Category D: remote head is "obs-affected" locally, but result is not part of the push
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
TestCase 5: multi-changeset branch, split on multiple other, (head on its own new branch)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
.. old-state:
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
.. * 2 branch (1 changeset, and 2 changesets)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. new-state:
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
.. * 1 new branch superceeding the head of the old-2-changesets-branch,
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
.. * 1 new changesets on the old-1-changeset-branch superceeding the base of the other
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
.. expected-result:
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
.. * push the new branch only -> push denied
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. * push the existing branch only -> push allowed
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
..   /!\ This push create unstability/orphaning on the other hand and we should
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
..  probably detect/warn agains that.
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
.. graph-summary:
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
..   B ø⇠◔ B'
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
..     | |
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
.. A'◔⇢ø |
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..   | |/
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
.. C ● |
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
..    \|
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
..     ●
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
  $ . $TESTDIR/testlib/push-checkheads-util.sh
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
Test setup
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
----------
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    45
  $ mkdir D5
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
  $ cd D5
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ setuprepos
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  creating basic server and client repo
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  updating to branch default
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  $ cd server
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  $ mkcommit B0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  $ hg up 0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    54
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  $ mkcommit C0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  created new head
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  $ cd ../client
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  $ hg pull
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    59
  pulling from $TESTTMP/D5/server (glob)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  searching for changes
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  adding changesets
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  adding manifests
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  adding file changes
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  added 2 changesets with 2 changes to 2 files (+1 heads)
34661
eb586ed5d8ce transaction-summary: show the range of new revisions upon pull/unbundle (BC)
Denis Laxalde <denis.laxalde@logilab.fr>
parents: 33542
diff changeset
    65
  new changesets d73caddc5533:0f88766e02d6
32017
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  (run 'hg heads' to see heads, 'hg merge' to merge)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  $ hg up 'desc(C0)'
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    68
  1 files updated, 0 files merged, 1 files removed, 0 files unresolved
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  $ mkcommit A1
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
  $ hg up 0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
  $ mkcommit B1
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
  created new head
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33252
diff changeset
    75
  obsoleted 1 changesets
32017
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
33542
b11e8c67fb0f debugobsolete: also report the number of obsoleted changesets
Boris Feld <boris.feld@octobus.net>
parents: 33252
diff changeset
    77
  obsoleted 1 changesets
32017
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
  $ hg log -G --hidden
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  @  25c56d33e4c4 (draft): B1
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
  |
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  | o  a0802eb7fc1b (draft): A1
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    82
  | |
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  | o  0f88766e02d6 (draft): C0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
  |/
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
  | x  d73caddc5533 (draft): B0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
  | |
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    87
  | x  8aaa48160adc (draft): A0
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    88
  |/
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    89
  o  1e4be0697311 (public): root
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    90
  
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    91
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    92
Actual testing
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    93
--------------
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    94
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    95
  $ hg push --rev 'desc(B1)'
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    96
  pushing to $TESTTMP/D5/server (glob)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    97
  searching for changes
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    98
  abort: push creates new remote head 25c56d33e4c4!
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    99
  (merge or see 'hg help push' for details about pushing new heads)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   100
  [255]
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   101
  $ hg push --rev 'desc(A1)'
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   102
  pushing to $TESTTMP/D5/server (glob)
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   103
  searching for changes
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   104
  adding changesets
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   105
  adding manifests
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   106
  adding file changes
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   107
  added 1 changesets with 1 changes to 1 files
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   108
  1 new obsolescence markers
33252
53b3a1968aa6 obsolete: reports the number of local changeset obsoleted when unbundling
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 32017
diff changeset
   109
  obsoleted 1 changesets
32017
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   110
9f7ba0daada1 obsolescence: add test for the "branch replacement" logic during push, case D5
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   111
  $ cd ../..