Create patch for series of existing changesets that were created without using MQ?

Grigory Ptashko grigory.ptashko at gmail.com
Wed Apr 27 18:27:00 UTC 2016


> On 27 апр. 2016 г., at 20:35, Matt Mackall <mpm at selenic.com> wrote:
> 
> On Wed, 2016-04-27 at 19:45 +0300, Grigory Ptashko wrote:
>> Hello.
>> 
>> I've recently started to work on an open source project which uses Mercurial.
>> I'm a new user to Mercurial, so I read the HG book and started working. My
>> goal was to write code and always pull and merge changes from the upstream so
>> I can stay up-to-date. The area that I am working on is also under heavy
>> development by others so I do want to merge my changes after a long period of
>> time. I cloned a repo. So, my workflow is like this:
>> 
>> 	• I created a bookmark mybook
>> 	• hg up mybook
> 
> No need for this step.
> 
>> 	• Write code
>> 3.1 hg commit -m 'new functions'
>> 
>> 	• hg up default
>> 	• hg pull
>> 	• hg update
>> 	• hg up mybook
>> 	• hg merge default
> 
> You might consider using rebase here instead.
> 
>> 	• Go to step 3.
>> In my mind this is the simplest workflow that allows me to stay up-to-date. I
>> also have only one HEAD because I always merge.
>> 
>> Since I am not a contributor yet, I am not allowed to push changes to remote
>> repo.
>> 
>> Recently I wanted to show my work to a project lead and he said send me a
>> patch. And this is where I am stuck. hg out shows 10 changesets. First of
>> which appeard already a month ago. They're numbers are 3341, 3342, 3345, 3346,
>> 3349, 3356, 3360, 3365, 3366, 3368. The changeset numer 3368 is the tip.
> 
> Check out hg log -G.
> 
> Also, you can do:
> 
> hg log -vpr mybookmark%
> 
> This is a shorthand for "only(mybookmark)".
> 
> You can get a diff between two revisions thusly:
> 
>  hg log -r startrev -r endrev
> 
> But if you've got merges in your stack of changes, that diff isn't going to be
> useful.
> 
>> I've recently read the chapter about the MQ extension. And this extensions
>> seems to be what I need. But the problem is that I wrote code without using
>> the MQ extension.
>> 
>> So, how can I make use of the MQ extension on already created changesets so
>> that I can make a patch to send to the project lead so that he can apply it
>> and see my changes?
>> 
>> I've just issued hg qinit. What's next? Issueing hg qimport -r 3341 gives
> 
> No need to do qinit.
> 
>> abort: revision 3341 has unmanaged children
> 
> hg qimport -r 3341::  # 3341 and all its descendants

Also no luck

$ hg qimport -r 3341::
abort: cannot import merge revision 3368


> 
>> Reading the book and googling further does not help me. I need an advice.
>> 
>> PS I've tried not using hg and MQ at all: simple diff -urN old/ new/ but I
>> want understand how to do it with the MQ.
>> 
>> Thank you.
>> 
>> --
>> Best regards,
>> Grigory Ptashko
>> 
>> +7 (916) 1489766
>> grigory.ptashko at gmail.com
>> facebook.com/GrigoryPtashko
>> 
>> _______________________________________________
>> Mercurial mailing list
>> Mercurial at mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial
> -- 
> Mathematics is the supreme nostalgia of our time.
> 


--
Best regards,
Grigory Ptashko

+7 (916) 1489766
grigory.ptashko at gmail.com
facebook.com/GrigoryPtashko




More information about the Mercurial mailing list