If we committed several times, for example, on our local repo, for revision 3000, 3001, 3002, 3003. If we push to a remote repo, it will push 3000 to 3003. Is there a way to push only 3000 and 3001?
+2
A:
Yes, you can select a revision to push. hg push -r 3001
(all ancestors of the chosen revision will be pushed; you don't need to specify 3000.)
Wooble
2010-10-25 15:30:26
great, thanks, went and saw the docs. it says if `-r` is used, then that changeset and all its ancestors will be pushed. so it probably is not possible to just push 3002 and 3003 without 3000 and 3001?
動靜能量
2010-10-25 15:33:26
You're correct. You can't send 3002 without sending 3001 also (unless they already have 3001, of course). You can send a different changeset that has the same change but a different hash and parent (and is thus a totally different changeset), but doing that too often means you'll end up with duplicate work in your repos.
Ry4an
2010-10-25 15:53:25
A:
If you need to push some changesets without all ancestors (solution described in @Woolble's answer), a good option is to use Mercurial Queues extension (MQ).
http://mercurial.selenic.com/wiki/MqExtension
This will let you re-order and even combine changesets so you can push them in whatever order you like. It takes a bit of work to get started but you'll find it well worth the effort.
I've TortoiseHg makes working with MQ pretty straightforward.
Nick Pierpoint
2010-10-25 15:55:35