This is the archive for June 2008. Recent posts can be found at the main blog page.
Recently there has been some buzz about using Bazaar for Gnome development. There is even a semi-official Gnome Bazaar source code mirror. All of this has been made possible by the great Bazaar Subversion integration plugin.
However, most descriptions and use cases seem to describe how to import source code (and revision history) from Subversion to Bazaar, not how to import from Bazaar into Subversion. The latter is exactly what I needed, since I wanted to move Gnome Specimen to Gnome Subversion to be able to use the Gnome i18n infrastructure for my project.
While pushing revisions from Bazaar to Subversion is quite easy with the
bzr-svn plugin, e.g.
bzr push works quite well, there are a few gotchas if you want to move your original Bazaar branch to the
trunk/ branch of a newly created Subversion repository.
Below, I’ll describe what I’ve done to import my Gnome Specimen Bazaar branch into Gnome Subversion.
First of all, create a new Gnome Subversion repository. Since I already have a Subversion account, this was easy:
ssh svn.gnome.org new-svn-repos gnome-specimen
Gnome Subversion has a pre-commit hook that checks for a valid
MAINTAINERS file in the
trunk/ directory. An example MAINTAINERS file is available here. Therefore, before I could proceed, I had to create a svn checkout of the newly created repository and add that file:
cd /tmp svn checkout svn+ssh://svn.gnome.org/svn/gnome-specimen gnome-specimen cd gnome-specimen/trunk vi MAINTAINERS # edit and save svn add MAINTAINERS svn commit -m 'Added MAINTAINERS file'
Now you can push the Bazaar branch to Subversion. I’m using a branch for the import:
cd /path/to/gnome-specimen-bzr-branch/ bzr svn-push svn+ssh://svn.gnome.org/svn/gnome-specimen/branches/import-from-bzr/
The next step is to move the imported branch to
trunk/. This is a bit involved because of the pre-commit hook mentioned above: in order to move the branch, you have to remove the old
trunk/ directory (it contains just the MAINTAINERS file), commit that deletion (this is where it fails), then move the branch to trunk. The solution is to ask a Gnome Subversion maintainer, e.g. Olav to remove the
trunk/ directory using a command like this:
svn rm svn+ssh://svn.gnome.org/svn/YOUR-PROJECT-NAME/trunk
Once that was done (very quickly; IRC is great for this), I could move the import:
cd /tmp/gnome-specimen svn up svn mv branches/import-from-bzr trunk svn commit -m 'Moved Bazaar import branch to trunk'
We’re done! You can remove the svn checkout in
/tmp/, since you no longer need it:
rm -fr /tmp/gnome-specimen/
And now? I keep developing in my original Bazaar branch and regularly push/pull to Gnome Subversion to keep them in sync. Initial setup for syncing goes like this (so that it is remembered):
cd /path/to/gnome-specimen-bzr-branch/ bzr pull --remember svn+ssh://svn.gnome.org/svn/gnome-specimen/trunk/ bzr push --remember svn+ssh://svn.gnome.org/svn/gnome-specimen/trunk/
From now on I can just type
bzr pull and
bzr push to sync my Bazaar branch with Subversion trunk.
I’ve recently imported my Gnome Specimen development branch into Gnome Subversion from my original Bazaar branch using the great
bzr-svn plugin for Bazaar. Another article by me describes how to import Bazaar branches into Gnome.
The main reason for the move is that Gnome translation teams can now track Gnome Specimen just like any other Gnome module. I’ve updated the Gnome L10N Damned Lies website to include the Gnome Specimen module translation statistics. As you can see, there’s some work to do for the translators!
(Side note: the day Gnome adopts Bazaar as the official version control system would be worth a party…)
Therefore, contributors and distributors are encouraged to use the Gnome Specimen SVN repository as the main source code repository from now on. I still develop Gnome Specimen using Bazaar, but the public mirror of the gnome-specimen.uws branch has disappeared in favor of the Gnome hosted Subversion repository.
Note that bugs are still tracked using the Gnome Specimen bug tracker on Launchpad.
Wouter Bolsterlee, also known as uws, a postmodern geek living in the Netherlands. Read more about me…
Unless stated otherwise, all material on this site is available under a Creative Commons Share-Alike license.