Mercurial > hg
diff tests/test-clone.t @ 30448:8836f13e3c5b
posix: give checklink a fast path that cache the check file and is read only
util.checklink would create a symlink and remove it again. That would sometimes
happen multiple times. Write operations are relatively expensive and give disk
tear and noise for applications monitoring file system activity.
Instead of creating a symlink and deleting it again, just create it once and
leave it in .hg/cache/check-link . If the file exists, just verify that
os.islink reports true. We will assume that this check is as good as symlink
creation not failing.
Note: The symlink left in .hg/cache has to resolve to a file - otherwise 'make
dist' will fail ...
test-symlink-os-yes-fs-no.py does some monkey patching to simulate a platform
without symlink support. The slightly different testing method requires
additional monkeying.
author | Mads Kiilerich <madski@unity3d.com> |
---|---|
date | Wed, 14 Jan 2015 01:15:26 +0100 |
parents | b324b4e431e5 |
children | 6a672c3b7860 |
line wrap: on
line diff
--- a/tests/test-clone.t Thu Nov 17 12:59:36 2016 +0100 +++ b/tests/test-clone.t Wed Jan 14 01:15:26 2015 +0100 @@ -32,6 +32,7 @@ $ ls .hg/cache branch2-served checkisexec + checklink checknoexec rbc-names-v1 rbc-revs-v1 @@ -48,6 +49,7 @@ $ ls .hg/cache branch2-served checkisexec + checklink $ cat a a