Mercurial > hg
annotate tests/test-mq-missingfiles @ 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 | abd2bc899d86 |
children |
rev | line source |
---|---|
5581
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 # Test issue835: |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 # qpush fails immediately when patching a missing file, but |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 # remaining added files are still created empty which will |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 # trick a future qrefresh. |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 cat > writelines.py <<EOF |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 import sys |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 path = sys.argv[1] |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 args = sys.argv[2:] |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 assert (len(args) % 2) == 0 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 f = file(path, 'wb') |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 for i in xrange(len(args)/2): |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 count, s = args[2*i:2*i+2] |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 count = int(count) |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 s = s.decode('string_escape') |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 f.write(s*count) |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 f.close() |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 EOF |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 echo "[extensions]" >> $HGRCPATH |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 echo "mq=" >> $HGRCPATH |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 hg init normal |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 cd normal |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 python ../writelines.py b 10 'a\n' |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 hg ci -Am addb |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 echo a > a |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 python ../writelines.py b 2 'b\n' 10 'a\n' 2 'c\n' |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 echo c > c |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 hg add a c |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 hg qnew -f changeb |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 hg qpop |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 hg rm b |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 hg ci -Am rmb |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 echo % push patch with missing target |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 hg qpush |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 echo % display added files |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 cat a |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 cat c |
5652
e90e72c6b4c7
patch: write rej files for missing targets (issue 853)
Patrick Mezard <pmezard@gmail.com>
parents:
5581
diff
changeset
|
44 echo % display rejections |
e90e72c6b4c7
patch: write rej files for missing targets (issue 853)
Patrick Mezard <pmezard@gmail.com>
parents:
5581
diff
changeset
|
45 cat b.rej |
5581
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 cd .. |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
47 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
48 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 echo "[diff]" >> $HGRCPATH |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
50 echo "git=1" >> $HGRCPATH |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 hg init git |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 cd git |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
54 python ../writelines.py b 1 '\x00' |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 hg ci -Am addb |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 echo a > a |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 python ../writelines.py b 1 '\x01' 1 '\x00' |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
58 echo c > c |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
59 hg add a c |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
60 hg qnew -f changeb |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
61 hg qpop |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
62 hg rm b |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
63 hg ci -Am rmb |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
64 echo % push git patch with missing target |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
65 hg qpush 2>&1 | sed -e 's/b:.*/b: No such file or directory/' |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
66 hg st |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
67 echo % display added files |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
68 cat a |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
69 cat c |
5652
e90e72c6b4c7
patch: write rej files for missing targets (issue 853)
Patrick Mezard <pmezard@gmail.com>
parents:
5581
diff
changeset
|
70 echo % display rejections |
e90e72c6b4c7
patch: write rej files for missing targets (issue 853)
Patrick Mezard <pmezard@gmail.com>
parents:
5581
diff
changeset
|
71 cat b.rej |
5581
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
72 cd .. |
8a8c341bd292
mq: missing target files do not make qpush to fail immediately (issue 835)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
73 |
7506
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
74 echo % test push creating directory during git copy or rename |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
75 hg init missingdir |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
76 cd missingdir |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
77 echo a > a |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
78 hg ci -Am adda |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
79 mkdir d |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
80 hg copy a d/a2 |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
81 hg mv a d/a |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
82 hg qnew -g -f patch |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
83 hg qpop |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
84 hg qpush |
abd2bc899d86
test-mq-missing: add test for directory creation on git copy
Patrick Mezard <pmezard@gmail.com>
parents:
5652
diff
changeset
|
85 cd .. |