tests/test-push-checkheads-unpushed-D2.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Fri, 20 Oct 2017 23:03:11 +0200
changeset 3122 c80ba40d4c87
parent 3075 8feb2cae7eae
child 3100 ccfcacc5ee7c
child 3431 2e703ed1c713
permissions -rw-r--r--
branching: merge stable back into default
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
3075
8feb2cae7eae test: adapt to output change from eb586ed5d8ce
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2754
diff changeset
    60
  new changesets d73caddc5533
2250
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  (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
    62
  $ hg up 0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  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
    64
  $ mkcommit A1
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  created new head
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  $ 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
    67
  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
    68
  $ 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
    69
  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
    70
  $ hg up 0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
  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
    72
  $ mkcommit C0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
  created new head
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  $ 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
    75
  @  0f88766e02d6 (draft): C0
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  |
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  | 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
    78
  |/
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  | 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
    80
  | |
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  | 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
    82
  |/
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  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
    84
  
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
Actual testing
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
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    89
  $ 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
    90
  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
    91
  searching for changes
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    92
  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
    93
  (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
    94
  [255]
2b4e2e93b7db checkheads: add some extra tests about "partial push"
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    95
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2251
diff changeset
    96
  $ cd ../..