Hardlink to/from in-repository file?

Adrian Buehlmann adrian at cadifra.com
Thu Apr 10 13:51:57 UTC 2014


On 2014-04-10 14:22, Masklinn wrote:
> I was trying to version a file between inside and outside of a
> repository, but it looks like this does not work because mercurial
> re-creates the file on each update:
> 
>> hg init test-link                                       
>> cat > test-link/foo                                     
> bar
> ^C
>> hg -R test-link add test-link/foo                 
>> hg -R test-link ci -m "0"                         
>> cat >> test-link/foo                                    
> baz
> ^C
>> hg -R test-link ci -m "1"                         
>> ln test-link/foo foo                                    
>> cat foo                                                 
> bar
> baz
>> ls -i test-link/foo foo                                 
> 36335311 foo           36335311 test-link/foo
>> hg -R test-link up -r0                            
> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
>> ls -i test-link/foo foo                                 
> 36335311 foo           36335421 test-link/foo
> 
> 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?

Yes.

> Is there a way to change it?

No.




More information about the Mercurial mailing list