views:

49

answers:

1

Say I commit some changes to a new local named branch called 'X'. Then I commit some other changes to my 'default' branch. Can I push only the changesets on 'default', but not the changes on 'X'?

Might my approach be wrong? If so, please offer criticism.

+5  A: 

Pretty much. Just do this:

hg push -r default

When you use the -r X option with push, pull, or clone. You're saying "Get me the newest changeset that matches X and all of its ancestors. So if you do hg push -r default you send the newest changeset on default and all of its ancestors. So changesets on other branches that were merged into default will go to, but if you've kept the branches separate you'll be sending only default.

Note that you can always test your push with hg outgoing -r default to see exactly what you'd push.

Here's a nice write up with a way to make pushing only the branch on which you're working a one command affair: http://hgtip.com/tips/advanced/2009-09-28-nudge-a-gentler-push/

Ry4an
Perfect. You're a champ.
jonathanconway