← Back to team overview

vm team mailing list archive

[vm-devel] Don't merge. rebase.

 

This is the first in a series of coding tips for VM developers.

When you create a branch for development under Bazaar, the trunk moves
on and there is a desire to merge changes from the trunk into your
branch.  This usually ends up with a very confused history of the
form:

   rev 901  change #1
   rev 902  merge from trunk
   rev 903  change #2
   rev 904  merge from trunk
   rev 905  merge from trunk
   ...
   rev 915  change #3

Each merge would have several revisions copied under it.  It is hard
to reconstruct the history of changes from such a cross-merge.

Instead, you should use 'bzr rebase'.  It is done the same way as 'bzr
merge'.  It will rearrange the history so that it looks like

   rev 901 <copied from trunk>
   ...
   rev 940 <copied from trunk>
   rev 941 change #1
   rev 942 change #2
   rev 943 change #3

Resolving conflicts is supposed to work the same way as merge.  When
we merge the branch back into the trunk, the revisions originally
copied from the trunk will be ignored, of course.

'rebase' is supposed to be a bazaar "plugin".  But it was already
included in my standard installation of bazaar.  Do 'bzr plugins' to
check if it is already installed.  Here is more info:

   http://doc.bazaar.canonical.com/plugins/en/rebase-plugin.html

Cheers,
Uday



Follow ups