cloning by hardlink

Matt Mackall mpm at
Thu Aug 4 12:58:02 CDT 2005

On Thu, Aug 04, 2005 at 01:42:20PM -0400, Neal Becker wrote:
> I noticed that cloning uses hardlink only for hg's own files.  I'd like an
> option to clone by hardlink my actual archived files.  I'm guessing this is
> not done because some editors will misbehave with hardlinked files?  I'd
> like the option because I know my editor doesn't misbehave.

cp -al is guaranteed to do the right thing.

I'm hesitant to add this feature to hg clone for two reasons:

- editors might screw up in ways that people not used to them don't
  expect (I got this complaint from one of the lead kernel hackers,
  who ought to know better, so I'm just going to assume that people
  will screw up and complain to me)

- you're potentially copying a modified or not up-to-date working
  directory, which is different semantics than the current clone

So I'd rather have people who know what they're doing use cp -al.

Mathematics is the supreme nostalgia of our time.

More information about the Mercurial mailing list