GitXplorerGitXplorer
M

chic_a_cherry_picker

public
2 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
9c31375d82fa83665fa299883708473f3a08939b

Handle running directly from CPython dir (#12)

nncoghlan committed 8 years ago
Unverified
8ea186e7820cd11b8b14669e3817b50b6c93692e

lol typo: fetchin -> fetching

MMariatta committed 8 years ago
Unverified
14e85d7b872026508aadb9ed34452713cefb38ab

blah

MMariatta committed 8 years ago
Unverified
430a91d1b3f41a8b243e619e9d422e0de0d0c052

more disclaimer

MMariatta committed 8 years ago
Unverified
a06f9c8daad4bd04ba3a3681c030d615e14ac637

update readme (#11)

MMariatta committed 8 years ago
Unverified
b7341057f78d1783e1db6baf6f9d344142a6e3ad

Open PR page with branches preselected after backporting (#10)

MMariatta committed 8 years ago

README

The README file for this repository.

Usage::

python -m cherry_picker <commit_sha1>

.. contents::

About

Use this to backport cpython changes from master into one or more of the maintenance branches (3.6, 3.5, 2.7).

This script will become obsolete once the cherry-picking bot is implemented.

There is no unit tests 😭 .... I tested this in production 😅

Setup Info

Requires Python 3.6 and virtualenv.

::

$ git clone https://github.com/Mariatta/chic_a_cherry_picker.git
$ cd chic_a_cherry_picker
$ virtualenv venv
$ source venv/bin/activate
(venv) $ pip install -r requirements.txt
(venv) $ git clone https://github.com/Mariatta/cpython.git  #or your own cpython fork
(venv) $ cd cpython
(venv) $ git remote add upstream https://github.com/python/cpython.git
(venv) $ cd ../

Cherry-picking 🐍 🍒 ⛏️

(Setup first! See prev section)

::

(venv) $ python -m cherry_picker <commit_sha1> <branches>

The commit sha1 is obtained from the merged pull request on master.

For example, to cherry-pick 6de2b7817f-some-commit-sha1-d064 into 3.5 and 3.6:

::

(venv) $ python -m cherry_picker 6de2b7817f-some-commit-sha1-d064 3.5 3.6

What this will do:

::

(venv) $ cd cpython

(venv) $ git fetch upstream

(venv) $ git checkout -b 6de2b78-3.5 upstream/3.5
(venv) $ git cherry-pick -x 6de2b7817f-some-commit-sha1-d064 
(venv) $ git push origin 6de2b78-3.5
(venv) $ git checkout master
(venv) $ git branch -D 6de2b78-3.5

(venv) $ git checkout -b 6de2b78-3.6 upstream/3.6
(venv) $ git cherry-pick -x 6de2b7817f-some-commit-sha1-d064 
(venv) $ git push origin 6de2b78-3.6
(venv) $ git checkout master
(venv) $ git branch -D 6de2b78-3.6

In case of merge conflicts or errors, then... the script will fail 😛

Creating Pull Requests

When a cherry-pick was applied successfully, this script will open up a browser tab that points to the pull request creation page.

The url of the pull request page looks similar to the following::

https://github.com/python/cpython/compare/3.5...Mariatta:6de2b78-3.5?expand=1

  1. Prefix the pull request description with the branch [X.Y], e.g.::

    [3.6] bpo-xxxxx: Fix this and that

  2. Apply the appropriate cherry-pick for ... label

  3. Press the Create Pull Request button.

  4. Remove the needs backport to ... label from the original pull request against master.