Pushing local converted repo to empty server repo


#1

Hi Team,

I have been converting a few repos from mercurial to Bitkeeper and I am running across an issue that is confusing to me. I am creating an empty repo on my server and trying to push the ( local ) converted repo to the server and I get the message:

You are trying to push to an unrelated package.
Please check the names and try again.

I am assuming that this is failing because the ids of both repos do not match. Is there a way to reset the id to a know value so that I can push those change sets from the local repo to the one on the server? Right now I am tarring up the local repo and transferring it to the server and then clone and remove the original. I’m hoping there is an easier way to do this.

Thanks


#2

Have you seen bk bin/contrib/git2bk.l ? That shows you how to force things to the same id.
I’m currently hacking on that file because it has some bugs but you might consider that as a
baseline.

What are you using to convert the repos now?


#3

My current workflow is hg->git->bk.

I wrote a small script that uses fast-export from http://repo.or.cz/w/fast-export.git to do the initial conversion and then git2bk.l for the last leg of the conversion.

When I started the conversion, I didn’t have any empty repos on the server yet and ended up creating the repos on the server after the conversions were complete


#4

Oh, sorry, I get it. You don’t want push for that first one. BK repos all have identifiers (it knows that this one is the kernel and that one is the libc, that error message is what you will get if you try and push libc to the kernel).

You want rclone. Instead of

bk push bk://whatever

use

bk clone bk://whatever

and it will just clone it. Don’t create an empty repo, that’s a different id.


#5

Sorry I’m a little confused… and maybe its because I am used to how git and mercurial work in this situation. In my situation, I would like a user to be able to add my server as another parent (maybe a mirror?) and push those changesets without having to upload their repo and unpack it on the server.

At the moment, I am converting the repos on my laptop and then tarring up the repos, sftping them over to the server and unpacking them ( resetting permissions, etc ). I should also mention that I am using bkd launched from a login shell over ssh ( not sure if that matters or not ).


#6

Larry gave you the wrong syntax. You want to use this:

bk clone myrepo ssh://server/newrepo

(where newrepo is a directory that doesn’t currently exist on the remote server.)

This a reverse clone that pushes the local repository to the remote server. In git you can push and pull between ANY two repositories. BitKeeper has a most constrained model, only repositories that are related to each other can communicate and so the initial copy to a new machine needs to be using bk clone, but clone can be done is both directions.


#7

yep that did it it. Thanks!


#8

Just so you know, that git2bk.l script is suboptimal (that’s being charitable). We’re working on a bk fast-import that should be better.

The intent of the git2bk.l script was to give you a way to get your history into BK so you could see it. But I wouldn’t depend on it, it’s got lots of problems.

The fast-import stuff has issues as well but it’s the path forward. And it is much faster than the git2bk stuff.

On the other hand, if git2bk.l lets you play, that’s great. Just be aware that the two are incompatible and you’ll want the bk fast-import going forward.