tests/test-checkheads-unpushed-D2.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 D-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 D: remote head is "obs-affected" locally, but result is not part of the push.
       
    12 TestCase 1: remote branch has 2 changes, head is pruned, second is rewritten but result is not pushed
       
    13 
       
    14 .. old-state:
       
    15 ..
       
    16 .. * 1 changeset branch
       
    17 ..
       
    18 .. new-state:
       
    19 ..
       
    20 .. * old head is pruned
       
    21 .. * 1 new branch succeeding to the other changeset in the old branch
       
    22 .. * 1 new unrelated branch
       
    23 ..
       
    24 .. expected-result:
       
    25 ..
       
    26 .. * push allowed
       
    27 .. * pushing only the unrelated branch: denied
       
    28 ..
       
    29 .. graph-summary:
       
    30 ..
       
    31 ..   B ⊗
       
    32 ..     |
       
    33 ..   A ø⇠○ A'
       
    34 ..     |/
       
    35 ..     | ◔ C
       
    36 ..     |/
       
    37 ..     ○
       
    38 
       
    39   $ . $TESTDIR/testlib/checkheads-util.sh
       
    40 
       
    41 Test setup
       
    42 ----------
       
    43 
       
    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/server
       
    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   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    64   $ hg debugobsolete --record-parents `getid "desc(B0)"`
       
    65   $ hg up 0
       
    66   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    67   $ mkcommit C0
       
    68   created new head
       
    69   $ hg log -G --hidden
       
    70   @  0f88766e02d6 (draft): C0
       
    71   |
       
    72   | o  f6082bc4ffef (draft): A1
       
    73   |/
       
    74   | x  d73caddc5533 (draft): B0
       
    75   | |
       
    76   | x  8aaa48160adc (draft): A0
       
    77   |/
       
    78   o  1e4be0697311 (public): root
       
    79   
       
    80 
       
    81 Actual testing
       
    82 --------------
       
    83 
       
    84   $ hg push --rev 'desc(C0)'
       
    85   pushing to $TESTTMP/server
       
    86   searching for changes
       
    87   abort: push creates new remote head 0f88766e02d6!
       
    88   (merge or see 'hg help push' for details about pushing new heads)
       
    89   [255]
       
    90