Mercurial > hg
annotate tests/test-convert-tagsbranch-topology @ 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 | d1b135f2f415 |
children |
rev | line source |
---|---|
9431
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 "$TESTDIR/hghave" git || exit 80 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 echo "[extensions]" >> $HGRCPATH |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 echo "convert=" >> $HGRCPATH |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 echo 'hgext.graphlog =' >> $HGRCPATH |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 echo '[convert]' >> $HGRCPATH |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 echo 'hg.usebranchnames = True' >> $HGRCPATH |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 echo 'hg.tagsbranch = tags-update' >> $HGRCPATH |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 GIT_AUTHOR_NAME='test'; export GIT_AUTHOR_NAME |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 GIT_AUTHOR_EMAIL='test@example.org'; export GIT_AUTHOR_EMAIL |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 GIT_AUTHOR_DATE="2007-01-01 00:00:00 +0000"; export GIT_AUTHOR_DATE |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 GIT_COMMITTER_NAME="$GIT_AUTHOR_NAME"; export GIT_COMMITTER_NAME |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 GIT_COMMITTER_EMAIL="$GIT_AUTHOR_EMAIL"; export GIT_COMMITTER_EMAIL |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"; export GIT_COMMITTER_DATE |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 count=10 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 action() |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 { |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 GIT_AUTHOR_DATE="2007-01-01 00:00:$count +0000" |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE" |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 git "$@" >/dev/null 2>/dev/null || echo "git command error" |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 count=`expr $count + 1` |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 } |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 glog() |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 { |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@" |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 } |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 convertrepo() |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 { |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 hg convert --datesort git-repo hg-repo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 } |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 # Build a GIT repo with at least 1 tag |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 mkdir git-repo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 cd git-repo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 git init >/dev/null 2>&1 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 echo a > a |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 git add a |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
44 action commit -m "rev1" |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 action tag -m "tag1" tag1 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 cd .. |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
47 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
48 # Do a first conversion |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
49 convertrepo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
50 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
51 # Simulate upstream updates after first conversion |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
52 cd git-repo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
53 echo b > a |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
54 git add a |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 action commit -m "rev2" |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 action tag -m "tag2" tag2 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 cd .. |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
58 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
59 # Perform an incremental conversion |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
60 convertrepo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
61 |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
62 # Print the log |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
63 cd hg-repo |
d1b135f2f415
convert: fix history topology when using hg.tagsbranch
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
64 glog |