Show More
@@ -0,0 +1,12 | |||
|
1 | #!/usr/bin/env python | |
|
2 | ||
|
3 | import errno, os, sys | |
|
4 | ||
|
5 | for f in sys.argv[1:]: | |
|
6 | try: | |
|
7 | print f, '->', os.readlink(f) | |
|
8 | except OSError, err: | |
|
9 | if err.errno != errno.EINVAL: raise | |
|
10 | print f, 'not a symlink' | |
|
11 | ||
|
12 | sys.exit(0) |
@@ -1,40 +1,32 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" symlink || exit 80 |
|
4 | 4 | |
|
5 | 5 | origdir=`pwd` |
|
6 | 6 | |
|
7 | cat >> readlink.py <<EOF | |
|
8 | import os | |
|
9 | import sys | |
|
10 | ||
|
11 | for f in sys.argv[1:]: | |
|
12 | print f, '->', os.readlink(f) | |
|
13 | EOF | |
|
14 | ||
|
15 | 7 | hg init repo |
|
16 | 8 | cd repo |
|
17 | 9 | ln -s nothing dangling |
|
18 | 10 | # avoid tar warnings about old timestamp |
|
19 | 11 | hg ci -d '2000-01-01 00:00:00 +0000' -qAm 'add symlink' |
|
20 | 12 | |
|
21 | 13 | hg archive -t files ../archive |
|
22 | 14 | hg archive -t tar -p tar ../archive.tar |
|
23 | 15 | hg archive -t zip -p zip ../archive.zip |
|
24 | 16 | |
|
25 | 17 | echo '% files' |
|
26 | 18 | cd "$origdir" |
|
27 | 19 | cd archive |
|
28 |
|
|
|
20 | $TESTDIR/readlink.py dangling | |
|
29 | 21 | |
|
30 | 22 | echo '% tar' |
|
31 | 23 | cd "$origdir" |
|
32 | 24 | tar xf archive.tar |
|
33 | 25 | cd tar |
|
34 |
|
|
|
26 | $TESTDIR/readlink.py dangling | |
|
35 | 27 | |
|
36 | 28 | echo '% zip' |
|
37 | 29 | cd "$origdir" |
|
38 | 30 | unzip archive.zip > /dev/null |
|
39 | 31 | cd zip |
|
40 |
|
|
|
32 | $TESTDIR/readlink.py dangling |
@@ -1,36 +1,36 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | hg init |
|
4 | 4 | echo a > a |
|
5 | 5 | hg ci -Amadd |
|
6 | 6 | |
|
7 | 7 | chmod +x a |
|
8 | 8 | hg ci -mexecutable |
|
9 | 9 | |
|
10 | 10 | hg up 0 |
|
11 | 11 | rm a |
|
12 | 12 | ln -s symlink a |
|
13 | 13 | hg ci -msymlink |
|
14 | 14 | |
|
15 | 15 | hg merge |
|
16 | 16 | |
|
17 | 17 | echo % symlink is left parent, executable is right |
|
18 | 18 | |
|
19 | 19 | if [ -h a ]; then |
|
20 | 20 | echo a is a symlink |
|
21 | readlink a | |
|
21 | $TESTDIR/readlink.py a | |
|
22 | 22 | elif [ -x a ]; then |
|
23 | 23 | echo a is executable |
|
24 | 24 | fi |
|
25 | 25 | |
|
26 | 26 | hg update -C 1 |
|
27 | 27 | hg merge |
|
28 | 28 | |
|
29 | 29 | echo % symlink is right parent, executable is left |
|
30 | 30 | |
|
31 | 31 | if [ -h a ]; then |
|
32 | 32 | echo a is a symlink |
|
33 | readlink a | |
|
33 | $TESTDIR/readlink.py a | |
|
34 | 34 | elif [ -x a ]; then |
|
35 | 35 | echo a is executable |
|
36 | 36 | fi |
@@ -1,34 +1,23 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | echo "[extensions]" >> $HGRCPATH |
|
4 | 4 | echo "mq=" >> $HGRCPATH |
|
5 | 5 | |
|
6 | cat >> readlink.py <<EOF | |
|
7 | import errno, os, sys | |
|
8 | ||
|
9 | for f in sys.argv[1:]: | |
|
10 | try: | |
|
11 | print f, '->', os.readlink(f) | |
|
12 | except OSError, err: | |
|
13 | if err.errno != errno.EINVAL: raise | |
|
14 | print f, 'not a symlink' | |
|
15 | EOF | |
|
16 | ||
|
17 | 6 | hg init |
|
18 | 7 | hg qinit |
|
19 | 8 | hg qnew base.patch |
|
20 | 9 | echo a > a |
|
21 | 10 | echo b > b |
|
22 | 11 | hg add a b |
|
23 | 12 | hg qrefresh |
|
24 |
|
|
|
13 | $TESTDIR/readlink.py a | |
|
25 | 14 | |
|
26 | 15 | hg qnew symlink.patch |
|
27 | 16 | rm a |
|
28 | 17 | ln -s b a |
|
29 | 18 | hg qrefresh --git |
|
30 |
|
|
|
19 | $TESTDIR/readlink.py a | |
|
31 | 20 | |
|
32 | 21 | hg qpop |
|
33 | 22 | hg qpush |
|
34 |
|
|
|
23 | $TESTDIR/readlink.py a |
@@ -1,53 +1,45 | |||
|
1 | 1 | #!/bin/sh |
|
2 | 2 | |
|
3 | 3 | "$TESTDIR/hghave" symlink || exit 80 |
|
4 | 4 | |
|
5 | 5 | cleanpath() |
|
6 | 6 | { |
|
7 | 7 | sed -e "s:/.*\(/test-symlink-basic/.*\):...\1:" |
|
8 | 8 | } |
|
9 | 9 | |
|
10 | cat >> readlink.py <<EOF | |
|
11 | import os | |
|
12 | import sys | |
|
13 | ||
|
14 | for f in sys.argv[1:]: | |
|
15 | print f, '->', os.readlink(f) | |
|
16 | EOF | |
|
17 | ||
|
18 | 10 | hg init a |
|
19 | 11 | cd a |
|
20 | 12 | ln -s nothing dangling |
|
21 | 13 | hg commit -m 'commit symlink without adding' -d '0 0' dangling 2>&1 | cleanpath |
|
22 | 14 | hg add dangling |
|
23 | 15 | hg commit -m 'add symlink' -d '0 0' |
|
24 | 16 | |
|
25 | 17 | hg tip -v |
|
26 | 18 | hg manifest --debug |
|
27 | 19 | echo '% rev 0:' |
|
28 |
|
|
|
20 | $TESTDIR/readlink.py dangling | |
|
29 | 21 | |
|
30 | 22 | rm dangling |
|
31 | 23 | ln -s void dangling |
|
32 | 24 | hg commit -m 'change symlink' |
|
33 | 25 | echo '% rev 1:' |
|
34 |
|
|
|
26 | $TESTDIR/readlink.py dangling | |
|
35 | 27 | |
|
36 | 28 | echo '% modifying link' |
|
37 | 29 | rm dangling |
|
38 | 30 | ln -s empty dangling |
|
39 |
|
|
|
31 | $TESTDIR/readlink.py dangling | |
|
40 | 32 | |
|
41 | 33 | echo '% reverting to rev 0:' |
|
42 | 34 | hg revert -r 0 -a |
|
43 |
|
|
|
35 | $TESTDIR/readlink.py dangling | |
|
44 | 36 | |
|
45 | 37 | echo '% backups:' |
|
46 |
|
|
|
38 | $TESTDIR/readlink.py *.orig | |
|
47 | 39 | |
|
48 | 40 | rm *.orig |
|
49 | 41 | hg up -C |
|
50 | 42 | echo '% copies' |
|
51 | 43 | hg cp -v dangling dangling2 |
|
52 | 44 | hg st -Cmard |
|
53 |
|
|
|
45 | $TESTDIR/readlink.py dangling dangling2 |
General Comments 0
You need to be logged in to leave comments.
Login now