Mercurial > hg
annotate tests/test-mq-merge @ 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 | 2376b4cc52d8 |
children |
rev | line source |
---|---|
4333
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 # Test issue 529 - mq aborts when merging patch deleting files |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
5 checkundo() |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
6 { |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
7 if [ -f .hg/store/undo ]; then |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
8 echo ".hg/store/undo still exists after $1" |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
9 fi |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
10 } |
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
11 |
4333
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 echo "[extensions]" >> $HGRCPATH |
10119
bb5ea66789e3
tests: load with "ext =" instead of "hgext.ext ="
Martin Geisler <mg@lazybytes.net>
parents:
6628
diff
changeset
|
13 echo "mq =" >> $HGRCPATH |
10190
9c2c94934f0d
mq: upgrade to git patch when necessary (issue767)
Patrick Mezard <pmezard@gmail.com>
parents:
10187
diff
changeset
|
14 echo "[mq]" >> $HGRCPATH |
9c2c94934f0d
mq: upgrade to git patch when necessary (issue767)
Patrick Mezard <pmezard@gmail.com>
parents:
10187
diff
changeset
|
15 echo "git = keep" >> $HGRCPATH |
4333
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 # Commit two dummy files in "init" changeset |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 hg init t |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 cd t |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 echo a > a |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 echo b > b |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 hg ci -Am init |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 hg tag -l init |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 # Create a patch removing a |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 hg qnew rm_a |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 hg rm a |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 hg qrefresh -m "rm a" |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 # Save the patch queue so we can merge it later |
11071
2376b4cc52d8
test-mq-merge: quote ^
Mads Kiilerich <mads@kiilerich.com>
parents:
10775
diff
changeset
|
31 hg qsave -c -e 2>&1 | grep -v '^copy' |
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
32 checkundo qsave |
4333
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 # Update b and commit in an "update" changeset |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 hg up -C init |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 echo b >> b |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 hg st |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 hg ci -m update |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 # Here, qpush used to abort with : |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 # The system cannot find the file specified => a |
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 hg manifest |
11071
2376b4cc52d8
test-mq-merge: quote ^
Mads Kiilerich <mads@kiilerich.com>
parents:
10775
diff
changeset
|
43 hg qpush -a -m 2>&1 | grep -v '^merging' |
5527
0b3f910dfd17
mq: really remove undo after a qpush (and after a strip)
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
4437
diff
changeset
|
44 checkundo 'qpush -m' |
4333
4f721e96f1de
Add test for issue 529 - "mq aborts when merging patch deleting files".
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 hg manifest |
4437
a210b40d0860
Make mergepatch save queue now that qpush isn't.
Brendan Cully <brendan@kublai.com>
parents:
4333
diff
changeset
|
46 |
a210b40d0860
Make mergepatch save queue now that qpush isn't.
Brendan Cully <brendan@kublai.com>
parents:
4333
diff
changeset
|
47 # ensure status is correct after merge |
a210b40d0860
Make mergepatch save queue now that qpush isn't.
Brendan Cully <brendan@kublai.com>
parents:
4333
diff
changeset
|
48 hg qpop -a |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
49 cd .. |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
50 |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
51 # Classic MQ merge sequence *with an explicit named queue* |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
52 echo |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
53 echo % init t2 |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
54 hg init t2 |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
55 cd t2 |
10185
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
56 echo '[diff]' > .hg/hgrc |
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
57 echo 'nodates = 1' >> .hg/hgrc |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
58 echo a > a |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
59 hg ci -Am init |
10185
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
60 echo b > a |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
61 hg ci -m changea |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
62 hg up -C 0 |
10185
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
63 hg cp a aa |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
64 echo c >> a |
10185
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
65 hg qnew --git -f -e patcha |
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
66 echo d >> a |
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
67 hg qnew -d '0 0' -f -e patcha2 |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
68 echo % create the reference queue |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
69 hg qsave -c -e -n refqueue 2> /dev/null |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
70 hg up -C 1 |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
71 echo % merge |
10185
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
72 HGMERGE=internal:other hg qpush -a -m -n refqueue 2>&1 | \ |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
73 sed 's/merging with queue at.*refqueue/merging with queue at refqueue/' |
10185
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
74 echo % check patcha is still a git patch |
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
75 cat .hg/patches/patcha |
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
76 echo % check patcha2 is still a regular patch |
7637fe4f525d
mq: preserve --git flag when merging patches
Patrick Mezard <pmezard@gmail.com>
parents:
6628
diff
changeset
|
77 grep git .hg/patches/patcha2 && echo 'git patch found!' |
6628
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
78 cd .. |
f18f14bae172
test-mq-merge: test mq merge and explicit patch queue
Patrick Mezard <pmezard@gmail.com>
parents:
5527
diff
changeset
|
79 |