tests/test-push-checkheads-superceed-A8.t
author Kyle Lippincott <spectral@google.com>
Mon, 16 Sep 2019 12:44:38 -0700
changeset 4848 535ab2609e45
parent 4840 62b60fc1983d
child 4860 015cdd3fa469
permissions -rw-r--r--
cmdstate: introduce a "saver" contextmanager and use it in place of save() Previously, the state was only saved in some paths out of these functions. This can be problematic, if the user ctrl-c's (or `kill -9`'s) the process, or we exit out of `relocate` for anything besides the "expected" reason, we won't record that we were in the middle of an evolve. One of our users has discovered that this leaves hg in a weird state; the user did something like this: ``` $ hg evolve <something goes wrong with the merge tool, hits ctrl-c> <deals with the merge conflicts> $ hg evolve --continue abort: no interrupted evolve to continue $ hg evolve abort: uncommitted changes # Note: commands.status.verbose=True is set. $ hg status M foo # The repository is in an unfinished *update* state. # No unresolved merge conflicts # To continue: hg update ``` The user did an `hg update`, but it didn't actually do anything besides take it out of the unfinished update state (the files were still dirty in the working directory).
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
====================================
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing head checking code: Case A-8
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
====================================
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
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: 2255
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: 2255
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: 2255
diff changeset
     7
some of the new one we push.
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
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: 2255
diff changeset
     9
This case is part of a series of tests checking this behavior.
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
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: 2255
diff changeset
    11
Category A: simple case involving a branch being superceeded by another.
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
TestCase 8: single-changeset branch indirect rewrite
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
.. old-state:
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
..
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    16
.. * 1-changeset branch
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
..
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. new-state:
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    20
.. * 1-changeset branch succeeding to A, through another unpushed changesets
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
..
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
.. expected-result:
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
..
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
.. * push allowed
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
..
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. graph-summary:
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
..
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
..       A'
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
..   A ø⇠ø⇠◔ A''
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
..     |/ /
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..     | /
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
..     |/
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    33
..     ●
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    35
  $ . $TESTDIR/testlib/push-checkheads-util.sh
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
Test setup
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
----------
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
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: 2255
diff changeset
    40
  $ mkdir A8
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    41
  $ cd A8
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
  $ setuprepos
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
  creating basic server and client repo
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
  updating to branch default
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
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
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
  $ cd client
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ hg up 0
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
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
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  $ mkcommit A1
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  created new head
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  $ hg up 0
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  $ mkcommit A2
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    54
  created new head
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
4840
62b60fc1983d test: change to output around transaction timing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2754
diff changeset
    56
  1 new obsolescence markers
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
    57
  obsoleted 1 changesets
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"`
4840
62b60fc1983d test: change to output around transaction timing
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2754
diff changeset
    59
  1 new obsolescence markers
2754
21f06d932231 test: update test output to match b11e8c67fb0f
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2710
diff changeset
    60
  obsoleted 1 changesets
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  $ hg log -G --hidden
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  @  c1f8d089020f (draft): A2
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  |
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  | x  f6082bc4ffef (draft): A1
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  |/
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  | x  8aaa48160adc (draft): A0
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  |/
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    68
  o  1e4be0697311 (public): root
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
Actual testing
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
--------------
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  $ hg push
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    75
  pushing to $TESTTMP/A8/server (glob)
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  searching for changes
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
  adding changesets
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
  adding manifests
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
  adding file changes
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
  added 1 changesets with 1 changes to 1 files (+1 heads)
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  2 new obsolescence markers
2710
e22de367fc74 compat: adapt to change in 53b3a1968aa6-core
Pierre-Yves David <pierre-yves.david@octobus.net>
parents: 2277
diff changeset
    82
  obsoleted 1 changesets
2255
5b33df335b6c checkheads: add test where the rewrite of the other branch is not direct
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
2277
61d885899466 checkheads: update tests to match the one in core
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents: 2255
diff changeset
    84
  $ cd ../..