tests/test-checkheads-pruned-B8.t
changeset 2285 080b9384d741
parent 2265 dad84c052463
parent 2284 1b6d4d176145
child 2286 a4c5744a7b93
equal deleted inserted replaced
2265:dad84c052463 2285:080b9384d741
     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