Mercurial/TortoiseHg: Can multiple repositories share the exact same file(s)?

39 Views Asked by At

My question is how can I have two repositories share/watch the exact same file(s) without either one being a sub-repository of the other.

In TortoiseHg (version 6.4.2) if I create such a constellation, automatically the hierarchically higher repository detects that a hierarchically lower repository exists and shows the file as missing/deleted. If I try to take any action I get the error that the file is inside of a nested repo.

What I want is that the hierarchically higher repository ignores the hierarchically lower repository and just watches the file separately and ignores all .hg files/folder the hierarchically lower repository creates. So that one file (or multiples) are handled decoupled by two different repositories without considering the other repository at all.

Clarification/Example: A short illustrative example and my intent further explained.

 Main Folder (Repository A)
  Sub Folder 1
  Sub Folder 2 (Repository B)
    Sub Folder 2 File 1
    Sub Folder 2 File 2
    ....
  Sub Folder 3
  ....
  Main Folder File 1
  Main Folder File 2
  ....

What I want is that both repository A and repository B can manage the sub folder 2 files. Currently I can't find a way to make that possible, because if I establish repository B, repository A detects a nested sub repository and doesn't allow direct file monitoring anymore.

The reason is also explained easily, I want to share repository B to other projects to reuse it/share similar resources. But I don't want or need it as detailed/minuscule as I want to track change progress in repository A, furthermore I want repository A to track all files that are associated with this project and don't manage multiple nested sub repositories.

That is why I wanted to create a decoupled repository structure, where the project files are managed wholly by a single repository and shared/shareable resources are managed additionally by a separate repository.

0

There are 0 best solutions below