--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -62,7 +62,7 @@
@with_trailing_slash
@expose('jinja:allura:templates/repo/fork.html')
- def fork(self, to_name=None, project_id=None, mount_label=None):
+ def fork(self, project_id=None, mount_point=None, mount_label=None):
# this shows the form and handles the submission
security.require_authenticated()
if not c.app.forkable: raise exc.HTTPNotFound
@@ -71,16 +71,12 @@
ThreadLocalORMSession.close_all()
from_project = c.project
to_project = M.Project.query.get(_id=ObjectId(project_id))
- mount_label = mount_label or '%s - Code' % c.project.name
- try:
- to_name = (to_name or
- re.search('[a-z]+$', from_project.shortname).group(0))
- except AttributeError:
- to_name = ''
- if request.method != 'POST' or not to_name:
+ mount_label = mount_label or '%s - %s' % (c.project.name, from_repo.tool_name)
+ mount_point = (mount_point or from_project.shortname)
+ if request.method != 'POST' or not mount_point:
return dict(from_repo=from_repo,
user_project=c.user.private_project(),
- to_name=to_name,
+ mount_point=mount_point,
mount_label=mount_label)
else:
with h.push_config(c, project=to_project):
@@ -90,11 +86,11 @@
try:
to_project.install_app(
ep_name=from_repo.tool_name,
- mount_point=to_name,
+ mount_point=mount_point,
mount_label=mount_label,
cloned_from_project_id=from_project._id,
cloned_from_repo_id=from_repo._id)
- redirect(to_project.url()+to_name+'/')
+ redirect(to_project.url()+mount_point+'/')
except exc.HTTPRedirection:
raise
except Exception, ex: