Mercurial > hg
annotate tests/test-branch-option @ 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 | 3d6915f5a2bb |
children |
rev | line source |
---|---|
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
1 #!/bin/sh |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
3 # test branch selection options |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
4 hg init branch |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
5 cd branch |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
6 hg branch a |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
7 echo a > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
8 hg ci -d '0 0' -Ama |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
9 echo a2 > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
10 hg ci -d '0 0' -ma2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
11 hg up 0 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
12 hg branch c |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
13 echo c > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
14 hg ci -d '0 0' -mc |
11322
3d6915f5a2bb
improve --branch processing (and differentiate from # syntax)
Sune Foldager <cryo@cyanite.org>
parents:
11306
diff
changeset
|
15 hg tag -l z |
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
16 cd .. |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
17 hg clone -r 0 branch branch2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
18 cd branch2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
19 hg up 0 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
20 hg branch b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
21 echo b > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
22 hg ci -d '0 0' -mb |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
23 hg up 0 |
11306
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
24 hg --encoding utf-8 branch æ |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
25 echo ae1 > foo |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
26 hg ci -d '0 0' -mae1 |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
27 hg up 0 |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
28 hg --encoding utf-8 branch -f æ |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
29 echo ae2 > foo |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
30 hg ci -d '0 0' -mae2 |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
31 hg up 0 |
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
32 hg branch -f b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
33 echo b2 > foo |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
34 hg ci -d '0 0' -mb2 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
35 |
11322
3d6915f5a2bb
improve --branch processing (and differentiate from # syntax)
Sune Foldager <cryo@cyanite.org>
parents:
11306
diff
changeset
|
36 echo unknown branch and fallback |
3d6915f5a2bb
improve --branch processing (and differentiate from # syntax)
Sune Foldager <cryo@cyanite.org>
parents:
11306
diff
changeset
|
37 hg in -qbz |
3d6915f5a2bb
improve --branch processing (and differentiate from # syntax)
Sune Foldager <cryo@cyanite.org>
parents:
11306
diff
changeset
|
38 hg in -q ../branch#z |
3d6915f5a2bb
improve --branch processing (and differentiate from # syntax)
Sune Foldager <cryo@cyanite.org>
parents:
11306
diff
changeset
|
39 hg out -qbz |
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
40 echo in rev c branch a |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
41 hg in -qr c ../branch#a |
10379
a78bfaf988e1
add -b/--branch option to clone, bundle, incoming, outgoing, pull, push
Sune Foldager <cryo@cyanite.org>
parents:
10365
diff
changeset
|
42 hg in -qr c -b a |
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
43 echo out branch . |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
44 hg out -q ../branch#. |
10379
a78bfaf988e1
add -b/--branch option to clone, bundle, incoming, outgoing, pull, push
Sune Foldager <cryo@cyanite.org>
parents:
10365
diff
changeset
|
45 hg out -q -b . |
11306
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
46 echo out branch . non-ascii |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
47 hg --encoding utf-8 up æ |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
48 hg --encoding latin1 out -q ../branch#. |
deaeb2d84d8a
fix encoding bug in 05ac42e56452
Sune Foldager <cryo@cyanite.org>
parents:
10379
diff
changeset
|
49 hg --encoding latin1 out -q -b . |
10365
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
50 echo clone branch b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
51 cd .. |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
52 hg clone branch2#b branch3 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
53 hg -q -R branch3 heads b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
54 hg -q -R branch3 parents |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
55 rm -rf branch3 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
56 echo clone rev a branch b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
57 hg clone -r a branch2#b branch3 |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
58 hg -q -R branch3 heads b |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
59 hg -q -R branch3 parents |
d757bc0c7865
interpret repo#name url syntax as branch instead of revision
Sune Foldager <cryo@cyanite.org>
parents:
diff
changeset
|
60 rm -rf branch3 |