MigrateMergePropFromLaunchpadToGerrit

= Migrating a Merge Prop From Launchpad to Gerrit =

Problem: you have a merge-prop branch in launchpad for nova which you want to propose in gerrit.


 * Set up git-bzr-ng:

$> mkdir -p ~/.bazaar/plugins $> ln -s $(pwd)/bzr-fastimport/ ~/.bazaar/plugins/fastimport $> bzr branch lp:python-fastimport $> bzr branch lp:bzr-fastimport $> export PYTHONPATH=$(pwd)/python-fastimport $> bzr selftest fastimport

$> wget -O ~/bin/git-bzr https://raw.github.com/termie/git-bzr-ng/master/git-bzr $> chmod +x ~/bin/git-bzr


 * Clone nova from git:

$> git clone git://github.com/openstack/nova.git $> cd nova


 * Import your branch from launchpad:

$> git-bzr import lp:~markmc/nova/iscsi-tgtadm-choice iscsi-tgtadm-choice


 * Merge master and record the result on another branch:

$> git checkout iscsi-tgtadm-choice $> git merge origin/master $> git branch iscsi-tgtadm-choice-orig


 * Rebase:

$> git rebase origin/master

You may find yourself having to resolve a painful amount of conflicts because each commit is being rebased onto master. If it gets too painful, see below.


 * Perhaps clean up the commits - e.g. merging pep8 fixes into the commit which introduced the pep8 violation

$> git rebase -i origin/master


 * Check the result is the same as before:

$> git diff iscsi-tgtadm-choice-orig

You should see no difference.


 * Propose the branch

$> ./tools/rfc.sh

Ick! The rebase is painful
Okay, if the rebasing is killing you, then give up and do:

$> git rebase --abort $> git reset --hard origin/master $> git merge --squash iscsi-tgtadm-choice-orig $> git commit -a