Re: REST-API: Merging/Rebasing with Mercurial?

"John P. Rouillard" <[email protected]>
Newsgroups gmane.comp.bug-tracking.roundup.devel
Message-ID <[email protected]>
Hi Thomas:

I have a few questions about your process so I can understand what you
are doing.

In message <[email protected]>,
Thomas Arendsen Hein writes:
>* Ralf Schlatterbeck <[email protected]> [20190118 16:24]:
>> As you may know we had a Google Summer of Code (GSoC) Project in 2015
>> that added a REST-API to roundup. I'd like to integrate this code.
>> The original announcement is at
>> https://sourceforge.net/p/roundup/mailman/message/34436352/
>> and there is also an issue in the tracker:
>> https://issues.roundup-tracker.org/issue2550734
>> 
>> If our version-control system was git I'd add a new remote to my
>> checkout of roundup, pull the repo above into a new local branch, rebase
>> to the current master and start fixing python3 compatibility issues and
>> adding documentation.
>> 
>> Can someone outline how to achieve this with mercurial?
>
>I assume you only want the changes from the REST branch (with the
>CRLF fixed), but not the changes from the bugs.python.org branch?
>
>I just did this using the mq (Mercurial Queues) extension:
>
># pull bpo+rest changes into my existing clone of the roundup repo:
>cd roundup.hg
>hg pull https://bitbucket.org/kinggreedy1991/roundup-bpo

Does the roundup-bpo repo have to have been a clone of the roundup hg
repo in order for this to work? So that way trunk of roundup-bpo will
match the roundhup hg repo up to a certain revision.

># mark pulled changes as yet unpublished to allow importing them into
># a stack of mq patches for further modification:
>hg phase --force --draft -r 'outgoing()'

What does this bit of magic do? I assume it sets the stage for the
following qimport in some way?

>hg qimport -r 'branch("REST")'

This I assume takes the rest branch from roundup-bpo and creates a
patch from it that mq can apply?

># pop the stack of REST patches and remove (strip) the bpo changes:
>hg qpop -a

The pop applies the patches created in the qimport to my current
working version right?

>hg strip -r 'outgoing()'

How does this limit the strip to the revisions that are identical to
the versions on the bpo branch?

># fix CRLF and two references to run_cgi_outer, which is
># a bpo-only wrapper around run_cgi:
>sed -i 's/\r$//' .hg/patches/*
>sed -i 's/run_cgi_outer$/run_cgi/' .hg/patches/*

I assume these are left around because they are ignore by the strip
because they aren't identical to the bpo branch?

># the patch queue should still be on the REST branch:
>hg branch REST

Does the rename the current working files to a new REST branch created
in the roundup repo? So after I commit, I could push it to roundup at
sourceforge and create a new REST branch?

># apply all patches and mark them as finished, so they become
># regular Mercurial changesets again:
>hg qpush -a

What is this pushing?

>hg qfinish -a

This commits the patches as a changeset right?

Thanks for any explanations you can provide to help me understand how
this is done.

--
				-- rouilj
John Rouillard
===========================================================================
My employers don't acknowledge my existence much less my opinions.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.