Migration from one bazaar repository to multiple new repositories

Asked by Sebastian Messerschmidt

I'm trying to migrate a bzr repository that contains a lot of branches into multiple repositories.
Currently the old repository has a lot of structures where one trunk and several feature branches are related like this:

trunk X
-branch1
...
-branchN

Now in the new respository for say X I want:
Repo X
-trunk
-branch1
...
-branchN

So i create an new repository via bzr init-repo bzr+ssh://new_repo/X
Also I did:
bzr init bzr+ssh://new_repo/X/trunk
bzr init bzr+ssh://new_repo/X/branch1

Now I've exported (via fast-export) the trunk and branches of X via:
bzr fast-export bzr+ssh://old_repo/X/trunk oldXtrunk.fi --export_marks=oldXtrunks.marks
bzr fast-export bzr+ssh://old_repo/X/branch1 oldXbranch1.fi --export_marks=oldXbranch1.marks
(I've also tried to use import-marks=oldXtrunks.marks on the branch, but this only gave me a message that the imported marks can't be used)

If I now do a fast-import on a checkout of the clean(rev 0) trunk:
bzr fast-import oldXtrunk.fi new_repo_trunk
and
bzr fast-import oldXbranch1.fi new_repo_branch1 --import-marks=oldXtrunks.marks I get an error like:

ABORT: exception occurred processing commit :1
bzr: ERROR: bzrlib.errors.NoSuchRevision: CHKInventoryRepository('file:///D:/tmp/repo_testbed/new_swrm_agls/.bzr/repository/') has no revision ...

What am I missing?
I really need the related branches to present and mergeable in the new repositories if they were related before.
Can someone help me with the import/export mark thing here?

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Vincent Ladeuil
Solved:
Last query:
Last reply:
Revision history for this message
Best Vincent Ladeuil (vila) said :
#1

bzr always pull/push what is needed to get a complete branch history.

There is no need to involve fast-{export/import}, just puhs your branches after doing the setup you did to share repositories between related branches, the resulting repositories will contain the revisions that appear in any of the branches.

Revision history for this message
Sebastian Messerschmidt (sebastian-messerschmidt) said :
#2

Thank you Vincent.

Starting with a clean head this morning I figured it out myself.
Anyways, maybe this could be useful for other people too, which why I'll document the complete process:

grab a checkout of you old repo, or check it out:

bzr co bzr://old_repo/trunk trunk_old
bzr co bzr://old_repo/branch branch_old

initialize your new branches:

bzr init bzr://new_repo/trunk
bzr init bzr://new_repo/branch

now simply push them:
cd trunk
bzr push bzr://new_repo/trunk
cd branch
bzr push bzr://new_repo/branch

Revision history for this message
Sebastian Messerschmidt (sebastian-messerschmidt) said :
#3

Thanks Vincent Ladeuil, that solved my question.