You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by je...@apache.org on 2015/05/25 17:49:33 UTC
[03/16] allura git commit: [#7836] ticket:739 Show error to a user if
can't find merge base
[#7836] ticket:739 Show error to a user if can't find merge base
Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/1fda8a76
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/1fda8a76
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/1fda8a76
Branch: refs/heads/ib/1731
Commit: 1fda8a764cbb22872a750ec02bba6fe9be2e0fd2
Parents: e48f236
Author: Igor Bondarenko <je...@gmail.com>
Authored: Thu Mar 5 14:11:05 2015 +0000
Committer: Dave Brondsema <db...@slashdotmedia.com>
Committed: Wed May 20 19:43:16 2015 +0000
----------------------------------------------------------------------
Allura/allura/controllers/repository.py | 8 +++++++-
Allura/allura/templates/repo/merge_request.html | 12 ++++++++++--
2 files changed, 17 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/allura/blob/1fda8a76/Allura/allura/controllers/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/repository.py b/Allura/allura/controllers/repository.py
index b630e77..d94b253 100644
--- a/Allura/allura/controllers/repository.py
+++ b/Allura/allura/controllers/repository.py
@@ -368,7 +368,7 @@ class MergeRequestController(object):
c.mr_dispose_form = self.mr_dispose_form
with self.req.push_downstream_context():
downstream_app = c.app
- return dict(
+ result = dict(
downstream_app=downstream_app,
req=self.req,
can_merge=self.req.can_merge(),
@@ -377,6 +377,12 @@ class MergeRequestController(object):
page=page,
limit=limit,
count=self.req.discussion_thread.post_count)
+ try:
+ result['commits'] = self.req.commits
+ except:
+ result['commits'] = []
+ result['error'] = True
+ return result
@property
def mr_widget_edit(self):
http://git-wip-us.apache.org/repos/asf/allura/blob/1fda8a76/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 f87a894..3f5e894 100644
--- a/Allura/allura/templates/repo/merge_request.html
+++ b/Allura/allura/templates/repo/merge_request.html
@@ -56,7 +56,7 @@ Merge Request #{{req.request_number}}: {{req.summary}} ({{req.status}})
{% if req.downstream_repo %}
<p>
<a href="{{req.creator_url}}">{{req.creator_name}}</a>
- asked you to merge {{h.text.plural(req.commits|count, 'commit', 'commits')}}
+ asked you to merge {{h.text.plural(commits|count, 'commit', 'commits')}}
from <a href="{{req.downstream_url}}">{{req.downstream_url}}</a>
to {{ req.target_branch }},
{{lib.abbr_date(req.mod_date)}}
@@ -64,6 +64,14 @@ Merge Request #{{req.request_number}}: {{req.summary}} ({{req.status}})
<div>{{g.markdown.convert(req.description)}}</div>
+ {% if error %}
+ <div class='grid-19 error'>
+ Can't find commits to merge. Please checkout
+ <a href="{{req.downstream_url}}">{{req.downstream_url}}</a>
+ and follow the instructions to merge manually.
+ </div>
+ {% endif %}
+
{% if req.merge_allowed(c.user) %}
<div class="grid-19">
<form action="merge" method="POST">
@@ -82,7 +90,7 @@ Merge Request #{{req.request_number}}: {{req.summary}} ({{req.status}})
</div>
{% endif %}
- {{ c.log_widget.display(value=req.commits, app=downstream_app) }}
+ {{ c.log_widget.display(value=commits, app=downstream_app) }}
<div class="grid-19"><a href="#discussion_holder">Discuss</a></div>