tests/test-checkheads-unpushed-D4.t
branchstable
changeset 2277 61d885899466
parent 2276 2d55ae0d6ce7
child 2278 2db189baf8b7
child 2281 812b866f193c
equal deleted inserted replaced
2276:2d55ae0d6ce7 2277:61d885899466
     1 ====================================
       
     2 Testing head checking code: Case D-4
       
     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 D: remote head is "obs-affected" locally, but result is not part of the push.
       
    12 TestCase 4: multi-changeset branch, split on multiple other, (base on its own new 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 the new branch only -> push denied
       
    26 .. * push the existing branch only -> push allowed
       
    27 ..
       
    28 .. graph-summary:
       
    29 ..
       
    30 .. B'◔⇢ø B
       
    31 ..   | |
       
    32 .. A | ø⇠◔ A'
       
    33 ..   | |/
       
    34 .. C ● |
       
    35 ..    \|
       
    36 ..     ●
       
    37 
       
    38   $ . $TESTDIR/testlib/checkheads-util.sh
       
    39 
       
    40 Test setup
       
    41 ----------
       
    42 
       
    43   $ setuprepos
       
    44   creating basic server and client repo
       
    45   updating to branch default
       
    46   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    47   $ cd server
       
    48   $ mkcommit B0
       
    49   $ hg up 0
       
    50   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
    51   $ mkcommit C0
       
    52   created new head
       
    53   $ cd ../client
       
    54   $ hg pull
       
    55   pulling from $TESTTMP/server
       
    56   searching for changes
       
    57   adding changesets
       
    58   adding manifests
       
    59   adding file changes
       
    60   added 2 changesets with 2 changes to 2 files (+1 heads)
       
    61   (run 'hg heads' to see heads, 'hg merge' to merge)
       
    62   $ hg up 0
       
    63   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    64   $ mkcommit A1
       
    65   created new head
       
    66   $ hg up 'desc(C0)'
       
    67   1 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    68   $ mkcommit B1
       
    69   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    70   $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
       
    71   $ hg log -G --hidden
       
    72   @  d70a1f75a020 (draft): B1
       
    73   |
       
    74   | o  f6082bc4ffef (draft): A1
       
    75   | |
       
    76   o |  0f88766e02d6 (draft): C0
       
    77   |/
       
    78   | x  d73caddc5533 (draft): B0
       
    79   | |
       
    80   | x  8aaa48160adc (draft): A0
       
    81   |/
       
    82   o  1e4be0697311 (public): root
       
    83   
       
    84 
       
    85 
       
    86 Actual testing
       
    87 --------------
       
    88 
       
    89   $ hg push --rev 'desc(A1)'
       
    90   pushing to $TESTTMP/server
       
    91   searching for changes
       
    92   abort: push creates new remote head f6082bc4ffef!
       
    93   (merge or see 'hg help push' for details about pushing new heads)
       
    94   [255]
       
    95   $ hg push --rev 'desc(B1)'
       
    96   pushing to $TESTTMP/server
       
    97   searching for changes
       
    98   adding changesets
       
    99   adding manifests
       
   100   adding file changes
       
   101   added 1 changesets with 1 changes to 1 files
       
   102   1 new obsolescence markers