how to share a file between 2 repositories? Hardlinks?
Uwe Brauer
oub at mat.ucm.es
Tue Oct 7 08:39:29 UTC 2025
>>> "PD" == Pierre-Yves David <pierre-yves.david at ens-lyon.org> writes:
> Using a hardlink will work, as the hardlink works a the filesystem
> level and Mercurial will be oblivious of that "implementation"
> details.
> However, it will be up to you to preserve that hardlink in sync. Other
> program like your test editor, or generation of the file might break
> that hardlink, Even `hg update` could end up doing that.
> So it depends of what kind of file it is, how and how often it gets
> updated. And depending on that you might want to setup hooks to make
> sure the two "file" (i.e. file system path) still point to the same
> "content" (i.e. file system inode) before committing, or after update.
> Can you tell use more about this file?
Thanks for the detailed response. I’m probably something of an outlier
here, as I mainly use Mercurial for scientific collaboration involving
LaTeX—along with some Emacs Lisp and MATLAB coding.
The file in question is a BibTeX file containing entries such as:
--8<---------------cut here---------------start------------->8---
@InCollection{christodoulou90:_minkow,
title = {The global nonlinear stability of the {M}inkowski
space},
author = {Christodoulou, D. and Klainerman, S.},
booktitle = {Séminaire sur les Équations aux {D}érivées
{P}artielles, 1989--1990},
publisher = {École Polytech., Palaiseau},
year = 1990,
pages = {Exp.\ No.\ XIII, 31},
Mrclass = {83C05 (58G16 58G17)},
Mrnumber = 1073188
}
--8<---------------cut here---------------end--------------->8---
The editor I use is GNU Emacs. When I committed the file in one
repository using Emacs VC and then opened the hard-linked file in the
other repository, Emacs refused to commit, claiming there were no
changes—even though I could commit from the command line.
I assume this is an Emacs issue.
Regards
Uwe Brauer
--
I strongly condemn Hamas heinous despicable pogroms/atrocities on Israel.
Stop the war in Gaza, guarantee humanitarian aid, and bring the hostages back.
I strongly condemn Putin's war of aggression against Ukraine.
I support to deliver weapons to Ukraine's military.
I support the EU and NATO membership of Ukraine.
More information about the Mercurial
mailing list