Alex Rivera | Logout

How to combine two projects in Mercurial?

Asked 2008-08-15T22:29:44.770
84

I have two separate mercurial repositories. At this point it makes sense that they "become one" because I want to work on the two projects simultaneously.

I'd really like the two projects to each be a subdirectory in the new repository.

  1. How do I merge the two projects?
  2. Is this a good idea, or should I keep them separate?

It seems I ought to be able to push from one repository to the other... Maybe this is really straight forward?

Edit
Report

2 Answers

7

hg started to have subrepo since 1.3 (2009-07-01). The early versions were incomplete and shaky but now it's pretty usable.

answered 2010-09-16T03:49:45.177
3

If you aren't using the same code across the projects, keep them separate. You can set your personal repository of each of those projects to be just a directory apart. Why mix all the branches, merges, and commit comments when you don't have to.

About your edit: Pushing from One repository to Another. You can always use the transplant command. Although, all this is really side stepping your desire to combine the two, so you might feel uncomfortable using my suggestions. Then you can use the forest extension, or something.

hg transplant -s REPOSITORY lower_rev:high_rev
answered 2008-08-20T15:05:01.037

Your Answer