ClearChain

jhbuild using a git branch

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?

Exit mobile version