Estos son los scripts obtenidos de Hivelogic para migrar repositorios de Mercurial a Git.
Contenido
Repositorios
Los scripts pueden obtenerse del repositorio original:
o del fork de Cross Forests:
Ejemplo de uso
Basado en el procedimiento descripto en http://hivelogic.com/articles/converting-from-mercurial-to-git/
Descargar los scripts de conversión
Los scripts pueden ser descargados de cualquiera de los repositorios ateriormente mencionados:
$ git clone http://crossforests.com/git/python/fast-export.git Clonar en «fast-export»... remote: Counting objects: 2320, done. remote: Compressing objects: 100% (921/921), done. remote: Total 2320 (delta 845), reused 2320 (delta 845) Receiving objects: 100% (2320/2320), 379.08 KiB | 0 bytes/s, done. Resolving deltas: 100% (845/845), done. Comprobando la conectividad… hecho.
Clonar el repositorio Mercurial original
En este caso se tomará de base el proyecto seg_digit en los antiguos repositorios Mercurial de Cross Forests.
$ hg clone http://hg.crossforests.com/public/openscad/seg_digit seg_digit.orig requesting all changes adding changesets adding manifests adding file changes added 18 changesets with 22 changes to 2 files updating to branch default resolving manifests getting digit7.scad getting seg_digit.scad 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
Crear un repositorio git auxiliar
$ git init aux Initialized empty Git repository in /tmp/aux/.git/
Realizar la migración sobre el repositorio auxiliar
$ cd aux/ $ ../fast-export/hg-fast-export.sh -r ../seg_digit.orig/ master: Exporting full revision 1/18 with 1/0/0 added/changed/removed files master: Exporting simple delta revision 2/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 3/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 4/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 5/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 6/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 7/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 8/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 9/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 10/18 with 1/1/0 added/changed/removed files master: Exporting simple delta revision 11/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 12/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 13/18 with 0/2/0 added/changed/removed files master: Exporting simple delta revision 14/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 15/18 with 0/1/0 added/changed/removed files master: Exporting simple delta revision 16/18 with 0/2/0 added/changed/removed files master: Exporting simple delta revision 17/18 with 0/2/0 added/changed/removed files master: Exporting simple delta revision 18/18 with 0/1/0 added/changed/removed files Issued 18 commands git-fast-import statistics: --------------------------------------------------------------------- Alloc'd objects: 5000 Total objects: 58 ( 0 duplicates ) blobs : 22 ( 0 duplicates 20 deltas of 21 attempts) trees : 18 ( 0 duplicates 2 deltas of 18 attempts) commits: 18 ( 0 duplicates 0 deltas of 0 attempts) tags : 0 ( 0 duplicates 0 deltas of 0 attempts) Total branches: 1 ( 1 loads ) marks: 1024 ( 18 unique ) atoms: 2 Memory total: 2344 KiB pools: 2110 KiB objects: 234 KiB --------------------------------------------------------------------- pack_report: getpagesize() = 4096 pack_report: core.packedGitWindowSize = 1073741824 pack_report: core.packedGitLimit = 8589934592 pack_report: pack_used_ctr = 2 pack_report: pack_mmap_calls = 1 pack_report: pack_open_windows = 1 / 1 pack_report: pack_mapped = 28617 / 28617 ---------------------------------------------------------------------
Clonar el repositorio auxiliar para normalizar el nombre
$ cd .. $ git clone aux/.git seg_digit Clonar en «seg_digit»... hecho.