Reputation: 23108
This is a duplicate of this question, but specpifically regarding mercurial.
I have a massive subversion repository that I have converted to mercurial. It now looks like this:
MassiveFolder/
.hg/
bin/
common/
projA/
projB/
...
projX/
makefile
README
I would like each subproject to be tracked in its own repository for better performance. Notice that they all build into the same bin folder. I don't think that will be a problem, but I am not sure if I will need to do anything to adjust the paths. It is safe to assume each developer will clone the repositories in the same structure, but if there was some way to make a meta-repository that can ensure that, it would be even better.
Is there a standard way of doing this? What should I do about files like the makefile and the readme that live in the root folder?
If I have to start over importing to hg through some other process that shouldn't be a problem either. It just takes far too long to do standard operations with he monolithic repository, even though it already blows svn out of the water.
Upvotes: 2
Views: 336
Reputation: 40319
My approach - which I have used successfully on smaller repositories is as follows:
Determine list smaller repositories and how they will interrelate.
hg rm
all files you do not wantIf the subprojects are intertwined with a top-level Makefile, you can add a top-level repository which subrepositories in the smaller repositories.
This approach maintains history and does not force people to reclone. If you are okay with exploding history, convert is fine, and will shrink repository size.
A word (or a few) of warning: subrepositories have a good deal of difficult behavior as compared to the ease of one-repository operations. Some operations recurse, other's don't. Merge in particular recurses, which routinely gives me fits. Determining the entire system state can be challenging, especially as the number of subrepositories goes up (I'm helping manage a project with > 100 subrepositories, and yes, that was the logical and best way to handle it).
Upvotes: 2
Reputation: 36431
You can use Mercurial's Convert Extension (which you probably already know since you converted the repository from SVN to HG) with the -filemap
option to create separate HG repositories for the SVN subfolders.
You need the include
directive in particular:
The
include
directive causes a file, or all files under a directory, to be included in the destination repository, and the exclusion of any other element that's not under an inclusion rule.
Then, you could use Mercurial Subrepositories to set up the repositories in the desired folder structure:
Subrepositories is a feature that allows you to treat a collection of repositories as a group. This will allow you to clone, commit to, push, and pull projects and their associated libraries as a group.
Upvotes: 4