How to merge two projects containing the same files while preserving history.

Asked by amicitas

I want to merge two branches that do not have a common ancestor. The two branches have common files and directories and I would like to preserve history on the files/directories, both before and after the merge.

My first thought was to do a:
bzr merge r 0..-1 path/to/branch

Any files/directories that exist in both branches are marked as a conflict and shown as being deleted and then added. When I complete the merge, only the history from the incoming branch exists.

I ran into this since I started development on a project by getting the source from a tarball, starting my own repository and hacking away. Now I want to merge my revisions into the project repository.

Any help would be appreciated.

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
amicitas
Solved:
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.

Revision history for this message
Martin Pool (mbp) said :
#2

Hi,

Sorry for the delay.

There's no great solution in bzr at present for knitting up the history of separately-imported files. I suggest that you just do the merge from rev 0 as you have, and resolve the conflicts updating the file text appropriately. Then at least the old revision history will be in your new repository, even if it's not perfectly hooked up. We will provide a better solution for this in future.

Revision history for this message
amicitas (mir-amicitas) said :
#3

Thank you for the answer.