qnew --parent

Ben Schmidt mail_ben_schmidt at yahoo.com.au
Tue Feb 9 21:23:52 CST 2010


Hi,

I hope this is the right place to raise this issue. Please let me know if not. 
Happy to jump on a bug tracker or something if that's more appropriate.

This is quite a minor change, but I think useful.

I'd like to suggest adding a --parent option to qnew to allow it to create a patch 
from a merged working directory by explicitly stating which parent of the merge 
the patch should be based on.

My reasoning comes from an experience I just had. I maintain a patch queue of 
changes I regularly apply to Vim as I compile it. Each time I want to compile, I 
unapply my patches, pull in all the upstream changes, and then reapply the 
patches. Recently, though, an upstream change conflicted severely with a patch. 
Not having time immediately to rework the patch, and not being all that interested 
in the upstream change, I decided to create a new patch to back out the upstream 
change, applying it before the conflicting patch. After a bunch of trying things, 
I found I could do it with debugsetparent, but it would be better if I could just do

hg backout -r BAD_REV
hg merge
[...resolve conflicts by hand...]
hg resolve -m --all
hg qnew --parent UPSTREAM_TIP -f backout_BAD.patch
hg strip BACKOUT_REV

I'm keen to do it this way as the three-way merge of hg merge was a lot easier to 
deal with than trying to reverse the changes made by BAD_REV with just a simple patch.

It would probably make sense to allow qimport with the -r option to also work with 
merge changesets by specifying --parent, too, though this is a bit more dangerous.

Ben.





More information about the Mercurial-devel mailing list