[Python-Dev] Backport troubles with mercurial

David Cournapeau cournape at gmail.com
Wed Dec 29 05:13:25 CET 2010

On Wed, Dec 29, 2010 at 9:13 AM, Amaury Forgeot d'Arc
<amauryfa at gmail.com> wrote:
> Hello,
> The PyPy project recently switched from svn to mercurial. Since this day I
> have some
> difficulties to perform simple tasks, and my questions did not receive
> satisfying answers.
> I was sure the Python project would have the same issues;
> so I started from the repositories in http://code.python.org/hg/ and
> tried simple
> merges between Python versions.
> I would like several people to try the same example, and tell how they
> handle it.
> I'm new to mercurial, and I may have missed something important!
> Let's say you have to do the simple change shown in the diff below,
> and want to "fix" the the 3 usual versions: py3k, release31-maint,
> release27-maint.
> The diff was made against py3k.
> How would you do it with Mercurial? Please try to do it for real!

The easiest way I found to emulate git cherry-pick (which does exactly
what you want) with hg is to use import/export commands:

It is indeed quite a pain to use in my experience, because you cannot
easily refer to the original commit the cherry pick is coming from
(i.e. no equivalent to git cherry-pick -x), and the conflict
resolution is quite dumb. One alternative is to be careful about where
you apply your patch
but that's not very convenient either.



More information about the Python-Dev mailing list