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.

https://code.launchpad.net/system76-driver/

Question information

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

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:

cd $BASEDIR
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 :
#2

Thanks Tom. Problem solved.

Cheers, Carl