Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a163135c
Commit
a163135c
authored
Mar 20, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Intead of showing 404 give users ability to close MR with missing branches
parent
a0cc3882
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
40 additions
and
16 deletions
+40
-16
app/assets/stylesheets/common.scss
app/assets/stylesheets/common.scss
+12
-0
app/assets/stylesheets/sections/merge_requests.scss
app/assets/stylesheets/sections/merge_requests.scss
+0
-10
app/controllers/merge_requests_controller.rb
app/controllers/merge_requests_controller.rb
+7
-2
app/views/compare/_form.html.haml
app/views/compare/_form.html.haml
+2
-2
app/views/merge_requests/invalid.html.haml
app/views/merge_requests/invalid.html.haml
+17
-0
app/views/merge_requests/show/_mr_title.html.haml
app/views/merge_requests/show/_mr_title.html.haml
+2
-2
No files found.
app/assets/stylesheets/common.scss
View file @
a163135c
...
...
@@ -543,3 +543,15 @@ img.emoji {
.appear-data
{
display
:
none
;
}
.label-branch
{
@include
border-radius
(
4px
);
padding
:
2px
4px
;
border
:
none
;
font-size
:
14px
;
background
:
#474D57
;
color
:
#fff
;
font-family
:
$monospace_font
;
text-shadow
:
0
1px
1px
#111
;
font-weight
:
normal
;
}
app/assets/stylesheets/sections/merge_requests.scss
View file @
a163135c
...
...
@@ -70,16 +70,6 @@ li.merge_request {
@extend
.append-bottom-10
;
}
.label_branch
{
@include
border-radius
(
4px
);
padding
:
2px
4px
;
border
:
none
;
font-size
:
14px
;
background
:
#474D57
;
color
:
#fff
;
font-family
:
$monospace_font
;
}
.mr_source_commit
,
.mr_target_commit
{
.commit
{
...
...
app/controllers/merge_requests_controller.rb
View file @
a163135c
...
...
@@ -129,11 +129,11 @@ class MergeRequestsController < ProjectResourceController
def
validates_merge_request
# Show git not found page if target branch doesn't exist
return
git_not_found!
unless
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
target_branch
)
return
invalid_mr
unless
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
target_branch
)
# Show git not found page if source branch doesn't exist
# and there is no saved commits between source & target branch
return
git_not_found!
if
!
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
source_branch
)
&&
@merge_request
.
commits
.
blank?
return
invalid_mr
if
!
@project
.
repo
.
heads
.
map
(
&
:name
).
include?
(
@merge_request
.
source_branch
)
&&
@merge_request
.
commits
.
blank?
end
def
define_show_vars
...
...
@@ -158,4 +158,9 @@ class MergeRequestsController < ProjectResourceController
can?
(
current_user
,
action
,
@project
)
end
def
invalid_mr
# Render special view for MR with removed source or target branch
render
'invalid'
end
end
app/views/compare/_form.html.haml
View file @
a163135c
...
...
@@ -2,9 +2,9 @@
-
unless
params
[
:to
]
%p
.slead
Fill input field with commit id like
%code
.label
_
branch
4eedf23
%code
.label
-
branch
4eedf23
or branch/tag name like
%code
.label
_
branch
master
%code
.label
-
branch
master
and press compare button for commits list, code diff.
%br
...
...
app/views/merge_requests/invalid.html.haml
0 → 100644
View file @
a163135c
.merge-request
=
render
"merge_requests/show/mr_title"
=
render
"merge_requests/show/mr_box"
.alert.alert-error
%h5
%i
.icon-exclamation-sign
We cannot find
%span
.label-branch
=
@merge_request
.
source_branch
or
%span
.label-branch
=
@merge_request
.
target_branch
branches in the repository.
%p
Maybe it was removed or never pushed.
%p
Please close Merge Request or change branches with existing one
app/views/merge_requests/show/_mr_title.html.haml
View file @
a163135c
%h3
.page_title
=
"Merge Request #
#{
@merge_request
.
id
}
:"
%span
.label
_
branch
=
@merge_request
.
source_branch
%span
.label
-
branch
=
@merge_request
.
source_branch
→
%span
.label
_
branch
=
@merge_request
.
target_branch
%span
.label
-
branch
=
@merge_request
.
target_branch
%span
.pull-right
-
if
can?
(
current_user
,
:modify_merge_request
,
@merge_request
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment