• [^] # Re: me semblait pourtant qu'il existait déjà des outils pour passer de cvs à git?

    Posté par (site web personnel) . En réponse au journal Le compilateur GCC passe à Git. Évalué à 8.

    Sommaire

    Et histoire de donner un exemple de cvs vers svn, voici mes notes d'octobre 2006, sur la conversion du dépôt CVS de l'association April :

    Taille du dépôt CVS local

    $ cvs -dcvs.april.org:/var/lib/cvs co htdocs include
    (...)
    $ du -sk *
    505620 htdocs
    164 include
    

    Taille du dépôt CVS côté serveur

    ns2:/var/lib/cvs# du -sk *
    88 Attic
    4728 CVSROOT
    8 candidats.fr
    3980 cgi-bin
    2084 config
    4 howto-webmastering.wml,v
    690264 htdocs
    188 include
    24884 libre-en-fete
    8404 libreeduc
    800 mantis.april.org
    1784 software
    532 xray
    

    Soit un total de 737760 KiB (et y a probablement des choses uniquement à archiver, pas à convertir, ou alors juste à dumper en attendant un éventuel réimport plus tard)

    Création du SVN

    (surtout ne pas oublier le 'fsfs', on n'en veut pas de la base Berkeley DB 'bdb'...)

    $ svnadmin create --fs-type fsfs /data/svn
    

    (ça créé plein de fichiers dans /data/svn)

    $ cvs2svn --existing-svnrepos -s /data/svn /data/cvs
    (...)
    Pass 1 complete.
    ===========================================================================
    Error summary:
    ERROR: A CVS repository cannot contain both /data/cvs/htdocs/association/ca_temp .wml,v and /data/cvs/htdocs/association/Attic/ca_temp.wml,v
    Exited due to fatal error(s).
    

    Bon, de toute façon, ce fichier ne sert à rien (qui existe encore en ayant été supprimé).
    Pouf viré du CVS. On recommence tout...

    (...)
    ----- pass 2 -----
    Checking for blocked exclusions...
    Checking for forced tags with commits...
    Checking for tag/branch mismatches...
    ERROR: The following symbols are tags in some files and branches in others.
    Use --force-tag, --force-branch and/or --exclude to resolve the symbols.
     'start' is a tag in 208 files, a branch in 1 files and has commits in 1 files.
    

    Humm certes. (utilisé dans candidats.fr, cgi-bin, xray, software et htdocs apparemment). ça serait pas un tag par défaut dans CVS ? Et quelqu'un aurait appelé une branche 'start' ? On doit pouvoir forcer comme tag a priori.

    $ cvs2svn --force-tag start --existing-svnrepos -s /data/svn /data/cvs
    (...)
    ----- pass 2 -----
    Checking for blocked exclusions...
    Checking for forced tags with commits...
    ERROR: The following branches cannot be forced to be tags because they have commits:
     'start'
    

    Bon, toujours pass2... et ben on va oublier start alors...

    $ cvs2svn --exclude start --existing-svnrepos -s /data/svn /data/cvs
    (...)
    ----- pass 2 -----
    Checking for blocked exclusions...
    ERROR: The branch 'start' cannot be excluded because the following symbols depend on it:
     'initial'
    

    Perdu, tu y as cru hein ? Bon reste plus qu'un choix alors...

    $ cvs2svn --force-branch start --existing-svnrepos -s /data/svn /data/cvs
    (...)
    Starting Subversion r299 / 11882
    Starting Subversion r300 / 11882
    (...)
    blabla 11882 révisions quand même en 10 ans...il recréé les révisions une à une, ça rame...
    (...)
    Starting Subversion r7506 / 11882
    ERROR: Unable to convert a path 'trunk/htdocs/secure/ca/documents/documents-internes/subventions/dossier-subvention-april-region-idf-2005/exemple-budget-prévisionnel.pdf' to internal encoding.
    Consider rerunning with (for example) '--encoding=latin1'.
    

    OK on renomme, on choisit le jeu de caractères et on reprend.

    $ cvs2svn --force-branch start --encoding=iso8859-15 --existing-svnrepos -s /data/svn /data/cvs
    (...)
    Starting Subversion r11882 / 11882
    Done.
    cvs2svn Statistics:
    ------------------
    Total CVS Files: 13768
    Total CVS Revisions: 42877
    Total Unique Tags: 14
    Total Unique Branches: 12
    CVS Repos Size in KB: 688362
    Total SVN Commits: 11882
    First Revision Date: Tue Jul 27 17:13:21 1999
    Last Revision Date: Wed Aug 30 23:39:33 2006
    ------------------
    Timings:
    ------------------
    pass 1: 272 seconds
    pass 2: 35 seconds
    pass 3: 0 seconds
    pass 4: 42 seconds
    pass 5: 154 seconds
    pass 6: 0 seconds
    pass 7: 0 seconds
    pass 8: 5180 seconds
    total: 5688 seconds
    

    YES !

    Taille du dépôt SVN local

    $ du -sk svn/trunk/htdocs/ svn/trunk/include/
    1100844 svn/trunk/htdocs/
    572 svn/trunk/include/
    

    Taille du dépôt SVN sur le serveur

    $ du -sk *
    k *
    16 conf
    4 dav
    641044 db
    4 format
    40 hooks
    12 locks
    4 README.txt
    

    Vraie migration sur le serveur

    $ svnadmin create --fs-type fsfs /var/lib/svn/web
    $ svnadmin create --fs-type fsfs /var/lib/svn/admins
    $ svnadmin create --fs-type fsfs /var/lib/svn/ca
    $ cvs2svn --force-branch start --encoding=iso8859-15 --existing-svnrepos -s /var/lib/svn/web /var/lib/cvs.old
    cvs2svn Statistics:
    ------------------
    Total CVS Files: 14658
    Total CVS Revisions: 42648
    Total Unique Tags: 14
    Total Unique Branches: 12
    CVS Repos Size in KB: 687917
    Total SVN Commits: 10547
    First Revision Date: Tue Jul 27 17:13:21 1999
    Last Revision Date: Sun Oct 22 05:03:16 2006
    ------------------
    Timings:
    ------------------
    pass 1: 131 seconds
    pass 2: 6 seconds
    pass 3: 0 seconds
    pass 4: 20 seconds
    pass 5: 36 seconds
    pass 6: 2 seconds
    pass 7: 0 seconds
    pass 8: 3384 seconds
    total: 3582 seconds
    $ svn checkout svn+ssh://...@april.org/var/lib/svn/web
    $ svn checkout svn+ssh://...@april.org/var/lib/svn/admins
    $ svn checkout svn+ssh://...@april.org/var/lib/svn/ca
    $ grep binaire DIFF|grep -vE "\.(jpg|png|gif|doc|odt|pdf|xls|sxw|sxc|JPG|jpeg|bz2|avi|gz|zip|tar|sxi|odp|xcf|tgz|dia|vsd|mo|ttf|swf|ods)"
    Les fichiers binaires htdocs/dotproject/files/27/27547881427c929d2ba98 et htdocs.new/dotproject/files/27/27547881427c929d2ba98 sont différents.
    Les fichiers binaires htdocs/dotproject/modules/admin/kik et htdocs.new/dotproject/modules/admin/kik sont différents.