Show More
@@ -0,0 +1,12 b'' | |||
|
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) |
@@ -4,14 +4,6 b'' | |||
|
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 |
@@ -25,16 +17,16 b' hg archive -t zip -p zip ../archive.zip' | |||
|
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 |
@@ -18,7 +18,7 b' echo % symlink is left parent, executabl' | |||
|
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 |
@@ -30,7 +30,7 b' echo % symlink is right parent, executab' | |||
|
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 |
@@ -3,17 +3,6 b'' | |||
|
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 |
@@ -21,14 +10,14 b' 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 |
@@ -7,14 +7,6 b' cleanpath()' | |||
|
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 |
@@ -25,29 +17,29 b" hg commit -m 'add symlink' -d '0 0'" | |||
|
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