Splitting Off from Repository

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Mon Jul 23 03:23:36 CDT 2007


On Fri, 2007-07-20 at 20:06 -0700, Steven Yi wrote:
> Hi All,
> 
> I am wondering if it is possible to take a subdirectory of an hg
> repository and split it off so that the history for files within that
> subdirectory can be maintained.  The case I have is that I started
> using Mercurial and converted an SVN repository I was using to hold
> multiple projects.  I did work with the Mercurial repo over time and
> later realized it'd be better to change my way of working to break off
> some of the directories into individual projects.
> 
> Is this possible to do?

There is no tool to do this in mercurial. What you could do is one of:
  - clone your repo once for each subdirecty you are interested in and
then, delete all other files and move the subdirectory to the parent.
  - write a small script to parse all changeset history and rebuild a
new repository with only the patches affecting a single subdirectory.

Mathieu
-- 


More information about the Mercurial mailing list