tests/test-checkheads-unpushed-D6.t
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Fri, 31 Mar 2017 15:51:27 +0200
branchstable
changeset 2263 165ad227993d
parent 2256 7ec214ea5d67
permissions -rw-r--r--
packaging: prepare version 6.0.0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2256
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
====================================
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing head checking code: Case D-6
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
====================================
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
Mercurial checks for the introduction of multiple heads on push. Evolution
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     6
comes into play to detect if existing heads on the server are being replaced by
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
some of the new heads we push.
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     9
This test file is part of a series of tests checking this behavior.
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
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.
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
TestCase 6: single changesets, superseeded then pruned (on a new changeset unpushed) changeset
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
This is a partial push variation of B6
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
.. old-state:
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. * 1 changeset branch
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
.. new-state:
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
.. * old branch is rewritten onto another one,
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
.. * the new version is then pruned.
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
.. expected-result:
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
.. * push denied
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
.. graph-summary:
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
..
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..   A ø⇠⊗ A'
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
..     | |
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
.. C ◔ | ◔ B
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
..    \|/
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..     ●
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
  $ . $TESTDIR/testlib/checkheads-util.sh
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
Test setup
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
----------
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
  $ setuprepos
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
  creating basic server and client repo
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
  updating to branch default
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    45
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
  $ cd client
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ hg up 0
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  $ mkcommit B0
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  created new head
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  $ mkcommit A1
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  $ hg up '0'
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  0 files updated, 0 files merged, 2 files removed, 0 files unresolved
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    54
  $ mkcommit C0
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  created new head
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  $ hg debugobsolete `getid "desc(A0)"` `getid "desc(A1)"`
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  $ hg debugobsolete --record-parents `getid "desc(A1)"`
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  $ hg log -G --hidden
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    59
  @  0f88766e02d6 (draft): C0
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  |
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  | x  ba93660aff8d (draft): A1
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  | |
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  | o  74ff5441d343 (draft): B0
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  |/
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  | x  8aaa48160adc (draft): A0
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  |/
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  o  1e4be0697311 (public): root
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    68
  
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
Actual testing
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
--------------
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
  $ hg push --rev 'desc(C0)'
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  pushing to $TESTTMP/server
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    75
  searching for changes
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  abort: push creates new remote head 0f88766e02d6!
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  (merge or see 'hg help push' for details about pushing new heads)
7ec214ea5d67 checkheahds: switch algorithm to use pushed markers instead
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
  [255]