Skip to content
Trent Nelson edited this page Aug 4, 2015 · 7 revisions

PyParallel development was initially located at https://hg.python.org/sandbox/trent. This sandbox was a clone/fork of the main hg.python.org CPython repository. The sandbox repo was mirrored here: https://bitbucket.org/python_mirrors/sandbox-trent. I subsequently forked that repo to https://bitbucket.org/tpn/pyparallel, which is where development took place up until August 2015.

In August 2015, the repository was migrated to https://github.com/pyparallel/pyparallel. This was done as follows:

1 Clone https://github.com/fingolfin/git-remote-hg into ~/src/git-remote-hg, add ~/src/git-remote-hg to PATH.

The fingolfin fork was necessary as there's a bug in the upstream felipec repo: https://github.com/felipec/git-remote-hg/issues/27.

1 Git clone https://bitbucket.org/tpn/pyparallel as follows:

% which git-remote-hg
~/src/git-remote-hg/git-remote-hg
% cd ~/src
% git clone "hg:https://bitbucket.org/tpn/pyparallel" px-bb-gh

This process took a few hours. Once completed, the px-bb-gh repo had all branches and tags from the Mecurial repo. I ran git gc --aggressive at this point too.

3 Create empty https://github.com/pyparallel/pyparallel repo and push px-bb-gh to it.

This took a bit of fiddling with .git/config and remotes and checking out the right branches and whatnot. The current .git/config for the repo looks like this:

% cat .git/config 
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
	precomposeunicode = true
#[remote "origin"]
#	url = hg::https://bitbucket.org/tpn/pyparallel
#	fetch = +refs/heads/*:refs/remotes/origin/*
[remote "bitbucket"]
	url = hg::https://bitbucket.org/tpn/pyparallel
	fetch = +refs/heads/*:refs/remotes/origin/*
[remote "github"]
	url = gh:pyparallel/pyparallel
	fetch = +refs/heads/*:refs/remotes/origin/*
[remote "origin"]
	url = gh:pyparallel/pyparallel
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master
#[branch "3.3-px"]
#	remote = github
#	merge = refs/heads/3.3-px
[branch "branches/3.3-px"]
	remote = origin
	merge = refs/heads/branches/3.3-px

Note: gh: is a host alias in my ~/.ssh/config file:

Host gh
    User git 
    IdentityFile ~/.ssh/id_rsa_github
    HostName github.com

Reviewing my zsh history (I should have taken better notes), it looks like the following was done in order to push master and 3.3-px.

% git push -u origin master
% git checkout -t origin/branches/3.3-px
% git push -u origin 3.3-px
% git push --set-upstream origin branches/3.3-px
% git push --tags

4 Mecurial/Git Synchronization

I keep ~/src/pyparallel as a hg clone of https://bitbucket.org/tpn/pyparallel. Its .hg/hgrc looks like this:

% cat .hg/hgrc
[paths]
default = https://bitbucket.org/tpn/pyparallel
upstream = https://hg.python.org/cpython

This allows me to keep the repository in sync with upstream CPython, which I achieve as follows:

% cd ~/src/pyparallel
% hg pull upstream
pulling from https://hg.python.org/cpython
searching for changes
adding changesets
adding manifests
adding file changes                                                                                                                              
added 3273 changesets with 7526 changes to 1622 files                                                                                            
(run 'hg update' to get a working copy)
% hg push default
pushing to https://bitbucket.org/tpn/pyparallel
searching for changes
abort: push creates new remote branches: 3.5!
(use 'hg push --new-branch' to create new remote branches)
% hg push default --new-branch
pushing to https://bitbucket.org/tpn/pyparallel
searching for changes
http authorization required for https://bitbucket.org/tpn/pyparallel                                                                             
realm: Bitbucket.org HTTP
user: tpn
password: 
remote: adding changesets                                                                                                                        
remote: adding manifests                                                                                                                         
remote: adding file changes                                                                                                                      
remote: added 3273 changesets with 7526 changes to 1622 files

I can then bring those changes in via the px-bb-gh git repo:

% cd ~/src/px-bb-gh
% git fetch bitbucket
searching for changes
adding changesets
adding manifests
adding file changes                                                                                                                              
added 3273 changesets with 7526 changes to 1622 files                                                                                            
progress revision 99 'px-pyclear-hackery' (100/58457)
...

Clone this wiki locally