Create patch for series of existing changesets that were created without using MQ?
Grigory Ptashko
grigory.ptashko at gmail.com
Wed Apr 27 17:47:55 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.
I’ve chosen bookmarks because in the project manifest it is said that there must not be
named branches. But I wanted to have my own local branch to which I can commit and then
when I am ready merge my changes to upstream.
But now I understand that I’m doing something wrong..
Sending a patch to outer world so that they can see what I am doing was also my personal
requirement. But again now I see that bookmarks do not satisfy both these requirements..
What’s the proper workflow for me then?
I’m ready to learn, I’m reading and trying but I need an advice from gurus.
>
>> • 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.
Yes, there are plenty of merges there. What’s my option then?
>
>> 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
>
>> 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