New hardlink clone code in tip

Stephen Darnell sdarnell at
Wed Sep 14 19:05:29 CDT 2005

Matt wrote:
> I've applied Stephen Darnell's symlink patch to tip, after reworking

s/symlink/hardlink/ :)

> it for the new copyfile code. This gives smarter hardlink behavior with
> fallbacks for filesystems that don't support hardlinking and most
> notably, provides hardlinking support on Windows NTFS.


> The Windows link code requires a mode from ActiveState Python, but
> falls back to normal behavior if it's not available.
> Windows and UNIX folks both: please test this out and let me know if
> you have any problems.

One cautionary point for Windows:

Python (all versions to my knowledge) reports an incorrect link count
when doing a file stat on hardlinked NTFS files, and mercurial will not
realise it has to break these links. win32file gives the right answer.

So don't use older versions of mercurial or versions of python
that don't support the win32file module on repositories with hardlinks.

I don't believe this should cause a problem for most people, but
mercurial hackers in particular may need to beware.


More information about the Mercurial mailing list