--- a/ForgeGit/forgegit/git_main.py
+++ b/ForgeGit/forgegit/git_main.py
@@ -97,6 +97,13 @@
create=[role_developer],
write=[role_developer],
admin=c.project.acl['tool'])
+ repo = model.GitRepository()
+ repo.name = self.config.options.mount_point + '.git'
+ repo.fs_path = '/git/' + c.project.shortname + '/'
+ repo.url_path = '/' + c.project.shortname + '/'
+ repo.tool = 'git'
+ repo.status = 'initing'
+ g.publish('audit', 'scm.git.init', dict(repo_name=repo.name, repo_path=repo.fs_path))
def uninstall(self, project):
@@ -106,8 +113,8 @@
def _uninstall(self, routing_key, data):
"Remove all the tool's artifacts and the physical repository"
repo = self.repo
- if repo is not None and repo.path:
- shutil.rmtree(repo.path, ignore_errors=True)
+ if repo is not None:
+ shutil.rmtree(repo.full_fs_path, ignore_errors=True)
model.GitRepository.query.remove(dict(app_config_id=self.config._id))
super(ForgeGitApp, self).uninstall(project_id=data['project_id'])
@@ -133,26 +140,6 @@
revisions=revisions,
next_link=next_link,
offset=offset)
-
- @expose()
- def init(self, name=None):
- require(has_artifact_access('create'))
- if request.method != 'POST':
- raise Exception('init must be a POST request')
- repo = c.app.repo
- if repo is None:
- repo = model.GitRepository()
- if not name:
- name = c.project.shortname.split('/')[-1]
- if not name.endswith('.git'):
- name += '.git'
- path = '/git/' + c.project.shortname + '/' + c.app.config.options.mount_point + '/'
- repo.name = name
- repo.path = path
- repo.tool = 'git'
- repo.status = 'initing'
- g.publish('audit', 'scm.git.init', dict(repo_name=name, repo_path=path))
- redirect('.')
@with_trailing_slash
@expose('forgewiki.templates.search')
@@ -200,12 +187,6 @@
return feed.writeString('utf-8')
@expose()
- def _lookup(self, name, *remainder):
- return RepoController(), remainder
-
-class RepoController(object):
-
- @expose()
def _lookup(self, hash, *remainder):
return CommitController(hash), remainder