how to share a file between 2 repositories? Hardlinks?

Dr. Arne Babenhauserheide arne_bab at web.de
Tue Oct 7 12:12:02 UTC 2025


Uwe Brauer via Mercurial <mercurial at lists.mercurial-scm.org> writes:

> 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.

This sounds like vc-mode detecting that it’s a hardlink and using the
"canonical" location -- which wasn’t the file you opened, but the other
repository.

I don’t have a good solution for the problem: I tend to just copy the
bibtex files and merge them manually from time to time using M-x
ediff-merge.

An option could be to use a common bibtex repository, always commit the
changes to the bibtex file individually in the work repository and
export+import those changes to the other repository. Then you can always
import+merge the bibtex repo in all other repos.

To automate it, you could create a commit hook that does the
export+import; in .hg/hgrc:

[hooks]
commit = hg log -r $HG_NODE --template '{files}' | grep -q 'bibtex.bib' && hg export $HG_NODE > /tmp/bibtex.patch && hg -R ../bib import /tmp/bibtex.patch && rm /tmp/bibtex.patch || true

Best wishes,
Arne
-- 
Unpolitisch sein
heißt politisch sein,
ohne es zu merken.
draketo.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 1125 bytes
Desc: not available
URL: <http://lists.mercurial-scm.org/pipermail/mercurial/attachments/20251007/e3e294c0/attachment-0001.sig>


More information about the Mercurial mailing list