Showing posts with label bzr-vs-git-cagematch. Show all posts
Showing posts with label bzr-vs-git-cagematch. Show all posts

Wednesday, June 24, 2009

My current method for tracking/gitifying changes in foriegn VCSes

In vmbuilder.git we deal with a lot of upstream branches on launchpad being tracked with bazzar. So, I have to convert those revisions to git commits. This is how I handled importing a new branch from launchpad that branched from Bzed's r344 today:

#grab the revision
bzr branch lp:~ckaenzig/+junk/lenny
cd vmbuilder
#go to the point this revision branches from - note that this is a tag and not a branch
git checkout bzed_vmbuilder_debian-r344
#make a new branch for the underlying bzr branch
git checkout -b ckaenzig_junk_lenny
#clear out the current git working area, to reflect any RMs in the bzr revision
git rm * -r
#clear out any untracked files, such as .pyc and .py~
rm * -rf
#copy the revision over to the git repo, and stage it
cp ../lenny/* . -r
git add * -r
#make a new commit on this branch, which should now reflect the underlying bzr revision.
git commit -m "New bzr branch lp:~ckaenzig/+junk/lenny"
#tag the commit by it's underlying bzr revision number for easy reference
git tag ckaenzig_junk_lenny-r346 -a

This process generally works, but it requires careful attention and is easy to screw up. For example, I have to do a second rm to remove files that aren't being tracked by git (.pyc, .py~ files) , otherwise I end up committing junk that might be from another branch entirely when I stage the new revision. Not to mention that I may miss a revision this way. Say I have a branch A in bzr that I've manually imported this way for revisions r100, r123, and I wanna import branch B which breaks off from branch A at r112, I have to either put the new git branch at r100 (and have slightly inaccurate commit history) or start moving commits around, which I've never tried and probably doesn't push well. Fortunately VMbuilder doesn't get that many commits per day so I usually am able to keep on top of 'em.

Is there an easier way to convert bzr revisions into git commits? I'm horribly unfamiliar with bzr, so I haven't really investigated automating this process.

Thursday, June 18, 2009

yay mass commit bombs!

More work on VMbuilder - after fixing how the Debian plugin finds Xen kernels I got it to build a Xen image. (The Debian plugin was looking for images the way Ubuntu versions them, not the way Debian versions them) Now I need to figure out building EC2 images and such.

And send bzed a patched distro.py.

Tuesday, June 16, 2009

Epic merge fail

(seven less than symbols since blogger can't handle them)
#import sys
#import os
#sys.path += [os.getcwd()]

import VMBuilder
=======
class Suite(object):
def __init__(self, vm):
self.vm = vm
self.isodir = '/media/vmbuilder_inst_image'
self.iso_mounted = False
(seven greater than symbols since blogger can't handle them)vmbuilder_trunk:VMBuilder/plugins/ubuntu/suite.py

This happened to come from my attempt to merge VMbuilder trunk 0.11 with the current master; Git thought suite.py was moved to debian-vm-builder and tried to merge it.

Oh and yes that also means VMbuilder trunk 0.11 is now in alioth. I can't believe I missed it. It includes all the EC2 stuff without the install_[hardy,intrepid,jaunty] cruft as well.

So, to-do list:
  • Get Debian plugins working with EC2 VMbuilder. The debian plugin branch on Launchpad hasn't been updated since June 6th; maybe bzed maintains another repo?
  • Try building the package and installing it. Side note: They removed packaging info from the trunk midway between 0.10 and 0.11, but I kept the /debian folder anyway in vmbuilder.git.
  • Speaking of which during the merge I noticed the default sudoers template explicitly references an "ubuntu" group, something that should be changed eventually.
  • Look into the vmbuilder-gui branch sometime.

fs weirdness

So I was in the middle of refreshing my vmbuiler sources when I got an out-of-disk error in the middle of the bzr pull. Fine, so I fired up Filelight, excluded /media and checked to see how much was being used... 5GBs. On a 19GB partition. Feeling this to be a bit odd I figured I'd rather extend the partition another gigabyte. I fire up the Ubuntu partiton, load gparted, and.... it reports the Debian partition as being 5GBs used. Odd. So I extend the partition back a gig, which takes a great deal of time. That's done, so I remount the new debian, fixup grub, restart, and get a kernel panic.

It is at this point that I remember that I had hibernated Debian instaed of shutting it down, and then I moved the filesystem out from under it. So I reboot again, it works. First thing I do after login is check "df"... and the drive reports 5GBs used.

I'm not a master at kernel internals but I have at least part of an inkling that the missing 14 gigabytes of space had something to do with hibernating and restoring the machine multiple times.

In other news it looks like there is a branch vmbuilder-gui, which I'll have to look into sometime.