Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mercurial Merging only certain changesets

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!

like image 320
PostMan Avatar asked Apr 07 '10 21:04

PostMan


2 Answers

Just to keep things a bit updated: there is the graft command which implements cherry-picking in Mercurial.

This command uses Mercurial's merge logic to copy individual changes from other branches without merging branches in the history graph. This is sometimes known as 'backporting' or 'cherry-picking'. By default, graft will copy user, date, and description from the source changesets.

like image 156
Lucero Avatar answered Oct 22 '22 12:10

Lucero


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.

like image 24
Laurens Holst Avatar answered Oct 22 '22 13:10

Laurens Holst