Mercurial > hg
annotate tests/test-ssh-clone-r @ 11769:ca6cebd8734e stable
dirstate: ignore symlinks when fs cannot handle them (issue1888)
When the filesystem cannot handle the executable bit, we currently
ignore it completely when looking for modified files. Similarly, it is
impossible to set or clear the bit when the filesystem ignores it.
This patch makes Mercurial treat symbolic links the same way.
Symlinks are a little different since they manifest themselves as
small files containing a filename (the symlink target). On Windows,
these files show up as regular files, and on Linux and Mac they show
up as real symlinks.
Issue1888 presents a case where the symlink files are better ignored
from the Windows side. A Linux client creates symlinks in a working
copy which is shared over a network between Linux and Windows clients.
The Samba server is helpful and defererences the symlink when the
Windows client looks at it. This means that Mercurial on the Windows
side sees file content instead of a file name in the symlink, and
hence flags the link as modified. Ignoring the change would be much
more helpful, similarly to how Mercurial does not report any changes
when executable bits are ignored in a checkout on Windows.
An initial checkout of a symbolic link on a file system that cannot
handle symbolic links will still result in a regular file containing
the target file name as its content. Sharing such a checkout with a
Linux client will not turn the file into a symlink automatically, but
'hg revert' can fix that. After the revert, the Windows client will
see the correct file content (provided by the Samba server when it
follows the link on the Linux side) and otherwise ignore the change.
Running 'hg perfstatus' 10 times gives these results:
Before: After:
min: 0.544703 min: 0.546549
med: 0.547592 med: 0.548881
avg: 0.549146 avg: 0.548549
max: 0.564112 max: 0.551504
The median time is increased about 0.24%.
author | Martin Geisler <mg@aragost.com> |
---|---|
date | Mon, 09 Aug 2010 15:31:56 +0200 |
parents | 6b1e1b9da853 |
children |
rev | line source |
---|---|
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
1 #!/bin/sh |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
2 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
3 # This test tries to exercise the ssh functionality with a dummy script |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
4 |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
5 cat <<EOF > dummyssh |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
6 import sys |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
7 import os |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
8 |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
9 os.chdir(os.path.dirname(sys.argv[0])) |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
10 if sys.argv[1] != "user@dummy": |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
11 sys.exit(-1) |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
12 |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
13 if not os.path.exists("dummyssh"): |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
14 sys.exit(-1) |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
15 |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
16 os.environ["SSH_CLIENT"] = "127.0.0.1 1 2" |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
17 |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
18 log = open("dummylog", "ab") |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
19 log.write("Got arguments") |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
20 for i, arg in enumerate(sys.argv[1:]): |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
21 log.write(" %d:%s" % (i+1, arg)) |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
22 log.write("\n") |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
23 log.close() |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
24 r = os.system(sys.argv[2]) |
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
25 sys.exit(bool(r)) |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
26 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
27 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
28 hg init remote |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
29 cd remote |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
30 echo "# creating 'remote'" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
31 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
32 0 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
33 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
34 hg add afile |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
35 hg commit -m "0.0" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
36 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
37 1 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
38 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
39 hg commit -m "0.1" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
40 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
41 2 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
42 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
43 hg commit -m "0.2" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
44 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
45 3 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
46 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
47 hg commit -m "0.3" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
48 hg update -C 0 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
49 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
50 1 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
51 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
52 hg commit -m "1.1" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
53 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
54 2 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
55 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
56 hg commit -m "1.2" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
57 cat >fred <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
58 a line |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
59 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
60 cat >>afile <<EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
61 3 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
62 EOF |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
63 hg add fred |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
64 hg commit -m "1.3" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
65 hg mv afile adifferentfile |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
66 hg commit -m "1.3m" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
67 hg update -C 3 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
68 hg mv afile anotherfile |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
69 hg commit -m "0.3m" |
3853
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3449
diff
changeset
|
70 hg debugindex .hg/store/data/afile.i |
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3449
diff
changeset
|
71 hg debugindex .hg/store/data/adifferentfile.i |
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3449
diff
changeset
|
72 hg debugindex .hg/store/data/anotherfile.i |
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3449
diff
changeset
|
73 hg debugindex .hg/store/data/fred.i |
c0b449154a90
switch to the .hg/store layout, fix the tests
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
3449
diff
changeset
|
74 hg debugindex .hg/store/00manifest.i |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
75 hg verify |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
76 cd .. |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
77 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
78 echo "# clone remote via stream" |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
79 for i in 0 1 2 3 4 5 6 7 8; do |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
80 hg clone -e "python ./dummyssh" --uncompressed -r "$i" ssh://user@dummy/remote test-"$i" 2>&1 |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
81 if cd test-"$i"; then |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
82 hg verify |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
83 cd .. |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
84 fi |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
85 done |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
86 cd test-8 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
87 hg pull ../test-7 |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
88 hg verify |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
89 cd .. |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
90 cd test-1 |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
91 hg pull -e "python ../dummyssh" -r 4 ssh://user@dummy/remote 2>&1 |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
92 hg verify |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
93 hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1 |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
94 cd .. |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
95 cd test-2 |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
96 hg pull -e "python ../dummyssh" -r 5 ssh://user@dummy/remote 2>&1 |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
97 hg verify |
4299
6b1e1b9da853
test-ssh-clone-r: avoid a shell script
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
3853
diff
changeset
|
98 hg pull -e "python ../dummyssh" ssh://user@dummy/remote 2>&1 |
3449
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
99 hg verify |
c8686e3f0291
Testing the new changegroupsubset remote function in the ssh
Eric Hopper <hopper@omnifarious.org>
parents:
diff
changeset
|
100 cd .. |