def checkoutCmd(server, repo, branch, revision=None, name=None):
    """checkoutCmd( "bzr+ssh://pyre.cacr.caltech.edu", "home/projects/pyre/web/repository", "1.0/pyre.db-jiao-experiment")
    """
    if name is None:
        raise ValueError('name is None')
    cmd = ['bzr branch']
    if revision:
        cmd.append('-r %s' % revision)
    cmd.append('%(server)s/%(repo)s/%(branch)s %(name)s' % locals())
    return ' '.join(cmd)
