tests/test-parents
author Matt Mackall <mpm@selenic.com>
Wed, 01 Aug 2007 12:33:12 -0500
changeset 5045 f191bc3916f7
parent 4894 be5dc5e3ab2d
child 5299 5a4824f6665c
permissions -rwxr-xr-x
merge: do early copy to deal with issue636 Without copies/renames, merges source names are 1:1 with their targets. Copies and renames introduce the possibility that there will be two merges with the same input but different output. By doing the copy to the destination name before the merge, the actual merge becomes 1:1 again, and no source is the input to two different merges. - add a preliminary scan to applyupdates to do copies - for the merge action, pass the old name (for finding ancestors) and the new name (for input to the merge) to filemerge - eliminate the old post-merge copy - lookup file contents from new name in filemerge - pass new name to external merge helper - report merge failure at new name - add a test
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4584
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     1
#!/bin/sh
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     2
# test parents command
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     3
4894
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
     4
hg init repo
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
     5
cd repo
4584
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     6
echo % no working directory
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     7
hg parents
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     8
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
     9
echo a > a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    10
echo b > b
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    11
hg ci -Amab -d '0 0'
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    12
echo a >> a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    13
hg ci -Ama -d '1 0'
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    14
echo b >> b
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    15
hg ci -Amb -d '2 0'
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    16
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    17
echo % hg parents
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    18
hg parents
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    19
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    20
echo % hg parents a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    21
hg parents a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    22
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    23
echo % hg parents -r 2
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    24
hg parents -r 2
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    25
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    26
echo % hg parents -r 2 a
0d26e3d0eeeb Make parents with a file but not a revision use working directory revision.
Brendan Cully <brendan@kublai.com>
parents:
diff changeset
    27
hg parents -r 2 a
4894
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    28
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    29
echo % hg parents -r 2 ../a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    30
hg parents -r 2 ../a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    31
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    32
echo '% cd dir; hg parents -r 2 ../a'
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    33
mkdir dir
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    34
cd dir
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    35
hg parents -r 2 ../a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    36
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    37
echo '% hg parents -r 2 path:a'
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    38
hg parents -r 2 path:a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    39
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    40
echo '% hg parents -r 2 glob:a'
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    41
cd ..
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    42
hg parents -r 2 glob:a
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    43
be5dc5e3ab2d hg parents: don't pass an OS-specific path to repo.filectx
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4584
diff changeset
    44
true