views:

176

answers:

3

Ok, so we recently converted from SVN to Mercurial.
We are using TortoiseHG normally.

In our one repository we have all of our projects, C++ / .NET / ASP. We have about 100 projects, all using common library projects.

So it would be quite difficult task to create multiple repo's for each project.


Now, we have the default branch, and let's say branchA.
I'm working on BranchA and adding my uber changes to it, and I change a common library, let's say an extension method

I want to commit this to branchA and default, how would I go about this?

However, I don't want all my changes from branchA to be merged into default, and I don't want all the other changes from default

Hopefully this is sufficient information!

A: 

You're describing "cherry picking" or doing a "partial merge" which isn't possible with Mercurial currently. You have a few options:

  • Separate your common code into its own repository.
  • Generate a diff of your changes that you made to your common code, and apply that to the default branch.
rlotun
+2  A: 

What is want is not merge, but cherry-pick. You can use http://mercurial.selenic.com/wiki/TransplantExtension , but be aware about complications mentioned there.

Almad
A: 

If you separate the common code into its own repository, you can use subrepos to include it in each project.

By the way, I would recommend to have a separate repository for each project, especially if there are so many.

Laurens Holst