tests/test-checkheads-superceed-A6.t
branchmercurial-4.0
changeset 2278 2db189baf8b7
parent 2260 e200dbfb4515
parent 2277 61d885899466
child 2279 347849e17876
child 2318 523855eb28c1
equal deleted inserted replaced
2260:e200dbfb4515 2278:2db189baf8b7
     1 ====================================
       
     2 Testing head checking code: Case A-6
       
     3 ====================================
       
     4 
       
     5 Mercurial checks for the introduction of multiple heads on push. Evolution
       
     6 comes into play to detect if existing heads on the server are being replaced by
       
     7 some of the new heads we push.
       
     8 
       
     9 This test file is part of a series of tests checking this behavior.
       
    10 
       
    11 Category A: checking simple case invoving a branch being superceeded by another.
       
    12 TestCase 6: multi-changeset branch, split on multiple other, (base on its own branch)
       
    13 
       
    14 .. old-state:
       
    15 ..
       
    16 .. * 2 branch (1 changeset, and 2 changesets)
       
    17 ..
       
    18 .. new-state:
       
    19 ..
       
    20 .. * 1 new branch superceeding the base of the old-2-changesets-branch,
       
    21 .. * 1 new changesets on the old-1-changeset-branch superceeding the head of the other
       
    22 ..
       
    23 .. expected-result:
       
    24 ..
       
    25 .. * push allowed
       
    26 ..
       
    27 .. graph-summary:
       
    28 ..
       
    29 .. B'◔⇢ø B
       
    30 ..   | |
       
    31 .. A | ø⇠◔ A'
       
    32 ..   | |/
       
    33 .. C ● |
       
    34 ..    \|
       
    35 ..     ●
       
    36 
       
    37   $ . $TESTDIR/testlib/checkheads-util.sh
       
    38 
       
    39 Test setup
       
    40 ----------
       
    41 
       
    42   $ setuprepos
       
    43   creating basic server and client repo
       
    44   updating to branch default
       
    45   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    46   $ cd server
       
    47   $ mkcommit B0
       
    48   $ hg up 0
       
    49   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
    50   $ mkcommit C0
       
    51   created new head
       
    52   $ cd ../client
       
    53   $ hg pull
       
    54   pulling from $TESTTMP/server
       
    55   searching for changes
       
    56   adding changesets
       
    57   adding manifests
       
    58   adding file changes
       
    59   added 2 changesets with 2 changes to 2 files (+1 heads)
       
    60   (run 'hg heads' to see heads, 'hg merge' to merge)
       
    61   $ hg up 0
       
    62   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    63   $ mkcommit A1
       
    64   created new head
       
    65   $ hg up 'desc(C0)'
       
    66   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    67   $ mkcommit B1
       
    68   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    69   $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
       
    70   $ hg log -G --hidden
       
    71   @  d70a1f75a020 (draft): B1
       
    72   |
       
    73   | o  f6082bc4ffef (draft): A1
       
    74   | |
       
    75   o |  0f88766e02d6 (draft): C0
       
    76   |/
       
    77   | x  d73caddc5533 (draft): B0
       
    78   | |
       
    79   | x  8aaa48160adc (draft): A0
       
    80   |/
       
    81   o  1e4be0697311 (public): root
       
    82   
       
    83 
       
    84 
       
    85 Actual testing
       
    86 --------------
       
    87 
       
    88   $ hg push
       
    89   pushing to $TESTTMP/server
       
    90   searching for changes
       
    91   adding changesets
       
    92   adding manifests
       
    93   adding file changes
       
    94   added 2 changesets with 2 changes to 2 files (+1 heads)
       
    95   2 new obsolescence markers