• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ
未設定

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

allura


コミットメタ情報

リビジョン8abe8ac669f8af706807175f1d5ceb52d93e281f (tree)
日時2012-05-17 05:07:38
作者Cory Johns <johnsca@geek...>
コミッターCory Johns

ログメッセージ

[#2886] Some small label, test and default value touch-ups

Signed-off-by: Cory Johns <johnsca@geek.net>

変更サマリ

差分

--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -62,7 +62,7 @@ class RepoRootController(BaseController):
6262
6363 @with_trailing_slash
6464 @expose('jinja:allura:templates/repo/fork.html')
65- def fork(self, to_name=None, project_id=None, mount_label=None):
65+ def fork(self, project_id=None, mount_point=None, mount_label=None):
6666 # this shows the form and handles the submission
6767 security.require_authenticated()
6868 if not c.app.forkable: raise exc.HTTPNotFound
@@ -71,16 +71,12 @@ class RepoRootController(BaseController):
7171 ThreadLocalORMSession.close_all()
7272 from_project = c.project
7373 to_project = M.Project.query.get(_id=ObjectId(project_id))
74- mount_label = mount_label or '%s - Code' % c.project.name
75- try:
76- to_name = (to_name or
77- re.search('[a-z]+$', from_project.shortname).group(0))
78- except AttributeError:
79- to_name = ''
80- if request.method != 'POST' or not to_name:
74+ mount_label = mount_label or '%s - %s' % (c.project.name, from_repo.tool_name)
75+ mount_point = (mount_point or from_project.shortname)
76+ if request.method != 'POST' or not mount_point:
8177 return dict(from_repo=from_repo,
8278 user_project=c.user.private_project(),
83- to_name=to_name,
79+ mount_point=mount_point,
8480 mount_label=mount_label)
8581 else:
8682 with h.push_config(c, project=to_project):
@@ -90,11 +86,11 @@ class RepoRootController(BaseController):
9086 try:
9187 to_project.install_app(
9288 ep_name=from_repo.tool_name,
93- mount_point=to_name,
89+ mount_point=mount_point,
9490 mount_label=mount_label,
9591 cloned_from_project_id=from_project._id,
9692 cloned_from_repo_id=from_repo._id)
97- redirect(to_project.url()+to_name+'/')
93+ redirect(to_project.url()+mount_point+'/')
9894 except exc.HTTPRedirection:
9995 raise
10096 except Exception, ex:
--- a/Allura/allura/templates/repo/fork.html
+++ b/Allura/allura/templates/repo/fork.html
@@ -16,13 +16,13 @@
1616 {% endfor %}
1717 </select>
1818 </div>
19- <label class="grid-4">Repository Name:</label>
19+ <label class="grid-4" for="mount_label">Label:</label>
2020 <div class="grid-15">
21- <input type="text" name="to_name" value="{{to_name}}"/>
21+ <input type="text" name="mount_label" value="{{mount_label}}"/>
2222 </div>
23- <label class="grid-4" for="mount_label">Mount label:</label>
23+ <label class="grid-4">Mount point:</label>
2424 <div class="grid-15">
25- <input type="text" name="mount_label" value="{{mount_label}}"/>
25+ <input type="text" name="mount_point" value="{{mount_point}}"/>
2626 </div>
2727 <label class="grid-4">&nbsp;</label>
2828 <div class="grid-15">
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -38,23 +38,23 @@ class TestRootController(TestController):
3838
3939 def test_fork(self):
4040 r = self.app.get('%sfork/' % c.app.repo.url())
41- assert '<input type="text" name="to_name" value="test"/>' in r
42- assert '<input type="text" name="mount_label" value="test - Code"/>' \
43- in r
41+ assert '<input type="text" name="mount_point" value="test"/>' in r
42+ assert '<input type="text" name="mount_label" value="test - Git"/>' in r
4443
4544 to_project = M.Project.query.get(shortname='test2', neighborhood_id=c.project.neighborhood_id)
46- to_name = 'reponame'
45+ mount_point = 'reponame'
4746 r = self.app.post('/src-git/fork', params=dict(
4847 project_id=str(to_project._id),
49- to_name=to_name,
48+ mount_point=mount_point,
5049 mount_label='Test forked repository'))
50+ assert "{status: 'error'}" not in str(r.follow())
5151 cloned_from = c.app.repo
52- with h.push_context('test2', to_name, neighborhood='Projects'):
52+ with h.push_context('test2', mount_point, neighborhood='Projects'):
5353 c.app.repo.init_as_clone(
5454 cloned_from.full_fs_path,
5555 cloned_from.app.config.script_name(),
5656 cloned_from.full_fs_path)
57- r = self.app.get('/p/test2/%s' % to_name).follow().follow().follow()
57+ r = self.app.get('/p/test2/%s' % mount_point).follow().follow().follow()
5858 assert 'Clone of' in r
5959 assert 'Test forked repository' in r
6060 r = self.app.get('/src-git/').follow().follow()
@@ -64,7 +64,7 @@ class TestRootController(TestController):
6464 to_project = M.Project.query.get(shortname='test2', neighborhood_id=c.project.neighborhood_id)
6565 r = self.app.post('/src-git/fork', params=dict(
6666 project_id=str(to_project._id),
67- to_name='code'))
67+ mount_point='code'))
6868 cloned_from = c.app.repo
6969 with h.push_context('test2', 'code', neighborhood='Projects'):
7070 c.app.repo.init_as_clone(
--- a/ForgeHg/forgehg/tests/functional/test_controllers.py
+++ b/ForgeHg/forgehg/tests/functional/test_controllers.py
@@ -1,6 +1,9 @@
11 import json
22
33 import pkg_resources
4+import pylons
5+pylons.c = pylons.tmpl_context
6+pylons.g = pylons.app_globals
47 from pylons import c
58 from ming.orm import ThreadLocalORMSession
69 from datadiff.tools import assert_equal
@@ -35,7 +38,8 @@ class TestRootController(TestController):
3538 to_project = M.Project.query.get(shortname='test2', neighborhood_id=c.project.neighborhood_id)
3639 r = self.app.post('/src-hg/fork', params=dict(
3740 project_id=str(to_project._id),
38- to_name='code'))
41+ mount_point='code'))
42+ assert "{status: 'error'}" not in str(r.follow())
3943 cloned_from = c.app.repo
4044 with h.push_context('test2', 'code', neighborhood='Projects'):
4145 c.app.repo.init_as_clone(
@@ -51,7 +55,8 @@ class TestRootController(TestController):
5155 to_project = M.Project.query.get(shortname='test2', neighborhood_id=c.project.neighborhood_id)
5256 r = self.app.post('/src-hg/fork', params=dict(
5357 project_id=str(to_project._id),
54- to_name='code'))
58+ mount_point='code'))
59+ assert "{status: 'error'}" not in str(r.follow())
5560 cloned_from = c.app.repo
5661 with h.push_context('test2', 'code', neighborhood='Projects'):
5762 c.app.repo.init_as_clone(