Fixing unrelated branches

Asked by Carl Richell

When initially uploading 2.0 and trunk branches I used separate local directories and separate bzr init > bzr push rather than branching off of 2.0 to create trunk (which I think would have been appropriate). Now I can't merge the unrelated branches.

bzr: ERROR: Branches have no common ancestor, and no merge base revision was specified.

How can I fix this without hosing things further? Code in trunk can be overwritten.

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Solved by:
Tom Haddon
Last query:
Last reply:
Revision history for this message
Best Tom Haddon (mthaddon) said :

This is based on the assumption that it's okay to lose trunk's history. If this isn't the case, it may be worth looking into how to specify a base revision for a merge when none is obvious in bzr. Let's assume you have a base directory ($BASEDIR) locally that has subdirectories for 2.0 and trunk.

I think you can simply delete the local trunk branch with as follows:

rm -rf trunk

And then do the following to recreate the trunk branch (this will branch it from 2.0):

bzr branch 2.0 trunk

Then you can cd into the trunk branch/directory and do:

bzr push --remember --overwrite <remote-location>

Revision history for this message
Carl Richell (carlrichell) said :

Thanks Tom. Problem solved.

Cheers, Carl