tests/test-push-checkheads-unpushed-D2.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 10 Oct 2017 16:22:21 +0200
branchstable
changeset 3050 6603d5655192
parent 2754 21f06d932231
child 2798 2280461343e5
child 3075 8feb2cae7eae
permissions -rw-r--r--
obsfate: add a test with user both current and other This will help highlight change in the next changesets.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
====================================
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing head checking code: Case D-2
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
====================================
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
     5
Mercurial checks for the introduction of new heads on push. Evolution comes
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
     6
into play to detect if existing branches on the server are being replaced by
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
     7
some of the new one we push.
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
     9
This case is part of a series of tests checking this behavior.
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    11
Category D: remote head is "obs-affected" locally, but result is not part of the push
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    12
TestCase 1: remote branch has 2 changes, head is pruned, other is rewritten but result is not pushed
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
.. old-state:
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
.. * 1 changeset branch
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. new-state:
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
.. * old head is pruned
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
.. * 1 new branch succeeding to the other changeset in the old branch
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
.. * 1 new unrelated branch
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
.. expected-result:
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. * push allowed
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
.. * pushing only the unrelated branch: denied
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
.. graph-summary:
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
..
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..   B 
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
..     |
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
..   A ø⇠○ A'
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
..     |/
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..     | ◔ C
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
..     |/
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    37
..     ●
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    39
  $ . $TESTDIR/testlib/push-checkheads-util.sh
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
Test setup
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
----------
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    44
  $ mkdir D2
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    45
  $ cd D2
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
  $ setuprepos
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  creating basic server and client repo
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  updating to branch default
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  $ cd server
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  $ mkcommit B0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  $ cd ../client
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  $ hg pull
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    54
  pulling from $TESTTMP/D2/server (glob)
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  searching for changes
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  adding changesets
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  adding manifests
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  adding file changes
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    59
  added 1 changesets with 1 changes to 1 files
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  (run 'hg update' to get a working copy)
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  $ hg up 0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  $ mkcommit A1
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  created new head
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2277
diff changeset
    66
  obsoleted 1 changesets
2251
2f71f6234b06 checkheads-tests: add missing parents recording for prune markers
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2250
diff changeset
    67
  $ hg debugobsolete --record-parents `getid "desc(B0)"`
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2277
diff changeset
    68
  obsoleted 1 changesets
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  $ hg up 0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
  $ mkcommit C0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
  created new head
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
  $ hg log -G --hidden
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  @  0f88766e02d6 (draft): C0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    75
  |
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  | o  f6082bc4ffef (draft): A1
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  |/
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
  | x  d73caddc5533 (draft): B0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  | |
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
  | x  8aaa48160adc (draft): A0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  |/
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    82
  o  1e4be0697311 (public): root
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
Actual testing
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
--------------
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    87
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    88
  $ hg push --rev 'desc(C0)'
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    89
  pushing to $TESTTMP/D2/server (glob)
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    90
  searching for changes
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    91
  abort: push creates new remote head 0f88766e02d6!
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    92
  (merge or see 'hg help push' for details about pushing new heads)
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    93
  [255]
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    94
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    95
  $ cd ../..