Cherry pick changes from another repo

Joshua Grauman jnfo-c at grauman.com
Sun Nov 24 23:46:48 CST 2013


Hello,

I'm brand new to Mercurial (and source control as well) and just spent the 
last couple days reading documentation and tutorials and putting my 
projects in (I am a single developer, hoping maybe to add another in the 
future). I seem to get the basics pretty well and am really happy with 
things.

I setup a project as follows.

cd myproject-stable
hg init
hg add
hg commit -m "Initial commit"
hg tag v1.0.0
#fix code
hg commit -m "Fixed a bug with feature-x"
cd ..
hg clone myproject-stable myproject-dev

Then I've been adding new features to myproject-dev and doing bug fixes to 
myproject-stable. Great so far. I've been able to merge stable into dev to 
bring in the bug fixes.

But what if I'm working in -dev and end up commiting a changeset there, 
that I'd like to backport/cherry pick to -stable? I don't want to merge 
the whole repo, as most of it is untested/unstable. But what if I just 
want to bring in one or two changesets, what's the best way to do it 
(considering that eventually I'm going to merge the entire -dev repo into 
-stable later in the future once it gets to a certain point before a 
release)?

>From what I read, I don't want to use transplant or patch for some reason? 
And graft doesn't work across another repo?

I know there are several ways to do this, but I didn't find a clear answer 
on best practice showing pros and cons...

Note I also plan on adding new branches to the -dev repo for new features 
as I'm working on them (if that affects things).

Thanks!

Josh


More information about the Mercurial mailing list