how to init a central branch (or is this a wsgi problem)?

Viktor Nagy viktor.nagy at gmail.com
Mon Jul 21 09:53:33 BST 2008


I've read the documentation, but I am still confused

I would like to have a central branch that looks like this

| myproject/
|- trunk/
|- developer1/
 |-branch1/
 |-branch2/
|- developer2/
etc...

I would like to create an initial setup by running a script, I thought
this would work:

        from uuid import uuid4
        from bzrlib.builtins import cmd_init_repository, cmd_init
        from os import mkdir

        location = BAZAAR_REPO_PATH + str(uuid4()) + '/'
        mask = 0750
        mkdir(location, mask)

        bzr_init_repo = cmd_init_repository()
        if bzr_init_repo.run(location, no_trees=True):
            # there was an error
            print 'Error at bzr_init_repo for project %s' % project

        bzr_init = cmd_init()
        mkdir(location+'trunk/', mask)
        if bzr_init.run(location+'trunk/'):
            print 'Error at bzr_init trunk for project %s' % project

but then I do the checkout on myproject/trunk, add some files to it
locally, and try to commit. And the commit doesn't work:
Transport operation not possible: http does not support mkdir()

but when I check the apache logs:
 File does not exist: /path/to/my/repo/myproject/trunk/.bzr/repository

I guess that my wsgi setup is correct. I use mod_wsgi with bzr-smart.py holding
from bzrlib.transport.http import wsgi
from myproject.settings import BAZAAR_REPO_PATH

application = wsgi.make_app(
    root=BAZAAR_REPO_PATH,
    prefix='/repos/',
    path_var='REQUEST_URI',
    readonly=False)

does my script do what it is supposed to do?
is this the way a central repository and some branches beneath it
should be created programmatically?

thanks for your help!
Viktor



More information about the bazaar mailing list