Question

I am about to make some major changes to my Mercurial repositories. As I am going to be using a Feature of Last Resort, I am looking for some advice and reassurance that I am not doing something stupid.

Where I Am:

I have a Mercurial repository with a complete history of all of these files:

/source
    /secret_subsystem
    /unclassified_subsystem
    /common_files       

Source is the Mercurial repository. The secret subsystem folder contains code which is intellectual property we want to keep in-house. The unclassified subsystem folder contains code which we want to outsource to a third-party to maintain. The common files folder contains code that both subsystems depend on. We will be keeping ownership, but we want to share it with the third-party.

Obviously, I can't just push out my whole repository to the third-party company. The third-party would see too much.

Where I Want To Be:

Having read up on subrepositories, this is where I think I need to be:

Have THREE subrepositories: secret_subsystem, unclassified_subsystem, common_files. Ensure there are no other files at the /source level, due to this recommendation.

Have the outsourcers create a brand new respository at the source level on their machines, and two corresponding subrepositories.

Push the unclassified_subsystem and common_files to the out-sourcer, pulling back unclassified_subsystem as required, pushing out new common_files repositories as required.

Maintaining History:

I would like to maintain the commit history, as much as practical, for all of the subsystems.

To do this, I will run the hg convert extension command three times, once for each subrepository. I will filter down to only the files that belong in each subrepository. I may also need to map filenames to move the files from ./common_files/foo.py to ./foo.py (for example).

My Questions:

1) Is dividing up a repository into subrepository a reasonable way of implementing security - viz. that a third-party can only see and edit some of our files?

2) Is using hg convert a reasonable way to create a subrepository from an existing repository, while still maintaining the history?

3) Will hg convert's filter strip out (a) all commits messages about files NOT in the filtered respository? Will it filter out all diffs for files NOT in the filtered repository?

There is another implied question: Am I heading into a world of hurt? If so, I will simply give up on retaining file histories, or even make them seperate repositories and forget about cross-repository commits.

Was it helpful?

Solution

I've not used subrepos so far, but I can answer 2) and 3):

2) Yes, sounds reasonable.

3) Yes.

There was a similar question just 2 days ago: Convert mercurial repository to subrepositories with full history (like hg log -f)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top