tests/test-push-checkheads-multibranches-E2.t
branchstable
changeset 5268 11c359b4071d
child 5279 35e769c9604f
equal deleted inserted replaced
5267:ba53591d4aab 5268:11c359b4071d
       
     1 ====================================
       
     2 Testing head checking code: Case E-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 E: case involving changeset on multiple branch
       
    12 TestCase 8: moving interleaved branch away from each other
       
    13 
       
    14 .. old-state:
       
    15 ..
       
    16 .. * 2-changeset on branch default
       
    17 .. * 1-changeset on branch Z (between the two other)
       
    18 ..
       
    19 .. new-state:
       
    20 ..
       
    21 .. * 2-changeset on branch default, aligned
       
    22 .. * 1-changeset on branch Z (at the same location)
       
    23 ..
       
    24 .. expected-result:
       
    25 ..
       
    26 .. * push allowed
       
    27 ..
       
    28 .. graph-summary:
       
    29 ..
       
    30 ..   C ø⇠◔ C'
       
    31 ..     | |
       
    32 ..   B ◔ |
       
    33 ..     | |
       
    34 ..   A ø⇠◔ A'
       
    35 ..     |/
       
    36 ..     ●
       
    37 
       
    38   $ . $TESTDIR/testlib/topic_setup.sh
       
    39   $ . $TESTDIR/testlib/push-checkheads-util.sh
       
    40 
       
    41 Test setup
       
    42 ----------
       
    43 
       
    44   $ mkdir E1
       
    45   $ cd E1
       
    46   $ setuprepos
       
    47   creating basic server and client repo
       
    48   updating to branch default
       
    49   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
       
    50   $ cd client
       
    51   $ hg branch Z
       
    52   marked working directory as branch Z
       
    53   (branches are permanent and global, did you want a bookmark?)
       
    54   $ mkcommit B0
       
    55   $ hg branch default --force
       
    56   marked working directory as branch default
       
    57   $ mkcommit C0
       
    58   created new head
       
    59   (consider using topic for lightweight branches. See 'hg help topic')
       
    60   $ hg push --new-branch
       
    61   pushing to $TESTTMP/E1/server
       
    62   searching for changes
       
    63   adding changesets
       
    64   adding manifests
       
    65   adding file changes
       
    66   added 2 changesets with 2 changes to 2 files
       
    67   $ hg up 0
       
    68   0 files updated, 0 files merged, 3 files removed, 0 files unresolved
       
    69   $ mkcommit A1
       
    70   created new head
       
    71   (consider using topic for lightweight branches. See 'hg help topic')
       
    72   $ mkcommit C1
       
    73   $ hg debugobsolete `getid "desc(A0)" ` `getid "desc(A1)"`
       
    74   1 new obsolescence markers
       
    75   obsoleted 1 changesets
       
    76   2 new orphan changesets
       
    77   $ hg debugobsolete `getid "desc(C0)" ` `getid "desc(C1)"`
       
    78   1 new obsolescence markers
       
    79   obsoleted 1 changesets
       
    80   $ hg log -G --hidden
       
    81   @  0c76bc104656 (draft): C1
       
    82   |
       
    83   o  f6082bc4ffef (draft): A1
       
    84   |
       
    85   | x  afc55ba2ce61 (draft): C0
       
    86   | |
       
    87   | *  93e5c1321ece (draft): B0
       
    88   | |
       
    89   | x  8aaa48160adc (draft): A0
       
    90   |/
       
    91   o  1e4be0697311 (public): root
       
    92   
       
    93 
       
    94 Actual testing
       
    95 --------------
       
    96 
       
    97   $ hg push -r 'desc("C1")'
       
    98   pushing to $TESTTMP/E1/server
       
    99   searching for changes
       
   100   adding changesets
       
   101   adding manifests
       
   102   adding file changes
       
   103   added 2 changesets with 2 changes to 2 files (+1 heads)
       
   104   2 new obsolescence markers
       
   105   obsoleted 2 changesets
       
   106   1 new orphan changesets
       
   107 
       
   108   $ cd ../..