tests/test-checkheads-pruned-B5.t
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
Tue, 21 Mar 2017 12:30:53 +0100
changeset 2247 2320a7e3cbd7
child 2251 2f71f6234b06
permissions -rw-r--r--
checkheads: basic handling of pruned heads (and associated tests) We now detect that heads was pruned and stop warning about it. Note that this has the same shortcoming as the existing code and only looks at the heads.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2247
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     1
====================================
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     2
Testing head checking code: Case B-5
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     3
====================================
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     4
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     5
Mercurial checks for the introduction of multiple heads on push. Evolution
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
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
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     7
some of the new heads we push.
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
     8
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
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.
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    10
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    11
Category B: checking simple case involving pruned changesets
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    12
TestCase 5: multi-changeset branch, mix of pruned and superceeded
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    13
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    14
.. old-state:
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    15
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    16
.. * 3 changeset branch
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    17
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    18
.. new-state:
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    19
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    20
.. * old head is pruned
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    21
.. * old mid is superceeded
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    22
.. * old root is pruned
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    23
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    24
.. expected-result:
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    25
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    26
.. * push allowed
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    27
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    28
.. graph-summary:
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    29
..
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    30
..   B 
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    31
..     |
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    32
..   A ø⇠◔ A'
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    33
..     | |
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    34
..   B ⊗ |
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    35
..     |/
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    36
..     ○
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    37
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    38
  $ . $TESTDIR/testlib/checkheads-util.sh
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    39
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    40
Test setup
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    41
----------
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    42
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    43
  $ setuprepos
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    44
  creating basic server and client repo
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    45
  updating to branch default
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    46
  2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    47
  $ cd server
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    48
  $ mkcommit B0
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    49
  $ mkcommit C0
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    50
  $ cd ../client
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    51
  $ hg pull
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    52
  pulling from $TESTTMP/server
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    53
  searching for changes
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    54
  adding changesets
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    55
  adding manifests
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    56
  adding file changes
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    57
  added 2 changesets with 2 changes to 2 files
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    58
  (run 'hg update' to get a working copy)
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    59
  $ hg up 0
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    60
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    61
  $ mkcommit B1
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    62
  created new head
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    63
  $ hg debugobsolete `getid "desc(A0)"`
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    64
  $ hg debugobsolete `getid "desc(B0)"` `getid "desc(B1)"`
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    65
  $ hg debugobsolete `getid "desc(C0)"`
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    66
  $ hg log -G --hidden
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    67
  @  25c56d33e4c4 (draft): B1
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    68
  |
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    69
  | x  821fb21d0dd2 (draft): C0
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    70
  | |
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    71
  | x  d73caddc5533 (draft): B0
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    72
  | |
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    73
  | x  8aaa48160adc (draft): A0
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    74
  |/
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    75
  o  1e4be0697311 (public): root
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    76
  
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    77
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    78
Actual testing
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    79
--------------
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    80
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    81
  $ hg push
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    82
  pushing to $TESTTMP/server
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    83
  searching for changes
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    84
  adding changesets
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    85
  adding manifests
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    86
  adding file changes
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    87
  added 1 changesets with 1 changes to 1 files (+1 heads)
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    88
  1 new obsolescence markers
2320a7e3cbd7 checkheads: basic handling of pruned heads (and associated tests)
Pierre-Yves David <pierre-yves.david@ens-lyon.org>
parents:
diff changeset
    89