tests/test-rename-after-merge
changeset 12279 28e2e3804f2e
parent 12278 c4c2ba553401
child 12280 6ee719f56f01
equal deleted inserted replaced
12278:c4c2ba553401 12279:28e2e3804f2e
     1 #!/bin/sh
       
     2 
       
     3 # Test issue 746: renaming files brought by the
       
     4 # second parent of a merge was broken.
       
     5 
       
     6 echo % create source repository
       
     7 hg init t
       
     8 cd t
       
     9 echo a > a
       
    10 hg ci -Am a
       
    11 cd ..
       
    12 
       
    13 echo % fork source repository
       
    14 hg clone t t2
       
    15 cd t2
       
    16 echo b > b
       
    17 hg ci -Am b
       
    18 
       
    19 echo % update source repository
       
    20 cd ../t
       
    21 echo a >> a
       
    22 hg ci -m a2
       
    23 
       
    24 echo % merge repositories
       
    25 hg pull ../t2
       
    26 hg merge
       
    27 hg st
       
    28 
       
    29 echo % rename b as c
       
    30 hg mv b c
       
    31 hg st
       
    32 echo % rename back c as b
       
    33 hg mv c b
       
    34 hg st
       
    35 cd ..
       
    36 
       
    37 # Test issue 1476: renaming a first parent file into
       
    38 # another first parent file while none of them belong to
       
    39 # the second parent was broken
       
    40 echo % test issue 1476
       
    41 hg init repo1476
       
    42 cd repo1476
       
    43 echo a > a
       
    44 hg ci -Am adda
       
    45 echo b1 > b1
       
    46 echo b2 > b2
       
    47 hg ci -Am changea
       
    48 hg up -C 0
       
    49 echo c1 > c1
       
    50 echo c2 > c2
       
    51 hg ci -Am addcandd
       
    52 echo % merge heads
       
    53 hg merge
       
    54 hg mv -Af c1 c2
       
    55 echo % commit issue 1476
       
    56 hg ci -m merge
       
    57 hg log -r tip -C -v | grep copies
       
    58 hg rollback
       
    59 hg up -C .
       
    60 echo % merge heads again
       
    61 hg merge
       
    62 hg mv -Af b1 b2
       
    63 echo % commit issue 1476 with a rename on the other side
       
    64 hg ci -m merge
       
    65 hg log -r tip -C -v | grep copies
       
    66 
       
    67 
       
    68