[Kde-scm-interest] svn-all-fast-export versus the FreeBSD svn repository

Thiago Macieira thiago at kde.org
Tue Apr 27 09:25:59 CEST 2010


Em Terça-feira 20. Abril 2010, às 20.35.41, você escreveu:
> I finally managed to invest some time and coerce the code into doing the
> right thing for this very conversion. It's still creating some branches
> the wrong way (only branches that were created during the cvs 2 svn
> conversion seem to be affected).

Yeah, it's because of the way cvs2svn creates branches. I thought I had caught 
most of the issues when doing KDE.

But, then again, cvs2svn botched the process for us, so we're not really 
looking at the problem. That is to say, the branches in SVN itself are wrong, 
so there's little we can do to fix it when converting to Git.

> Exporting revision 1401
> ."cvs2svn/branches/AMANCIO" is not a known branch in repository
> "freebsd.git" Going to create it automatically
> ......................................    /cvs2svn/branches/AMANCIO was
> copied from /head rev 653 .freebsd.git : branch cvs2svn/branches/AMANCIO
> is branching from master "cvs2svn/branches/AMANCIO" is not a known branch
> in repository "freebsd.git" Going to create it automatically
> ......................................... 457 modifications from SVN
> /cvs2svn/branches/AMANCIO/ to freebsd.git/cvs2svn/branches/AMANCIO done


> commit 46945c89920691b8e9908583000cebb092d02a81
> Author: cvs2svn <cvs2svn at FreeBSD.org>
> Date:   Sat Apr 23 01:55:46 1994 +0000
> 
>     This commit was manufactured by cvs2svn to create branch 'AMANCIO'.
> 
>     svn path=/cvs2svn/branches/AMANCIO/; revision=1401
> 
> commit 98d78347791b039132bc0d12219bd7df13f833b7
> Author: Andrey A. Chernov;  Black Mage <ache at FreeBSD.org>
> Date:   Sat Apr 23 01:55:45 1994 +0000
> 
>     Updated to version 2.5
> 
>     svn path=/head/; revision=1400
> 
> commit 3e9c475abe03e6da25d0e9b2f921eb1c1918f70c
> Author: Andrey A. Chernov;  Black Mage <ache at FreeBSD.org>
> Date:   Sat Apr 23 01:50:14 1994 +0000
> 
>     Update sound driver to version 2.5
> 
>     svn path=/head/; revision=1399
> 
> So the branch is an successor of rev1400 and not rev 653 like it should
> have been created. Can you give me a clue as to how I might proceed here?

That's a different issue, one that a colleague has run into yesterday too. So 
I'm placing the KDE mailing list for the conversion on Cc.

When creating a branch, the tool simply takes the latest commit from the 
source branch and works off from there.

As you can see, it can find which SVN revision was the origin in SVN. It's a 
matter of matching that SVN revision to a Git commit it made. Remember that in 
SVN you can branch off a past revision that wasn't a commit to the files and 
paths affected.

The solution, that I can think of, is to ensure that all commits are marked 
with git-fast-import, and that the list of commits that were exported be kept 
in memory in the tool (QVector<int> in the Repository class is probably 
enough). 

Later, when a branch is being made, it searches what was the SVN commit 
immediately prior to the the source revision (qLowerBound will do that) and 
tells git-fast-import that that's the source. In Repository:;createBranch, 
where it says:

    fastImport.write("reset " + branchRef + "\nfrom " + branchFromRef + 
"\n\n");

It needs to replace 
	"\nfrom " + branchFromRef
with
	"\nfrom :" + QByteArray::number(mark)

Note, however, that this list of commits would not be saved, which means this 
process would work only for a full run of the tool. Incremental runs wouldn't 
load previous marks and the tool wouldn't know which commits it exported.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Senior Product Manager - Nokia, Qt Development Frameworks
      PGP/GPG: 0x6EF45358; fingerprint:
      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/kde-scm-interest/attachments/20100427/9fe6f5fb/attachment.sig 


More information about the Kde-scm-interest mailing list