tests/test-push-checkheads-unpushed-D5.t
author Anton Shestakov <av6@dwimlabs.net>
Sat, 29 Jun 2019 18:21:57 +0800
branchstable
changeset 4699 dfd88e3fa90a
parent 4471 3caa4a459439
child 4512 7a779a288793
child 4840 62b60fc1983d
permissions -rw-r--r--
prune: update to the successor of wdir also with --pair/--biject (issue6142) When prune is used with --pair flag, we can also update to the successor of working directory parent. No need to check len(sucs) or len(precs) here because there's a check for that earlier in the code (it's a requirement of biject). The tests are now demonstrate the correct behavior: when rev 14 was pruned with 12 as its successor, the bookmark that was on 14 was moved to 12. That bookmark was also activated (even before this patch).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
====================================
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing head checking code: Case D-5
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
====================================
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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: 2253
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: 2253
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: 2253
diff changeset
     7
some of the new one we push.
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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: 2253
diff changeset
     9
This case is part of a series of tests checking this behavior.
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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: 2253
diff changeset
    11
Category D: remote head is "obs-affected" locally, but result is not part of the push
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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)
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
.. old-state:
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
.. * 2 branch (1 changeset, and 2 changesets)
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. new-state:
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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,
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
.. expected-result:
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
.. * push the new branch only -> push denied
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. * push the existing branch only -> push allowed
4471
3caa4a459439 tests: use current instability names everywhere
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4181
diff changeset
    27
..   /!\ This push create instability/orphaning on the other hand and we should
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
..  probably detect/warn agains that.
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
.. graph-summary:
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
..   B ø⇠◔ B'
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
..     | |
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
.. A'◔⇢ø |
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..   | |/
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
.. C  |
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
..    \|
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
..     
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
    40
  $ . $TESTDIR/testlib/push-checkheads-util.sh
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
Test setup
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
----------
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
    45
  $ mkdir D5
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
    46
  $ cd D5
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ setuprepos
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  creating basic server and client repo
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  updating to branch default
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  $ cd server
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  $ mkcommit B0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  $ hg up 0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  $ mkcommit C0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  created new head
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  $ cd ../client
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  $ hg pull
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
    59
  pulling from $TESTTMP/D5/server (glob)
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  searching for changes
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  adding changesets
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  adding manifests
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  adding file changes
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  added 2 changesets with 2 changes to 2 files (+1 heads)
4181
ab3581bc0637 branching: preserve the expected output on default
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 4165
diff changeset
    65
  new changesets d73caddc5533:0f88766e02d6 (2 drafts)
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  (run 'hg heads' to see heads, 'hg merge' to merge)
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  $ hg up 'desc(C0)'
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  $ mkcommit A1
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
  $ hg up 0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
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
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
  $ mkcommit B1
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
  created new head
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  $ 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: 2710
diff changeset
    75
  obsoleted 1 changesets
3431
2e703ed1c713 evolve: update output for wider reporting of troubled changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 3075
diff changeset
    76
  1 new orphan changesets
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
    78
  obsoleted 1 changesets
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  $ hg log -G --hidden
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
  @  25c56d33e4c4 (draft): B1
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  |
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    82
  | o  a0802eb7fc1b (draft): A1
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  | |
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
  | o  0f88766e02d6 (draft): C0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
  |/
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
  | x  d73caddc5533 (draft): B0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    87
  | |
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    88
  | x  8aaa48160adc (draft): A0
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    89
  |/
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    90
  o  1e4be0697311 (public): root
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    91
  
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    92
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    93
Actual testing
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    94
--------------
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    95
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    96
  $ hg push --rev 'desc(B1)'
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
    97
  pushing to $TESTTMP/D5/server (glob)
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    98
  searching for changes
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    99
  abort: push creates new remote head 25c56d33e4c4!
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   100
  (merge or see 'hg help push' for details about pushing new heads)
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   101
  [255]
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   102
  $ hg push --rev 'desc(A1)'
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
   103
  pushing to $TESTTMP/D5/server (glob)
2253
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   104
  searching for changes
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   105
  adding changesets
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   106
  adding manifests
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   107
  adding file changes
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   108
  added 1 changesets with 1 changes to 1 files
75f73c031208 checkheads: add more complexe case where a branch is split on multiple ones
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
   109
  1 new obsolescence markers
2710
e22de367fc74 compat: adapt to change in 53b3a1968aa6-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2277
diff changeset
   110
  obsoleted 1 changesets
3431
2e703ed1c713 evolve: update output for wider reporting of troubled changesets
Martin von Zweigbergk <martinvonz@google.com>
parents: 3075
diff changeset
   111
  1 new orphan changesets
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
   112
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2253
diff changeset
   113
  $ cd ../..