[Vcs-fast-import-devs] fast-import mirroring a foreign repository

Miklos Vajna vmiklos at frugalware.org
Tue Sep 8 11:26:09 BST 2009


On Tue, Sep 08, 2009 at 06:10:05AM -0400, Matt McClure <matthewlmcclure at gmail.com> wrote:
> What is the recipe using the marks options to:
> 
> 1. Do an initial export from one VCS;
> 2. Import it to another VCS;
> 3. Do an incremental export from the first VCS;
> 4. Import the incremental changes to the second VCS?

Here is an example.

You have a git repo with 2 commits,
6ea71fe7d36cf5b81c2100d97a822ecf0bc04746 and
14b772a0d7cb983ab0c13d672ea89192c460d070.

When you use git-fast-export, it will produce something like:

----
commit refs/heads/master
mark :1
data X
first commit

commit refs/heads/master
mark :2
data Y
second commit
from :1
----

So in the exporter side you store the :1 <->
6ea71fe7d36cf5b81c2100d97a822ecf0bc04746 and :2
<->14b772a0d7cb983ab0c13d672ea89192c460d070 mapping.

Now if you create a third commit in git, let's say
e1f8f0cfbef594edd12aba13df8ec53d401ce944, then git-fast-export will
produce:

----
commit refs/heads/master
mark :3
data Z
third commit
from :2
----

And the "from :2" line is because
14b772a0d7cb983ab0c13d672ea89192c460d070 is a parent of
e1f8f0cfbef594edd12aba13df8ec53d401ce944, and from the marks file it
knows that 14b772a0d7cb983ab0c13d672ea89192c460d070 should be mapped to
:2.

It's the same on the importer side, just when you do an incremental
import, you will need the marks file to know that :2 means for example
"r2" in bzr.

HTH.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20090908/ae557e07/attachment-0002.pgp 


More information about the bazaar mailing list