Mercurial > hg
annotate tests/test-convert-cvsnt-mergepoints @ 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 | 56a5f80556f5 |
children |
rev | line source |
---|---|
8451
ec8b8a0f494b
cvsnt-mergepoints test: use sh instead of bash
Martin Geisler <mg@lazybytes.net>
parents:
8350
diff
changeset
|
1 #!/bin/sh |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
2 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
3 "$TESTDIR/hghave" cvs || exit 80 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
4 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
5 filterpath() |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
6 { |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
7 eval "$@" | sed "s:$CVSROOT:*REPO*:g" |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
8 } |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
9 |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
10 cvscall() |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
11 { |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
12 echo cvs -f "$@" |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
13 cvs -f "$@" |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
14 } |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
15 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
16 # output of 'cvs ci' varies unpredictably, so discard most of it |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
17 # -- just keep the part that matters |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
18 cvsci() |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
19 { |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
20 echo cvs -f ci -f "$@" |
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
21 cvs -f ci -f "$@" 2>&1 | egrep "^(new|initial) revision:" |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
22 } |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
23 |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
24 hgcat() |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
25 { |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
26 hg --cwd src-hg cat -r tip "$1" |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
27 } |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
28 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
29 echo "[extensions]" >> $HGRCPATH |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
30 echo "convert = " >> $HGRCPATH |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
31 echo "graphlog = " >> $HGRCPATH |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
32 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
33 echo "% create cvs repository" |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
34 mkdir cvsmaster |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
35 cd cvsmaster |
8350
1f0f01bc86a5
tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents:
7956
diff
changeset
|
36 CVSROOT=`pwd` |
1f0f01bc86a5
tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents:
7956
diff
changeset
|
37 export CVSROOT |
1f0f01bc86a5
tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents:
7956
diff
changeset
|
38 CVS_OPTIONS=-f |
1f0f01bc86a5
tests: avoid export FOO=bar bashism
Martin Geisler <mg@lazybytes.net>
parents:
7956
diff
changeset
|
39 export CVS_OPTIONS |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
40 cd .. |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
41 filterpath cvscall -Q -d "$CVSROOT" init |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
42 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
43 echo "% checkout #1: add foo.txt" |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
44 cvscall -Q checkout -d cvsworktmp . |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
45 cd cvsworktmp |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
46 mkdir foo |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
47 cvscall -Q add foo |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
48 cd foo |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
49 echo foo > foo.txt |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
50 cvscall -Q add foo.txt |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
51 cvsci -m "add foo.txt" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
52 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
53 cd ../.. |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
54 rm -rf cvsworktmp |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
55 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
56 echo "% checkout #2: create MYBRANCH1 and modify foo.txt on it" |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
57 cvscall -Q checkout -d cvswork foo |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
58 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
59 cd cvswork |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
60 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
61 cvscall -q rtag -b -R MYBRANCH1 foo |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
62 cvscall -Q update -P -r MYBRANCH1 |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
63 echo bar > foo.txt |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
64 cvsci -m "bar" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
65 echo baz > foo.txt |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
66 cvsci -m "baz" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
67 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
68 echo "% create MYBRANCH1_2 and modify foo.txt some more" |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
69 cvscall -q rtag -b -R -r MYBRANCH1 MYBRANCH1_2 foo |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
70 cvscall -Q update -P -r MYBRANCH1_2 |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
71 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
72 echo bazzie > foo.txt |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
73 cvsci -m "bazzie" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
74 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
75 echo "% create MYBRANCH1_1 and modify foo.txt yet again" |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
76 cvscall -q rtag -b -R MYBRANCH1_1 foo |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
77 cvscall -Q update -P -r MYBRANCH1_1 |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
78 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
79 echo quux > foo.txt |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
80 cvsci -m "quux" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
81 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
82 echo "% merge MYBRANCH1 to MYBRANCH1_1" |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
83 filterpath cvscall -Q update -P -jMYBRANCH1 |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
84 # carefully placed sleep to dodge cvs bug (optimization?) where it |
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
85 # sometimes ignores a "commit" command if it comes too fast (the -f |
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
86 # option in cvsci seems to work for all the other commits in this |
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
87 # script) |
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
88 sleep 1 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
89 echo xyzzy > foo.txt |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
90 cvsci -m "merge1+clobber" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
91 |
8819
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
92 echo "% return to trunk and merge MYBRANCH1_2" |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
93 cvscall -Q update -P -A |
e93ab347c814
test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
Greg Ward <greg-hg@gerg.ca>
parents:
8818
diff
changeset
|
94 filterpath cvscall -Q update -P -jMYBRANCH1_2 |
8821
c66e324d3961
Fix test-convert-cvsnt-mergepoints so it works reliably.
Greg Ward <greg-hg@gerg.ca>
parents:
8820
diff
changeset
|
95 cvsci -m "merge2" foo.txt |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
96 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
97 REALCVS=`which cvs` |
8820
e8cb1fa0d4a9
test-convert-cvsnt-mergepoints: make it work on OS X.
Greg Ward <greg-hg@gerg.ca>
parents:
8819
diff
changeset
|
98 echo "for x in \$*; do if [ \"\$x\" = \"rlog\" ]; then echo \"RCS file: $CVSROOT/foo/foo.txt,v\"; cat $TESTDIR/test-convert-cvsnt-mergepoints.rlog; exit 0; fi; done; $REALCVS \$*" > ../cvs |
e8cb1fa0d4a9
test-convert-cvsnt-mergepoints: make it work on OS X.
Greg Ward <greg-hg@gerg.ca>
parents:
8819
diff
changeset
|
99 chmod +x ../cvs |
e8cb1fa0d4a9
test-convert-cvsnt-mergepoints: make it work on OS X.
Greg Ward <greg-hg@gerg.ca>
parents:
8819
diff
changeset
|
100 PATH=..:${PATH} hg debugcvsps --parents foo | sed -e 's/Author:.*/Author:/' -e 's/Date:.*/Date:/' |
7956
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
101 |
3e7611a83230
convert: added cvsnt mergepoint support
Henrik Stuart <henrik.stuart@edlund.dk>
parents:
diff
changeset
|
102 cd .. |