Trilarion / opensourcegames

Technical infos of open source games.
https://trilarion.github.io/opensourcegames/
Creative Commons Zero v1.0 Universal
684 stars 85 forks source link

Bazaar to Git conversion #239

Closed Trilarion closed 4 years ago

Trilarion commented 4 years ago

We need a one time conversion from Bazaar to Git for a few Bazaar repositories (some launchpad and some games). The easiest seems to be fastimport/fastexport.

According to http://www.janosgyerik.com/converting-a-bazaar-repository-to-git/ it is as easy as

pip install bzr fastimport bzr fast-export repo | GIT_DIR=ddd git fast-import

Trilarion commented 4 years ago

GitHub or GitLab do not offer such services automatically.

Trilarion commented 4 years ago

This may be a cleaner tutorial: https://development.robinwinslow.uk/2015/01/10/converting-between-git-and-bzr/

Trilarion commented 4 years ago

On Windows with Python 2.7 or 3.6 pip install bzr fails. It wants to compile C code but cannot, then wants to fallback to Python, but fails there too.

Trilarion commented 4 years ago

Another tutorial, will follow it: https://fpira.com/blog/2016/09/migrate-bazaar-to-git/

Trilarion commented 4 years ago

And there is https://stackoverflow.com/questions/38933053/converting-bazaar-repo-to-git-on-linux and https://softwareengineering.stackexchange.com/questions/202668/how-to-convert-a-bazaar-repository-to-git-repository.

The first goes with the bzr-fastimport package and the later use Github projects (https://github.com/felipec/git-remote-bzr and https://github.com/termie/git-bzr-ng). We only need a one way conversion. Will try out later.

Trilarion commented 4 years ago

The solution on Linux that I use goes like

sudo apt-get install bzr sudo apt-get install bzr-fastimport

Then for all "branches" of a Bazaar project:

bzr repo repo-dir cd repo-dir bzr fast-export | git fast-import git checkout master rm -rf .bzr

and then fetching all the branches in one repository and upload to Gitlab.