tests/test-push-checkheads-pruned-B8.t
branchstable
changeset 2277 61d885899466
parent 2255 5b33df335b6c
child 2710 e22de367fc74
equal deleted inserted replaced
2276:2d55ae0d6ce7 2277:61d885899466
       
     1 ====================================
       
     2 Testing head checking code: Case B-2
       
     3 ====================================
       
     4 
       
     5 Mercurial checks for the introduction of new heads on push. Evolution comes
       
     6 into play to detect if existing branches on the server are being replaced by
       
     7 some of the new one we push.
       
     8 
       
     9 This case is part of a series of tests checking this behavior.
       
    10 
       
    11 Category B: 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/push-checkheads-util.sh
       
    38 
       
    39 Test setup
       
    40 ----------
       
    41 
       
    42   $ mkdir B8
       
    43   $ cd B8
       
    44   $ setuprepos
       
    45   creating basic server and client repo
       
    46   updating to branch default
       
    47   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    48   $ cd server
       
    49   $ mkcommit B0
       
    50   $ cd ../client
       
    51   $ hg pull
       
    52   pulling from $TESTTMP/B8/server (glob)
       
    53   searching for changes
       
    54   adding changesets
       
    55   adding manifests
       
    56   adding file changes
       
    57   added 1 changesets with 1 changes to 1 files
       
    58   (run 'hg update' to get a working copy)
       
    59   $ hg up 0
       
    60   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    61   $ mkcommit A1
       
    62   created new head
       
    63   $ mkcommit B1
       
    64   $ hg up 0
       
    65   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
    66   $ mkcommit A2
       
    67   created new head
       
    68   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    69   $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
       
    70   $ hg debugobsolete --record-parents `getid "desc(B1)"`
       
    71   $ hg debugobsolete `getid "desc(A1)" ` `getid "desc(A2)"`
       
    72   $ hg log -G --hidden
       
    73   @  c1f8d089020f (draft): A2
       
    74   |
       
    75   | x  262c8c798096 (draft): B1
       
    76   | |
       
    77   | x  f6082bc4ffef (draft): A1
       
    78   |/
       
    79   | x  d73caddc5533 (draft): B0
       
    80   | |
       
    81   | x  8aaa48160adc (draft): A0
       
    82   |/
       
    83   o  1e4be0697311 (public): root
       
    84   
       
    85 
       
    86 Actual testing
       
    87 --------------
       
    88 
       
    89   $ hg push
       
    90   pushing to $TESTTMP/B8/server (glob)
       
    91   searching for changes
       
    92   adding changesets
       
    93   adding manifests
       
    94   adding file changes
       
    95   added 1 changesets with 1 changes to 1 files (+1 heads)
       
    96   4 new obsolescence markers
       
    97 
       
    98   $ cd ../..