views:

194

answers:

2

I am working on some bugs in our code base and I have created separate branches for each bug. I have rebased one of the branches on top of default. I generally use the mercurial plugin for Eclipse and I would do a push (when I am in the default branch). This pushes my changes on the default branch.

I tried to do the same thing with TortoiseHg. When I press push, the client complains that I am about to create remote heads/create new branches on the server. Is there some way to push only changes on one branch using TortoiseHg?

Thanks for your answers!

+1  A: 

The easiest way to do this is via the command-line using hg push -r . from the branch with the change you want to push. See hg nudge for details.

That being said, it is also possible via TortoiseHG:

  1. Open your Repository Explorer
  2. Open Tools->Synchronize
  3. Open "Advanced Options"
  4. Set "Target Revision" to the changeset that you want to push
  5. Select "Push"

This should only push the changeset you specified (along with any parents of that changeset which may be required). If you limit the changesets that are pushed to those on your default branch, there should be no warning about creating additional heads.

More information (well, not that much) can be found in the Section 4.9 of the TortoiseHg documentation.

Tim Henigan
Awesome, thanks
aip.cd.aish
+1  A: 

Here’s another way to do it:

  1. Open Repository Explorer.
  2. Click Determine and mark outgoing changesets (green up arrow button). All your changesets / branches will be marked with an up arrow.
  3. Right-click on the changeset you want to push. From the menu, select Push to here.

Works the same way as the previous answer, but allows you to select the changeset from the list, without typing or pasting the target changeset id.

Helgi