extend my repository down the tree

Martin Geisler mg at lazybytes.net
Wed Aug 19 12:57:46 CDT 2009


Markus Hubig <mhubig at googlemail.com> writes:

> Hi @all,
>
> I'm quite new to hg and I have a little question.
> I started using hg in a sub-dir of my project ... just to test.
> But now I'm so exited i'll drop SVN and start using hg.
>
> My question now is how do I get the rest of my project into
> hg without loosing the history of my sub-dir-hg-repository?
>
> How to I get from a -> b
>
> a) MyProjectDir
>     '------------> dir1
>     '------------> dir2 (.hg)
>     '------------> dir3

Start by moving (hg rename) all files in your Mercurial repository into
a new directory called dir2. That will preserve history and give give
you a situation like this:

 a) MyProjectDir
     '------------> dir1
     '------------> dir2 (.hg)
                     '------------> dir2
     '------------> dir3

Now move dir1 and dir3 into the outer dir2 (remove the .svn folders from
dir1 and dir3):

 a) MyProjectDir
     '------------> dir2 (.hg)
                     '------------> dir1
                     '------------> dir2
                     '------------> dir3

Rename your Mercurial repository to MyProjectDir and move it out of the
outer MyProjectDir:

> b) MyProjectDir (.hg)
>     '------------> dir1
>     '------------> dir2 (hg history preserved)
>     '------------> dir3

-- 
Martin Geisler

VIFF (Virtual Ideal Functionality Framework) brings easy and efficient
SMPC (Secure Multiparty Computation) to Python. See: http://viff.dk/.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://selenic.com/pipermail/mercurial/attachments/20090819/caf549e9/attachment.pgp 


More information about the Mercurial mailing list