Search code examples
mercurialtortoisehg

Merging changesets to anonymous branch


I have a branch in HG repo (let it be default). I started an anonymous branch at some point, to make some tests (and added a feature, although I'm not sure yet what's the big adventage of having a feature, if using TortoiseHg). So far so good.

Now, the default branch got some bugfixes. I need them in my anonymous branch too.

What's the best way to merge or handle this scenario?


Solution

  • To copy the changes from the main default branch to the anonymous branch you would merge the default branch into the anonymous branch.

    The problem with this is that you'd lose the extra branch so you'd need to note the current head of the main default branch if you didn't want the anonymous branch's changes in the main branch. To do this, you could tag the head of the main default branch before the merge.

    Another option would be to mark it with a bookmark before doing the merge.

    Then, if you need to make further changes to the main branch before permenamtly merging the two branches you would update to the tag or bookmark first.