tests/test-rename-after-merge
author Martin Geisler <mg@lazybytes.net>
Thu, 09 Apr 2009 14:43:02 +0200
changeset 8039 18081ce1e630
parent 7689 d821ea464465
permissions -rwxr-xr-x
commands: automatically word-wrap cmdline options Some of the descriptions of command line options were getting quite long, and when translated they are likely to grow even longer. This word-wraps them at 70 characters, just like the help texts. We could have opted to wrap them at the terminal width instead, but I think it looks better to have them be consistent with the help texts.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5318
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     1
#!/bin/sh
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     2
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     3
# Test issue 746: renaming files brought by the
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     4
# second parent of a merge was broken.
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     5
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     6
echo % create source repository
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     7
hg init t
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     8
cd t
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
     9
echo a > a
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    10
hg ci -Am a
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    11
cd ..
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    12
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    13
echo % fork source repository
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    14
hg clone t t2
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    15
cd t2
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    16
echo b > b
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    17
hg ci -Am b
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    18
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    19
echo % update source repository
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    20
cd ../t
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    21
echo a >> a
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    22
hg ci -m a2
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    23
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    24
echo % merge repositories
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    25
hg pull ../t2
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    26
hg merge
5608
784eadabd985 copy: simplify inner copy
Matt Mackall <mpm@selenic.com>
parents: 5318
diff changeset
    27
hg st
5318
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    28
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    29
echo % rename b as c
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    30
hg mv b c
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    31
hg st
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    32
echo % rename back c as b
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    33
hg mv c b
c6682cdada2f Test renaming files brought by merge second parent (issue 746)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
    34
hg st
7689
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    35
cd ..
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    36
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    37
# Test issue 1476: renaming a first parent file into
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    38
# another first parent file while none of them belong to
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    39
# the second parent was broken
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    40
echo % test issue 1476
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    41
hg init repo1476
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    42
cd repo1476
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    43
echo a > a
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    44
hg ci -Am adda
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    45
echo b1 > b1
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    46
echo b2 > b2
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    47
hg ci -Am changea
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    48
hg up -C 0
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    49
echo c1 > c1
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    50
echo c2 > c2
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    51
hg ci -Am addcandd
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    52
echo % merge heads
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    53
hg merge
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    54
hg mv -Af c1 c2
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    55
echo % commit issue 1476
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    56
hg ci -m merge
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    57
hg log -r tip -C -v | grep copies
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    58
hg rollback
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    59
hg up -C .
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    60
echo % merge heads again
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    61
hg merge
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    62
hg mv -Af b1 b2
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    63
echo % commit issue 1476 with a rename on the other side
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    64
hg ci -m merge
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    65
hg log -r tip -C -v | grep copies
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    66
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    67
d821ea464465 Fix a corner case when committing a rename after a merge (issue1476)
Patrick Mezard <pmezard@gmail.com>
parents: 5608
diff changeset
    68