tests/test-symlink-basic
author Thomas Arendsen Hein <thomas@intevation.de>
Thu, 14 Jun 2007 12:54:06 +0200
changeset 4583 11cf78983961
parent 4570 6a8e1dd18ba2
child 4882 25d753efd48e
permissions -rwxr-xr-x
Reverted changesets 9d1380e5c8c5 and 1d46169ec197: show @ as glog parent again. Repainted the bikeshed with its original color.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4264
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     1
#!/bin/sh
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     2
4570
6a8e1dd18ba2 commands.commit: symlinks are supported
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4264
diff changeset
     3
cleanpath()
6a8e1dd18ba2 commands.commit: symlinks are supported
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4264
diff changeset
     4
{
6a8e1dd18ba2 commands.commit: symlinks are supported
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4264
diff changeset
     5
    sed -e "s:/.*\(/test-symlink-basic/.*\):...\1:"
6a8e1dd18ba2 commands.commit: symlinks are supported
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4264
diff changeset
     6
}
6a8e1dd18ba2 commands.commit: symlinks are supported
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4264
diff changeset
     7
4264
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     8
cat >> readlink.py <<EOF
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
     9
import os
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    10
import sys
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    11
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    12
for f in sys.argv[1:]:
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    13
    print f, '->', os.readlink(f)
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    14
EOF
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    15
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    16
hg init a
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    17
cd a
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    18
ln -s nothing dangling
4570
6a8e1dd18ba2 commands.commit: symlinks are supported
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 4264
diff changeset
    19
hg commit -m 'commit symlink without adding' -d '0 0' dangling 2>&1 | cleanpath
4264
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    20
hg add dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    21
hg commit -m 'add symlink' -d '0 0'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    22
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    23
hg tip -v
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    24
hg manifest --debug
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    25
echo '% rev 0:'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    26
python ../readlink.py dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    27
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    28
rm dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    29
ln -s void dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    30
hg commit -m 'change symlink'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    31
echo '% rev 1:'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    32
python ../readlink.py dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    33
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    34
echo '% modifying link'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    35
rm dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    36
ln -s empty dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    37
python ../readlink.py dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    38
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    39
echo '% reverting to rev 0:'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    40
hg revert -r 0 -a
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    41
python ../readlink.py dangling
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    42
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    43
echo '% backups:'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    44
python ../readlink.py *.orig
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    45
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    46
rm *.orig
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    47
hg up -C
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    48
echo '% copies'
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    49
hg cp -v dangling dangling2
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    50
hg st -Cmard
af4f0d52f948 Add some tests for symlink tracking
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff changeset
    51
python ../readlink.py dangling dangling2