Commit Graph

8 Commits

Author SHA1 Message Date
Augie Fackler
807e21c5e0 test-symlink-os-yes-fs-no.py: clean up use of two-argument raise
This makes any attempt to port to Python 3 harder, and the new syntax
is supported in 2.4 already.
2013-01-01 13:21:15 -06:00
Mads Kiilerich
ccfffc07ba tests: add missing no-outer-repo requirements
Outer repos (if any) will now never be touched by the tests. But it is better
to run without any repos around the tmp directory.
2012-06-20 23:41:21 +02:00
Augie Fackler
dfe2a9638f tests: use getattr instead of hasattr 2011-07-25 16:37:18 -05:00
Peter Arrenbrecht
d836ee3cea hg: add opts argument to clone for internal remoteui 2011-06-08 18:24:33 +02:00
Dan Villiom Podlaski Christiansen
511c941422 prevent transient leaks of file handle by using new helper functions
These leaks may occur in environments that don't employ a reference
counting GC, i.e. PyPy.

This implies:
 - changing opener(...).read() calls to opener.read(...)
 - changing opener(...).write() calls to opener.write(...)
 - changing open(...).read(...) to util.readfile(...)
 - changing open(...).write(...) to util.writefile(...)
2011-05-02 10:11:18 +02:00
Nicolas Dumazet
274ada7d8c tests: move test bundles in a bundles/ subdirectory 2011-04-30 17:38:06 +02:00
Martin Geisler
797369393f 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%.
2010-08-09 15:31:56 +02:00
Dov Feldstern
7805ceec07 test symlinks on symlink-capable os but non-capable filesystem (issue1149)
The "real" way to test this is to mount a non-symlink-capable filesystem, and
try working on it; however, I don't know how to mount filesystems as a
non-priveleged user from within the testing framework. So instead, os.symlink
is overridden to raise the exception that would be raised on such a filesystem.
2008-07-31 22:41:19 +03:00