BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
1231a367
Unverified
Commit
1231a367
authored
Dec 20, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dont allow change of MR target or source projects after it was created
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
8bcb2ff2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+5
-0
_form.html.haml
app/views/projects/merge_requests/_form.html.haml
+2
-2
No files found.
app/controllers/projects/merge_requests_controller.rb
View file @
1231a367
...
...
@@ -94,6 +94,11 @@ class Projects::MergeRequestsController < Projects::ApplicationController
return
end
# We dont allow change of source/target projects
# after merge request was created
params
[
:merge_request
].
delete
(
:source_project_id
)
params
[
:merge_request
].
delete
(
:target_project_id
)
if
@merge_request
.
update_attributes
(
params
[
:merge_request
].
merge
(
author_id_of_changes:
current_user
.
id
))
@merge_request
.
reload_code
@merge_request
.
mark_as_unchecked
...
...
app/views/projects/merge_requests/_form.html.haml
View file @
1231a367
...
...
@@ -10,7 +10,7 @@
.span5
.clearfix
.pull-left
=
f
.
select
(
:source_project_id
,
[[
@merge_request
.
source_project_path
,
@merge_request
.
source_project
.
id
]]
,
{},
{
class:
'source_project chosen span3'
})
=
f
.
select
(
:source_project_id
,
[[
@merge_request
.
source_project_path
,
@merge_request
.
source_project
.
id
]]
,
{},
{
class:
'source_project chosen span3'
,
disabled:
@merge_request
.
persisted?
})
.pull-left
=
f
.
select
(
:source_branch
,
@merge_request
.
source_project
.
repository
.
branch_names
,
{
include_blank:
"Select branch"
},
{
class:
'source_branch chosen span2'
})
...
...
@@ -22,7 +22,7 @@
.clearfix
.pull-left
-
projects
=
@project
.
forked_from_project
.
nil?
?
[
@project
]
:
[
@project
,
@project
.
forked_from_project
]
=
f
.
select
(
:target_project_id
,
projects
.
map
{
|
proj
|
[
proj
.
path_with_namespace
,
proj
.
id
]
},
{
include_blank:
"Select Target Project"
},
{
class:
'target_project chosen span3'
})
=
f
.
select
(
:target_project_id
,
options_from_collection_for_select
(
projects
,
'id'
,
'path_with_namespace'
),
{},
{
class:
'target_project chosen span3'
,
disabled:
@merge_request
.
persisted?
})
.pull-left
=
f
.
select
(
:target_branch
,
@target_branches
,
{
include_blank:
"Select branch"
},
{
class:
'target_branch chosen span2'
})
...
...
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