7

I am using Mercurial under Windows XP (using the TortoiseHg distribution) and I want to use NTFS hardlinks when cloning a repository. Out of the box Mercurial does not do this. I have read that a win32file python extension needs to be enabled. So far I have been unsuccessful in making this work (adding a win32file entry to the extensions section in mercurial.ini does not seem to work). Is there a simple way to enable it?

Mike Thompson
  • 6,708
  • 3
  • 32
  • 39
  • I don't know the answer, but I am curious as to what you are trying to achieve. Can you elaborate? – Arkady Aug 07 '09 at 04:05
  • I am trying to improve the performance of cloning a repository. Since hardlinks only increase the reference count of a file, cloning a repository becomes a fairly cheap operation in terms of disk space & creation time. – Mike Thompson Aug 07 '09 at 12:00
  • 1
    @Mike Thompson: You lost me there. If you use hard links for cloning repositories then a change to one of the files in one repo will affect all other repos too!? What's the catch? – utku_karatas Aug 07 '09 at 17:24
  • @utku_karatas: It's handled automatically by mercurial. It does hardlinks and when it needs to change a file, if the link count for that inode is greater than 1, it then does a copy. That way you get the space savings right up until you make a change. – Ry4an Brase Sep 09 '09 at 03:35

1 Answers1

0

I think you'll need to install full Python and use the Mercurial source install. While TortiseHG's py2exe-compiled installation of Mercurial can load mercurial extensions just fine, it's my understanding that it won't let you swap out core python modules.

Ry4an Brase
  • 78,112
  • 7
  • 148
  • 169
  • What do you mean by "full Python" ? Does ActivePython work, or do we need to download Python source, build and install in that way? ActivePython comes with win32file and I see the CreateHardLink function in that library. – Mike Caron Mar 24 '10 at 19:18
  • Also, UpgradeNotes on Mercurial wiki says: "0.7: Windows hardlink cloning - As of 0.7, hardlink cloning is now supported on Windows with NTFS and ActiveState Python. Because old versions cannot properly determine the link count of hardlinked files, using old versions of Mercurial on a new repository containing hardlinks may be dangerous." So if one has version > 0.7, should be ok. – Mike Caron Mar 24 '10 at 20:39