jhbuild using a git branch

Posted by Benjamin Close on January 29, 2009 under FreeDesktop | 3 Comments to Read

Recently I’ve been playing around with jhbuild. I wanted to jhbuild to use a custom branch from a git repo I’ve setup.  Sadly the documentation on how to do this is a little lacking. Added to the fact that the jhbuild code drops an argument and there’s a lot of fun at work.

The solution, use the revision attribute in your module set file:

 

 <repository type=”git” name=”git.freedesktop.org”   href=”git://anongit.freedesktop.org/”/>
 <branch repo=”git.freedesktop.org”    module=”~benjsc/xorg/proto/compositeproto” checkoutdir=”xorg/proto/compositeproto” revision=”ir” />

 

This checks out the ir branch of the repo: git://anongit.freedesktop.org/~benjsc/xorg/proto/compositeproto

For those looking at the jhbuild code, you can see the fun with the dropped argument:

class GitRepository

def branch(self, name, module = None, subdir=””, checkoutdir = None,
revision = None, tag = None):
if name in self.config.branches:
module = self.config.branches[name]
if not module:
raise FatalError(_(‘branch for %s has wrong override, check your .jhbuildrc’) % name)
else:
if module is None:
module = name
module = urlparse.urljoin(self.href, module)
return GitBranch(self, module, subdir, checkoutdir, revision, tag)

 

class GitBranch(Branch):
“””A class representing a GIT branch.”””

def __init__(self, repository, module, subdir, checkoutdir=None, branch=None, tag=None):
Branch.__init__(self, repository, module, checkoutdir)
self.subdir = subdir
self.branch = branch
self.tag = tag

So Where revision go?



Donations keep this site alive

  • Mike said,

    Also, where’d repository come from? The call from branch doesn’t include it…

  • anon said,

    n.b., don’t things like this make you wish that python had braces for block delimiters? 😉

  • Larry Reaves said,

    What’s wrong with the branches option in .jhbuildrc?
    branches[‘modulename’] = ‘branchname’
    http://www.freedesktop.org/wiki/Software/jhbuild

    Works great here.

    Also, revision is named branch in the __init__ prototype…

Add A Comment

*