I’ve been hassling Brian to move libmemcached to bazaar for a while now, tonight we finally got a continuous import from mercurial going into bazaar, and published on launchpad. Using bzr fast-import along with hg-fast-export, this was really easy. I’m thrilled to see all the fast-export/fast-import tools that have sprouted up between git, mercurial, and bazaar. Here is the script I stuck in cron to do the continous import (every 6 hours or so), feel free to make fun of my crappy shell scripting.
# move into the hg repo and check if hg repo has new revisions
# hg incoming will exit 1 if no new revisions, 0 if new revisions
if [ "$?" -eq "0" ]; then
# pull hg repo
echo "New mercurial revisions found upstream, pulling"
echo "No new mercurial revisions found, exiting"
# move back to our bazaar shared repo
# run fastimport to get the latest revisions into bzr
echo "Importing new revisions into bazaar repo"
$HG_FAST_EXPORT --repo=../libmemcached/ | bzr fast-import -
export LAUNCHPAD_ID=`bzr launchpad-login`
# loop through all branches, pushing them to launchpad
for directory in *
if [ -d "$directory" ]; then
echo "Pushing $directory to launchpad"
pushd $directory > NUL
echo "bzr push bzr+ssh://$LAUNCHPAD_ID@bazaar.launchpad.net/~libmemcached-developers/libmemcached/$directory"
bzr push bzr+ssh://$LAUNCHPAD_ID@bazaar.launchpad.net/~libmemcached-developers/libmemcached/$directory
I’m pleased to announce that I’ve converted most of the last 10 years of Erlang history into a Bazaar branch. I did this by downloading all the source releases, then progressively importing and committing into Bazaar branch, then publishing the whole thing to Launchpad. Just click on the code tab to get directions for grabbing the code. This makes it possible to look at the changes that have happened between releases – not quite as granular and direct a view of the evolution of the code as you would hope for a real open source project, but much better than a pile of tarballs. Here is a screenshot of Bazaar-GTK looking at some changes in the most recent release:
I had trouble importing a few of the tarballs, and didn’t have time to sort it out – you’ll notice that otp_src_R10B-0, -4, -6, -8, -10 are missing. If anyone is interested in creating this type of history for other open source projects that are stuck with a proprietary version control system that the general public can’t access, feel free to contact me – this stuff is fun and valuable for the community.
Tonight another UPS failed. Same brand as before, these little black APC units. It failed the same way as the last one, by going into a perpetual 15 second power off/on cycle. I had bought these small units to run my little router and cable modem, wanting to have a separate power source for the cable modem than I had for my big power hungry computers. The idea is that during an extended power outage my cable modem could actually stay up for a couple of hours (and so could my laptop batteries). This strategy paid off for me a couple of years ago when I was working for MySQL, I actually lost power for several hours but was able to keep working with the rest of the team, just sat there in the dark and ran off the laptop battery.
It is quite strange that these little black APC units seem so prone to failure, I’ve also got a couple much larger APC battery backups and those are still running just fine.
At any rate, I’m happy that the battery backup finally had a catastrophic failure. I believe it was intermittently failing because I was getting intermittent network outages every day or two for the last couple of weeks, and it was annoying. I noticed the outages because I actually have a couple of services that I am trying to keep running, like the bot that announces on our private IRC channel at work whenever code is merged into the main Launchpad source tree, and some other similar things.
Late last night I finally got the Statiksoft LLC taxes completed, which had to be completed before I could finish my personal taxes, and this morning before work got everything mailed off and finished. One good thing I learned is that I can probably open up an invididual 401K because of being a part owner of Statiksoft, even though I’m currently only spending a couple hours a week running the company (no, I don’t sleep much). I work full time for Canonical (we’re hiring!), but since they are currently located in the UK, I don’t get any health care or 401K, so this is a nice little benefit.