Hardlink to/from in-repository file?

Angel Ezquerra angel.ezquerra at gmail.com
Thu Apr 10 13:23:51 UTC 2014


El 10/04/2014 15:19, "Masklinn" <masklinn at masklinn.net> escribió:
>
> 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? Is there a way to
> change it?
>
> Symlinks are not an option, as they're not transparent and mercurial
> will version the link itself rather than the content (in my precise
> case, "outside" is actually a different repository used solely for
> MQ, as I prefer MQ's behavior to Quilt's)

Have you considered setting up a post pull hook that recreates the link
automatically for you?

Cheers,

Angel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20140410/48d779a9/attachment-0002.html>


More information about the Mercurial mailing list