4

I am planning to use Mercurial in the near future on some projects. These projects will normally reside in a directory on my Windows machine, but I will be sharing these directories using VirtualBox so I can work on them directly from within Linux.

I understand that Mercurial will sometimes create hard links when cloning repositories. I'm not sure how a VirtualBox shared directory handles these hard links (or if it even can), so I'd rather just tell Mercurial to never attempt to make hard links and always make a copy.

My question: how do I globally disable Mercurial from hard linking?

(Although if someone has gotten Mercurial and VirtualBox shared folders to work nicely with hard linking, I'd like to hear about it!)

Martin Geisler
  • 1,271
  • 9
  • 23
scrapdog
  • 153
  • 3
  • I do not think that you should have problems. Hardlinks are working only if the filesystem where you want to create the hardlink is supporting them (bot the driver and the fs structure). For example if you have a FAT filesystem you will not be able to create hardlinks. The vboxsf VFS driver does not support links (neither symbolic or hard). This means that it will fail to create hardlinks, but you will be able to see them properly if they already exist. See: http://www.virtualbox.org/ticket/818 – Mircea Vutcovici Mar 29 '10 at 20:46

1 Answers1

4

As Mircea said, you shouldn't have to worry about this. But still, you can force a clone to be without hardlinks by doing

hg clone --pull foo bar

This basically does the same as

hg init bar
cd bar
hg pull ../foo

and won't create hardlinks between the clones.

Scott Pack
  • 14,717
  • 10
  • 51
  • 83
Martin Geisler
  • 1,271
  • 9
  • 23