tests/test-checkheads-unpushed-D3.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-3
       
     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 3: multi-changeset branch, split on multiple new others, only one of them is pushed
       
    13 
       
    14 .. old-state:
       
    15 ..
       
    16 .. * 2 changesets branch
       
    17 ..
       
    18 .. new-state:
       
    19 ..
       
    20 .. * 2 new branches, each superseding one changeset in the old one.
       
    21 ..
       
    22 .. expected-result:
       
    23 ..
       
    24 .. * pushing only one of the resulting branch (either of them)
       
    25 .. * push denied
       
    26 ..
       
    27 .. graph-summary:
       
    28 ..
       
    29 .. B'◔⇢ø B
       
    30 ..   | |
       
    31 .. A | ø⇠◔ A'
       
    32 ..   | |/
       
    33 ..    \|
       
    34 ..     ●
       
    35 
       
    36   $ . $TESTDIR/testlib/checkheads-util.sh
       
    37 
       
    38 Test setup
       
    39 ----------
       
    40 
       
    41   $ setuprepos
       
    42   creating basic server and client repo
       
    43   updating to branch default
       
    44   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    45   $ cd server
       
    46   $ mkcommit B0
       
    47   $ hg up 0
       
    48   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
       
    49   $ cd ../client
       
    50   $ hg pull
       
    51   pulling from $TESTTMP/server
       
    52   searching for changes
       
    53   adding changesets
       
    54   adding manifests
       
    55   adding file changes
       
    56   added 1 changesets with 1 changes to 1 files
       
    57   (run 'hg update' to get a working copy)
       
    58   $ hg up 0
       
    59   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    60   $ mkcommit A1
       
    61   created new head
       
    62   $ hg up '0'
       
    63   0 files updated, 0 files merged, 1 files removed, 0 files unresolved
       
    64   $ mkcommit B1
       
    65   created new head
       
    66   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    67   $ hg debugobsolete `getid "desc(B0)" ` `getid "desc(B1)"`
       
    68   $ hg log -G --hidden
       
    69   @  25c56d33e4c4 (draft): B1
       
    70   |
       
    71   | o  f6082bc4ffef (draft): A1
       
    72   |/
       
    73   | x  d73caddc5533 (draft): B0
       
    74   | |
       
    75   | x  8aaa48160adc (draft): A0
       
    76   |/
       
    77   o  1e4be0697311 (public): root
       
    78   
       
    79 
       
    80 
       
    81 Actual testing
       
    82 --------------
       
    83 
       
    84   $ hg push --rev 'desc(A1)'
       
    85   pushing to $TESTTMP/server
       
    86   searching for changes
       
    87   abort: push creates new remote head f6082bc4ffef!
       
    88   (merge or see 'hg help push' for details about pushing new heads)
       
    89   [255]
       
    90   $ hg push --rev 'desc(B1)'
       
    91   pushing to $TESTTMP/server
       
    92   searching for changes
       
    93   abort: push creates new remote head 25c56d33e4c4!
       
    94   (merge or see 'hg help push' for details about pushing new heads)
       
    95   [255]
       
    96 
       
    97 Extra testing
       
    98 -------------
       
    99 
       
   100 In this case, even a bare push is creating more heads
       
   101 
       
   102   $ hg push
       
   103   pushing to $TESTTMP/server
       
   104   searching for changes
       
   105   abort: push creates new remote head 25c56d33e4c4!
       
   106   (merge or see 'hg help push' for details about pushing new heads)
       
   107   [255]