Hardlink to/from in-repository file?

Mads Kiilerich mads at kiilerich.com
Thu Apr 10 13:39:13 UTC 2014


On 04/10/2014 02:22 PM, Masklinn wrote:
> As can be seen, after the update the inode of the in-repository file
> has changed, and it's not linked to the out-of-repository file anymore.
>
> I couldn't find anything when looking for inode or hardlink information
> pertaining to mercurial (except that mercurial will create hardlinks
> between local clones), is this behavior expected? Is there a way to
> change it?

Yes, Mercurial will intentionally not write into files but remove the 
old file and create a new file with the new content. That will break 
hardlinks and that is in most cases the right thing to do. It is also a 
way to avoid problems on windows and other systems where files can be 
locked.

(Arguably it would be even better if Mercurial used atomic rename 
instead of remove + create.)

/Mads



More information about the Mercurial mailing list