For Mercurial, can we push some changesets and don't push some?

12,583

Solution 1

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.)

Solution 2

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).

https://www.mercurial-scm.org/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.

Solution 3

For those who are using UI and like pictures:

  1. In TortoiseHg click on Detect outgoing changes to button. enter image description here

  2. Click right mouse button on revision you want to push.

  3. Choose Push -> Push to Here. enter image description here

Result: You will push only revision selected rather than everything. enter image description here

Hope this saves you some time.

Share:
12,583
nonopolarity
Author by

nonopolarity

I started with Apple Basic and 6502 machine code and Assembly, then went onto Fortran, Pascal, C, Lisp (Scheme), microcode, Perl, Java, JavaScript, Python, Ruby, PHP, and Objective-C. Originally, I was going to go with an Atari... but it was a big expense for my family... and after months of me nagging, my dad agreed to buy an Apple ][. At that time, the Pineapple was also available. The few months in childhood seem to last forever. A few months nowadays seem to pass like days. Those days, a computer had 16kb or 48kb of RAM. Today, the computer has 16GB. So it is in fact a million times. If you know what D5 AA 96 means, we belong to the same era.

Updated on July 10, 2022

Comments

  • nonopolarity
    nonopolarity almost 2 years

    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?