You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by tv...@apache.org on 2014/02/11 06:13:45 UTC
[1/4] git commit: [#7069] ticket:527 Add test for merge request page
Updated Branches:
refs/heads/master 52ad1f406 -> 1ad33e158
[#7069] ticket:527 Add test for merge request page
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/1ad33e15
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/1ad33e15
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/1ad33e15
Branch: refs/heads/master
Commit: 1ad33e1589d1a3df112f328b9ffb31da23a18a0f
Parents: 2b45973
Author: Yuriy Arhipov <yu...@yandex.ru>
Authored: Thu Feb 6 13:56:43 2014 +0400
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Feb 11 05:13:08 2014 +0000
----------------------------------------------------------------------
.../forgegit/tests/functional/test_controllers.py | 14 ++++++++++++++
1 file changed, 14 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/1ad33e15/ForgeGit/forgegit/tests/functional/test_controllers.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/tests/functional/test_controllers.py b/ForgeGit/forgegit/tests/functional/test_controllers.py
index c9d296c..e4ccc51 100644
--- a/ForgeGit/forgegit/tests/functional/test_controllers.py
+++ b/ForgeGit/forgegit/tests/functional/test_controllers.py
@@ -537,6 +537,20 @@ class TestFork(_TestCase):
assert 'git fetch git://git.localhost/p/test2/code master' in merge_instructions
assert 'git merge {}'.format(c_id) in merge_instructions
+ def test_merge_request_with_deleted_repo(self):
+ self._request_merge()
+ h.set_context('test2', 'code', neighborhood='Projects')
+ c.app.repo.delete()
+ ThreadLocalORMSession.flush_all()
+
+ r = self.app.get('/p/test/src-git/merge-requests/')
+ assert '<i>(deleted)</i>' in r
+
+ r = self.app.get('/p/test/src-git/merge-requests/1/')
+ assert '''Original repository by
+ <a href="/u/test-admin/">Test Admin</a>
+ is deleted''' in r, r
+
def test_merge_request_list_view(self):
r, mr_num = self._request_merge()
r = self.app.get('/p/test/src-git/merge-requests/')
[4/4] git commit: [#7069] ticket:525 added empty check for
downstream_url
Posted by tv...@apache.org.
[#7069] ticket:525 added empty check for downstream_url
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/6e0435cb
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/6e0435cb
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/6e0435cb
Branch: refs/heads/master
Commit: 6e0435cbd928c14a21cad8cd9a6976511eca4939
Parents: 52ad1f4
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Thu Jan 30 20:28:07 2014 +0200
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Feb 11 05:13:08 2014 +0000
----------------------------------------------------------------------
Allura/allura/templates/repo/merge_requests.html | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/6e0435cb/Allura/allura/templates/repo/merge_requests.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/merge_requests.html b/Allura/allura/templates/repo/merge_requests.html
index 772957c..166be00 100644
--- a/Allura/allura/templates/repo/merge_requests.html
+++ b/Allura/allura/templates/repo/merge_requests.html
@@ -48,7 +48,11 @@
<td><a href="{{req.request_number}}/">{{req.request_number}}</a></td>
<td><a href="{{req.request_number}}/">{{req.status}}</a></td>
<td><a href="{{req.request_number}}/">{{req.summary}}</a></td>
- <td><a href="{{req.downstream_url}}">{{req.downstream_url}}</a></td>
+ <td>{% if req.downstream_url %}
+ <a href="{{req.downstream_url}}">{{req.downstream_url}}</a>
+ {% else %}
+ <i>(deleted)</i>
+ {% endif %}</td>
<td><a href="{{req.creator_url}}">{{req.creator_name}}</a></td>
</tr>
{% endfor %}
[2/4] git commit: [#7069] ticket:525 Properly handle deleted
repository on merge request page
Posted by tv...@apache.org.
[#7069] ticket:525 Properly handle deleted repository on merge request page
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/4e2ec156
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/4e2ec156
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/4e2ec156
Branch: refs/heads/master
Commit: 4e2ec15648333d2aa73b5ea7b93a399edc74a83a
Parents: 6e0435c
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Thu Jan 30 23:40:55 2014 +0200
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Feb 11 05:13:08 2014 +0000
----------------------------------------------------------------------
Allura/allura/model/repository.py | 5 ++
Allura/allura/templates/repo/merge_request.html | 51 +++++++++++++-------
2 files changed, 38 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4e2ec156/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index 03803cb..4a00f52 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -707,6 +707,11 @@ class MergeRequest(VersionedArtifact, ActivityObject):
return c.app.url
@LazyProperty
+ def downstream_repo(self):
+ with self.push_downstream_context():
+ return c.app.repo
+
+ @LazyProperty
def downstream_repo_url(self):
with self.push_downstream_context():
return c.app.repo.clone_url(
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/4e2ec156/Allura/allura/templates/repo/merge_request.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/merge_request.html b/Allura/allura/templates/repo/merge_request.html
index 820c4e9..9c1da9f 100644
--- a/Allura/allura/templates/repo/merge_request.html
+++ b/Allura/allura/templates/repo/merge_request.html
@@ -31,27 +31,42 @@ Merge Request #{{req.request_number}}: {{req.summary}} ({{req.status}})
{% endblock %}
{% block content %}
- <p>
- <a href="{{req.creator_url}}">{{req.creator_name}}</a>
- would like you to merge {{ req.commits | count }} commits
- from <a href="{{req.downstream_url}}">{{req.downstream_url}}</a>
- to {{ req.target_branch }}
- </p>
+ {% if req.downstream_repo %}
+ <p>
+ <a href="{{req.creator_url}}">{{req.creator_name}}</a>
+ would like you to merge {{ req.commits | count }} commits
+ from <a href="{{req.downstream_url}}">{{req.downstream_url}}</a>
+ to {{ req.target_branch }}
+ </p>
- <div>{{g.markdown.convert(req.description)}}</div>
+ <div>{{g.markdown.convert(req.description)}}</div>
- {{ c.log_widget.display(value=req.commits, app=downstream_app) }}
- <div class="grid-19"><a href="#discussion_holder">Discuss</a></div>
+ {{ c.log_widget.display(value=req.commits, app=downstream_app) }}
+ <div class="grid-19"><a href="#discussion_holder">Discuss</a></div>
- {% if h.has_access(c.app, 'write')() %}
- <div class="grid-19">To merge the commits, please execute the following commands in your working
- copy: </div>
- <div class="grid-19"><textarea
- style="width:80%; height:60px;"
- readonly
- >{{ c.app.repo.merge_command(req) | safe }}</textarea></div>
- {{ c.mr_dispose_form.display(action="save", value=dict(status=req.status)) }}
- <br style="clear:both">
+ {% if h.has_access(c.app, 'write')() %}
+ <div class="grid-19">To merge the commits, please execute the following commands in your working
+ copy: </div>
+ <div class="grid-19"><textarea
+ style="width:80%; height:60px;"
+ readonly
+ >{{ c.app.repo.merge_command(req) | safe }}</textarea></div>
+ {{ c.mr_dispose_form.display(action="save", value=dict(status=req.status)) }}
+ <br style="clear:both">
+ {% endif %}
+ {% else %}
+ <p>
+ Original repository by
+ <a href="{{req.creator_url}}">{{req.creator_name}}</a>
+ is deleted
+ </p>
+
+ <div>{{g.markdown.convert(req.description)}}</div>
+
+ {% if h.has_access(c.app, 'write')() %}
+ {{ c.mr_dispose_form.display(action="save", value=dict(status=req.status)) }}
+ <br style="clear:both">
+ {% endif %}
{% endif %}
{% endblock %}
[3/4] git commit: [#7069] ticket:525 Use downstream_repo for clarity
Posted by tv...@apache.org.
[#7069] ticket:525 Use downstream_repo for clarity
Project: http://git-wip-us.apache.org/repos/asf/incubator-allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-allura/commit/2b459735
Tree: http://git-wip-us.apache.org/repos/asf/incubator-allura/tree/2b459735
Diff: http://git-wip-us.apache.org/repos/asf/incubator-allura/diff/2b459735
Branch: refs/heads/master
Commit: 2b4597359bc6566a65df92a9e725c74d94e9c8ba
Parents: 4e2ec15
Author: Aleksey 'LXj' Alekseyev <go...@gmail.com>
Authored: Thu Jan 30 23:41:43 2014 +0200
Committer: Tim Van Steenburgh <tv...@gmail.com>
Committed: Tue Feb 11 05:13:08 2014 +0000
----------------------------------------------------------------------
Allura/allura/templates/repo/merge_requests.html | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/2b459735/Allura/allura/templates/repo/merge_requests.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/repo/merge_requests.html b/Allura/allura/templates/repo/merge_requests.html
index 166be00..1b70881 100644
--- a/Allura/allura/templates/repo/merge_requests.html
+++ b/Allura/allura/templates/repo/merge_requests.html
@@ -48,7 +48,7 @@
<td><a href="{{req.request_number}}/">{{req.request_number}}</a></td>
<td><a href="{{req.request_number}}/">{{req.status}}</a></td>
<td><a href="{{req.request_number}}/">{{req.summary}}</a></td>
- <td>{% if req.downstream_url %}
+ <td>{% if req.downstream_repo %}
<a href="{{req.downstream_url}}">{{req.downstream_url}}</a>
{% else %}
<i>(deleted)</i>