tests/test-pull-branch
branchstable
changeset 12795 3cb0559e44d0
parent 12793 469850088fc1
parent 12794 6bf8d48bec8e
child 12796 bc69ba99e34b
equal deleted inserted replaced
12793:469850088fc1 12795:3cb0559e44d0
     1 #!/bin/sh
       
     2 
       
     3 hg init t
       
     4 cd t
       
     5 echo 1 > foo
       
     6 hg ci -Am1 # 0
       
     7 hg branch branchA
       
     8 echo a1 > foo
       
     9 hg ci -ma1 # 1
       
    10 
       
    11 cd ..
       
    12 hg init tt
       
    13 cd tt
       
    14 hg pull ../t
       
    15 hg up branchA
       
    16 
       
    17 cd ../t
       
    18 echo a2 > foo
       
    19 hg ci -ma2 # 2
       
    20 echo % create branch B
       
    21 hg up 0
       
    22 hg branch branchB
       
    23 echo b1 > foo
       
    24 hg ci -mb1 # 3
       
    25 
       
    26 cd ../tt
       
    27 echo % a new branch is there
       
    28 hg pull -u ../t
       
    29 
       
    30 echo % develop both branch
       
    31 cd ../t
       
    32 hg up branchA
       
    33 echo a3 > foo
       
    34 hg ci -ma3 # 4
       
    35 hg up branchB
       
    36 echo b2 > foo
       
    37 hg ci -mb2 # 5
       
    38 
       
    39 cd ../tt
       
    40 echo % should succeed, no new heads
       
    41 hg pull -u ../t
       
    42 
       
    43 echo % add an head on other branch
       
    44 cd ../t
       
    45 hg up branchA
       
    46 echo a4 > foo
       
    47 hg ci -ma4 # 6
       
    48 hg up branchB
       
    49 echo b3.1 > foo
       
    50 hg ci -m b3.1 # 7
       
    51 hg up 5
       
    52 echo b3.2 > foo
       
    53 hg ci -m b3.2 # 8
       
    54 
       
    55 cd ../tt
       
    56 echo % should succeed only one head on our branch
       
    57 hg pull -u ../t
       
    58 
       
    59 cd ../t
       
    60 hg up -C branchA
       
    61 echo a5.1 > foo
       
    62 hg ci -ma5.1 # 9
       
    63 hg up 6
       
    64 echo a5.2 > foo
       
    65 hg ci -ma5.2 # 10
       
    66 hg up 7
       
    67 echo b4.1 > foo
       
    68 hg ci -m b4.1 # 11
       
    69 hg up -C 8
       
    70 echo b4.2 > foo
       
    71 hg ci -m b4.2 # 12
       
    72 
       
    73 cd ../tt
       
    74 echo % should fail new head in our branch
       
    75 hg pull -u ../t