tests/test-archive-symlinks
author Matt Mackall <mpm@selenic.com>
Wed, 01 Aug 2007 12:33:12 -0500
changeset 5045 f191bc3916f7
parent 4862 6f08bc1bd00b
child 5085 92d7ce0da063
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:
4862
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     1
#!/bin/sh
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     2
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     3
origdir=`pwd`
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     4
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     5
cat >> readlink.py <<EOF
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     6
import os
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     7
import sys
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     8
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     9
for f in sys.argv[1:]:
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
    print f, '->', os.readlink(f)
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    11
EOF
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    12
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    13
hg init repo
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    14
cd repo
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    15
ln -s nothing dangling
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    16
hg ci -qAm 'add symlink'
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    17
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    18
hg archive -t files ../archive
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    19
hg archive -t tar -p tar ../archive.tar
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    20
hg archive -t zip -p zip ../archive.zip
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    21
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    22
echo '% files'
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    23
cd "$origdir"
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    24
cd archive
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    25
python ../readlink.py dangling
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    26
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    27
echo '% tar'
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    28
cd "$origdir"
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    29
tar xf archive.tar
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    30
cd tar
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    31
python ../readlink.py dangling
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    32
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    33
echo '% zip'
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    34
cd "$origdir"
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    35
unzip archive.zip > /dev/null
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    36
cd zip
6f08bc1bd00b archive: add symlink support
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    37
python ../readlink.py dangling