def init(self, username, reponame, force, backend=None):
key = self.key(username, reponame)<EOL>server_repodir = self.server_rootdir(username,<EOL>reponame,<EOL>create=False)<EOL>if os.path.exists(server_repodir) and not force:<EOL><INDENT>raise RepositoryExists()<EOL><DEDENT>if os.path.exists(server_repodir):<EOL><INDENT>shutil.rmtree(server_repodir)<EOL><DEDENT>os.makedirs(server_repodir)<EOL>with cd(server_repodir):<EOL><INDENT>git.init("<STR_LIT:.>", "<STR_LIT>")<EOL><DEDENT>if backend is not None:<EOL><INDENT>backend.init_repo(server_repodir)<EOL><DEDENT>repodir = self.rootdir(username, reponame, create=False)<EOL>if os.path.exists(repodir) and not force:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>if os.path.exists(repodir):<EOL><INDENT>shutil.rmtree(repodir)<EOL><DEDENT>os.makedirs(repodir)<EOL>with cd(os.path.dirname(repodir)):<EOL><INDENT>git.clone(server_repodir, '<STR_LIT>')<EOL><DEDENT>url = server_repodir<EOL>if backend is not None:<EOL><INDENT>url = backend.url(username, reponame)<EOL><DEDENT>repo = Repo(username, reponame)<EOL>repo.manager = self<EOL>repo.remoteurl = url<EOL>repo.rootdir = self.rootdir(username, reponame)<EOL>self.add(repo)<EOL>return repo<EOL>
Initialize a Git repo

Parameters
----------

username, reponame : Repo name is tuple (name, reponame)
force: force initialization of the repo even if exists
backend: backend that must be used for this (e.g. s3)