tests/test-checkheads-pruned-B8.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 B-2
       
     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 B: checking simple case involving pruned changesets
       
    12 TestCase 2: multi-changeset branch, head is pruned, rest is superceeded, through other
       
    13 
       
    14 .. old-state:
       
    15 ..
       
    16 .. * 2 changeset branch
       
    17 ..
       
    18 .. new-state:
       
    19 ..
       
    20 .. * old head is rewritten then pruned
       
    21 .. * 1 new branch succeeding to the other changeset in the old branch (through another obsolete branch)
       
    22 ..
       
    23 .. expected-result:
       
    24 ..
       
    25 .. * push allowed
       
    26 ..
       
    27 .. graph-summary:
       
    28 ..
       
    29 ..   B ø⇠⊗ B'
       
    30 ..     | | A'
       
    31 ..   A ø⇠ø⇠◔ A''
       
    32 ..     |/ /
       
    33 ..     | /
       
    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   $ cd ../client
       
    49   $ hg pull
       
    50   pulling from $TESTTMP/server
       
    51   searching for changes
       
    52   adding changesets
       
    53   adding manifests
       
    54   adding file changes
       
    55   added 1 changesets with 1 changes to 1 files
       
    56   (run 'hg update' to get a working copy)
       
    57   $ hg up 0
       
    58   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    59   $ mkcommit A1
       
    60   created new head
       
    61   $ mkcommit B1
       
    62   $ hg up 0
       
    63   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
    64   $ mkcommit A2
       
    65   created new head
       
    66   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    67   $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
       
    68   $ hg debugobsolete --record-parents `getid "desc(B1)"`
       
    69   $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"`
       
    70   $ hg log -G --hidden
       
    71   @  c1f8d089020f (draft): A2
       
    72   |
       
    73   | x  262c8c798096 (draft): B1
       
    74   | |
       
    75   | x  f6082bc4ffef (draft): A1
       
    76   |/
       
    77   | x  d73caddc5533 (draft): B0
       
    78   | |
       
    79   | x  8aaa48160adc (draft): A0
       
    80   |/
       
    81   o  1e4be0697311 (public): root
       
    82   
       
    83 
       
    84 Actual testing
       
    85 --------------
       
    86 
       
    87   $ hg push
       
    88   pushing to $TESTTMP/server
       
    89   searching for changes
       
    90   adding changesets
       
    91   adding manifests
       
    92   adding file changes
       
    93   added 1 changesets with 1 changes to 1 files (+1 heads)
       
    94   4 new obsolescence markers
       
    95