Splitting a repository
Matthieu Moy
Matthieu.Moy at imag.fr
Sat May 19 15:41:35 UTC 2007
Timo Sirainen <tss at iki.fi> writes:
> If I had to do this now, I would a write a script that looked up
> changesets containing changes to files in wanted directories, exported
> the changesets, dropped out changes for files outside the wanted dirs,
> and imported the changesets to the new repository.
That's not so simple. What would you do with a changeset adding a file
in lib/ and modifying one in auth/?
Indeed, I don't remember how mercurial deals with changesets, but
IIRC, it does exact patching with the base revision, and then usual
3-way merging if needed. This would not work if you don't have the
base revision in your history, so, importing only a subset of your own
history would not work.
That would mean rewritting history. One implication is that anybody
having branched from the non-re-written history would not be able to
merge properly with the re-written one.
> Is there an easier way to do this? Or has someone already written a
> similar script?
The best option is probably just to branch your current repository in
3 branches, and in each of the branch, delete the unnecessary files.
Drawback: each repository still contains all the history of the whole
project. If your repository is big, that's a problem, since you'll
probably use 3 times the disk space you would have needed.
--
Matthieu
More information about the Mercurial
mailing list