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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
e40f8f27
Commit
e40f8f27
authored
Oct 26, 2018
by
blackst0ne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update other links
parent
e211ef4e
Changes
14
Show whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
25 additions
and
23 deletions
+25
-23
app/controllers/concerns/creates_commit.rb
app/controllers/concerns/creates_commit.rb
+1
-1
app/helpers/compare_helper.rb
app/helpers/compare_helper.rb
+1
-1
app/helpers/merge_requests_helper.rb
app/helpers/merge_requests_helper.rb
+2
-2
app/views/projects/merge_requests/creations/_diffs.html.haml
app/views/projects/merge_requests/creations/_diffs.html.haml
+1
-0
config/routes/project.rb
config/routes/project.rb
+1
-1
spec/controllers/projects/blob_controller_spec.rb
spec/controllers/projects/blob_controller_spec.rb
+1
-1
spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb
...t/user_allows_commits_from_memebers_who_can_merge_spec.rb
+1
-1
spec/features/merge_request/user_sees_merge_widget_spec.rb
spec/features/merge_request/user_sees_merge_widget_spec.rb
+1
-1
spec/features/merge_request/user_sees_wip_help_message_spec.rb
...features/merge_request/user_sees_wip_help_message_spec.rb
+2
-2
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
...es/merge_request/user_selects_branches_for_new_mr_spec.rb
+6
-5
spec/features/merge_request/user_uses_quick_actions_spec.rb
spec/features/merge_request/user_uses_quick_actions_spec.rb
+1
-1
spec/features/merge_requests/user_squashes_merge_request_spec.rb
...atures/merge_requests/user_squashes_merge_request_spec.rb
+2
-2
spec/features/projects/merge_request_button_spec.rb
spec/features/projects/merge_request_button_spec.rb
+4
-4
spec/support/shared_examples/features/creatable_merge_request_shared_examples.rb
...mples/features/creatable_merge_request_shared_examples.rb
+1
-1
No files found.
app/controllers/concerns/creates_commit.rb
View file @
e40f8f27
...
@@ -86,10 +86,10 @@ module CreatesCommit
...
@@ -86,10 +86,10 @@ module CreatesCommit
def
new_merge_request_path
def
new_merge_request_path
project_new_merge_request_path
(
project_new_merge_request_path
(
@project_to_commit_into
,
@project_to_commit_into
,
merge_request_source_branch:
@branch_name
,
merge_request:
{
merge_request:
{
source_project_id:
@project_to_commit_into
.
id
,
source_project_id:
@project_to_commit_into
.
id
,
target_project_id:
@project
.
id
,
target_project_id:
@project
.
id
,
source_branch:
@branch_name
,
target_branch:
@start_branch
target_branch:
@start_branch
}
}
)
)
...
...
app/helpers/compare_helper.rb
View file @
e40f8f27
...
@@ -13,8 +13,8 @@ module CompareHelper
...
@@ -13,8 +13,8 @@ module CompareHelper
def
create_mr_path
(
from
=
params
[
:from
],
to
=
params
[
:to
],
project
=
@project
)
def
create_mr_path
(
from
=
params
[
:from
],
to
=
params
[
:to
],
project
=
@project
)
project_new_merge_request_path
(
project_new_merge_request_path
(
project
,
project
,
merge_request_source_branch:
to
,
merge_request:
{
merge_request:
{
source_branch:
to
,
target_branch:
from
target_branch:
from
}
}
)
)
...
...
app/helpers/merge_requests_helper.rb
View file @
e40f8f27
...
@@ -11,10 +11,10 @@ module MergeRequestsHelper
...
@@ -11,10 +11,10 @@ module MergeRequestsHelper
def
new_mr_from_push_event
(
event
,
target_project
)
def
new_mr_from_push_event
(
event
,
target_project
)
{
{
merge_request_source_branch:
event
.
branch_name
,
merge_request:
{
merge_request:
{
source_project_id:
event
.
project
.
id
,
source_project_id:
event
.
project
.
id
,
target_project_id:
target_project
.
id
,
target_project_id:
target_project
.
id
,
source_branch:
event
.
branch_name
,
target_branch:
target_project
.
repository
.
root_ref
target_branch:
target_project
.
repository
.
root_ref
}
}
}
}
...
@@ -51,10 +51,10 @@ module MergeRequestsHelper
...
@@ -51,10 +51,10 @@ module MergeRequestsHelper
def
mr_change_branches_path
(
merge_request
)
def
mr_change_branches_path
(
merge_request
)
project_new_merge_request_path
(
project_new_merge_request_path
(
@project
,
@project
,
merge_request_source_branch:
merge_request
.
source_branch
,
merge_request:
{
merge_request:
{
source_project_id:
merge_request
.
source_project_id
,
source_project_id:
merge_request
.
source_project_id
,
target_project_id:
merge_request
.
target_project_id
,
target_project_id:
merge_request
.
target_project_id
,
source_branch:
merge_request
.
source_branch
,
target_branch:
merge_request
.
target_branch
target_branch:
merge_request
.
target_branch
},
},
change_branches:
true
change_branches:
true
...
...
app/views/projects/merge_requests/creations/_diffs.html.haml
View file @
e40f8f27
=
@merge_request
.
inspect
-
if
@merge_request
.
can_be_created
-
if
@merge_request
.
can_be_created
=
render
"projects/diffs/diffs"
,
diffs:
@diffs
,
environment:
@environment
,
show_whitespace_toggle:
false
=
render
"projects/diffs/diffs"
,
diffs:
@diffs
,
environment:
@environment
,
show_whitespace_toggle:
false
-
else
-
else
...
...
config/routes/project.rb
View file @
e40f8f27
...
@@ -149,7 +149,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
...
@@ -149,7 +149,7 @@ constraints(::Constraints::ProjectUrlConstrainer.new) do
scope
path:
'merge_requests'
,
controller:
'merge_requests/creations'
do
scope
path:
'merge_requests'
,
controller:
'merge_requests/creations'
do
post
''
,
action: :create
,
as:
nil
post
''
,
action: :create
,
as:
nil
scope
path:
'new'
,
as: :new_merge_request
do
scope
path:
'new
/(:merge_request_source_branch)
'
,
as: :new_merge_request
do
scope
constraints:
{
format:
nil
},
action: :new
do
scope
constraints:
{
format:
nil
},
action: :new
do
get
:diffs
,
defaults:
{
tab:
'diffs'
}
get
:diffs
,
defaults:
{
tab:
'diffs'
}
get
:pipelines
,
defaults:
{
tab:
'pipelines'
}
get
:pipelines
,
defaults:
{
tab:
'pipelines'
}
...
...
spec/controllers/projects/blob_controller_spec.rb
View file @
e40f8f27
...
@@ -331,10 +331,10 @@ describe Projects::BlobController do
...
@@ -331,10 +331,10 @@ describe Projects::BlobController do
expect
(
response
).
to
redirect_to
(
expect
(
response
).
to
redirect_to
(
project_new_merge_request_path
(
project_new_merge_request_path
(
forked_project
,
forked_project
,
merge_request_source_branch:
"fork-test-1"
,
merge_request:
{
merge_request:
{
source_project_id:
forked_project
.
id
,
source_project_id:
forked_project
.
id
,
target_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
"fork-test-1"
,
target_branch:
"master"
target_branch:
"master"
}
}
)
)
...
...
spec/features/merge_request/user_allows_commits_from_memebers_who_can_merge_spec.rb
View file @
e40f8f27
...
@@ -9,10 +9,10 @@ describe 'create a merge request, allowing commits from members who can merge to
...
@@ -9,10 +9,10 @@ describe 'create a merge request, allowing commits from members who can merge to
def
visit_new_merge_request
def
visit_new_merge_request
visit
project_new_merge_request_path
(
visit
project_new_merge_request_path
(
source_project
,
source_project
,
merge_request_source_branch:
'fix'
,
merge_request:
{
merge_request:
{
source_project_id:
source_project
.
id
,
source_project_id:
source_project
.
id
,
target_project_id:
target_project
.
id
,
target_project_id:
target_project
.
id
,
source_branch:
'fix'
,
target_branch:
'master'
target_branch:
'master'
})
})
end
end
...
...
spec/features/merge_request/user_sees_merge_widget_spec.rb
View file @
e40f8f27
...
@@ -20,10 +20,10 @@ describe 'Merge request > User sees merge widget', :js do
...
@@ -20,10 +20,10 @@ describe 'Merge request > User sees merge widget', :js do
before
do
before
do
visit
project_new_merge_request_path
(
visit
project_new_merge_request_path
(
project
,
project
,
merge_request_source_branch:
'feature'
,
merge_request:
{
merge_request:
{
source_project_id:
project
.
id
,
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
'feature'
,
target_branch:
'master'
target_branch:
'master'
})
})
end
end
...
...
spec/features/merge_request/user_sees_wip_help_message_spec.rb
View file @
e40f8f27
...
@@ -13,10 +13,10 @@ describe 'Merge request > User sees WIP help message' do
...
@@ -13,10 +13,10 @@ describe 'Merge request > User sees WIP help message' do
it
'shows a specific WIP hint'
do
it
'shows a specific WIP hint'
do
visit
project_new_merge_request_path
(
visit
project_new_merge_request_path
(
project
,
project
,
merge_request_source_branch:
'wip'
,
merge_request:
{
merge_request:
{
source_project_id:
project
.
id
,
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
'wip'
,
target_branch:
'master'
target_branch:
'master'
})
})
...
@@ -32,10 +32,10 @@ describe 'Merge request > User sees WIP help message' do
...
@@ -32,10 +32,10 @@ describe 'Merge request > User sees WIP help message' do
it
'shows the regular WIP message'
do
it
'shows the regular WIP message'
do
visit
project_new_merge_request_path
(
visit
project_new_merge_request_path
(
project
,
project
,
merge_request_source_branch:
'fix'
,
merge_request:
{
merge_request:
{
source_project_id:
project
.
id
,
source_project_id:
project
.
id
,
target_project_id:
project
.
id
,
target_project_id:
project
.
id
,
source_branch:
'fix'
,
target_branch:
'master'
target_branch:
'master'
})
})
...
...
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
View file @
e40f8f27
...
@@ -109,13 +109,13 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -109,13 +109,13 @@ describe 'Merge request > User selects branches for new MR', :js do
end
end
it
'populates source branch button'
do
it
'populates source branch button'
do
visit
project_new_merge_request_path
(
project
,
change_branches:
true
,
merge_request
:
{
target_branch:
'master'
,
source_branch:
'fix
'
})
visit
project_new_merge_request_path
(
project
,
change_branches:
true
,
merge_request
_source_branch:
'fix'
,
merge_request:
{
target_branch:
'master
'
})
expect
(
find
(
'.js-source-branch'
)).
to
have_content
(
'fix'
)
expect
(
find
(
'.js-source-branch'
)).
to
have_content
(
'fix'
)
end
end
it
'allows to change the diff view'
do
it
'allows to change the diff view'
do
visit
project_new_merge_request_path
(
project
,
merge_request
:
{
target_branch:
'master'
,
source_branch:
'fix
'
})
visit
project_new_merge_request_path
(
project
,
merge_request
_source_branch:
'fix'
,
merge_request:
{
target_branch:
'master
'
})
click_link
'Changes'
click_link
'Changes'
...
@@ -131,7 +131,7 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -131,7 +131,7 @@ describe 'Merge request > User selects branches for new MR', :js do
end
end
it
'does not allow non-existing branches'
do
it
'does not allow non-existing branches'
do
visit
project_new_merge_request_path
(
project
,
merge_request
:
{
target_branch:
'non-exist-target'
,
source_branch:
'non-exist-source
'
})
visit
project_new_merge_request_path
(
project
,
merge_request
_source_branch:
'non-exist-source'
,
merge_request:
{
target_branch:
'non-exist-target
'
})
expect
(
page
).
to
have_content
(
'The form contains the following errors'
)
expect
(
page
).
to
have_content
(
'The form contains the following errors'
)
expect
(
page
).
to
have_content
(
'Source branch "non-exist-source" does not exist'
)
expect
(
page
).
to
have_content
(
'Source branch "non-exist-source" does not exist'
)
...
@@ -140,7 +140,7 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -140,7 +140,7 @@ describe 'Merge request > User selects branches for new MR', :js do
context
'when a branch contains commits that both delete and add the same image'
do
context
'when a branch contains commits that both delete and add the same image'
do
it
'renders the diff successfully'
do
it
'renders the diff successfully'
do
visit
project_new_merge_request_path
(
project
,
merge_request
:
{
target_branch:
'master'
,
source_branch:
'deleted-image-test
'
})
visit
project_new_merge_request_path
(
project
,
merge_request
_source_branch:
'deleted-image-test'
,
merge_request:
{
target_branch:
'master
'
})
click_link
"Changes"
click_link
"Changes"
...
@@ -165,7 +165,8 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -165,7 +165,8 @@ describe 'Merge request > User selects branches for new MR', :js do
it
'shows pipelines for a new merge request'
do
it
'shows pipelines for a new merge request'
do
visit
project_new_merge_request_path
(
visit
project_new_merge_request_path
(
project
,
project
,
merge_request:
{
target_branch:
'master'
,
source_branch:
'fix'
})
merge_request_source_branch:
'fix'
,
merge_request:
{
target_branch:
'master'
})
page
.
within
(
'.merge-request'
)
do
page
.
within
(
'.merge-request'
)
do
click_link
'Pipelines'
click_link
'Pipelines'
...
...
spec/features/merge_request/user_uses_quick_actions_spec.rb
View file @
e40f8f27
...
@@ -144,7 +144,7 @@ describe 'Merge request > User uses quick actions', :js do
...
@@ -144,7 +144,7 @@ describe 'Merge request > User uses quick actions', :js do
describe
'/target_branch command in merge request'
do
describe
'/target_branch command in merge request'
do
let
(
:another_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:another_project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:new_url_opts
)
{
{
merge_request
:
{
source_branch:
'feature'
}
}
}
let
(
:new_url_opts
)
{
{
merge_request
_source_branch:
'feature'
}
}
before
do
before
do
another_project
.
add_maintainer
(
user
)
another_project
.
add_maintainer
(
user
)
...
...
spec/features/merge_requests/user_squashes_merge_request_spec.rb
View file @
e40f8f27
...
@@ -65,7 +65,7 @@ describe 'User squashes a merge request', :js do
...
@@ -65,7 +65,7 @@ describe 'User squashes a merge request', :js do
context
'when squash is enabled on merge request creation'
do
context
'when squash is enabled on merge request creation'
do
before
do
before
do
visit
project_new_merge_request_path
(
project
,
merge_request
:
{
target_branch:
'master'
,
source_branch:
source_branch
})
visit
project_new_merge_request_path
(
project
,
merge_request
_source_branch:
source_branch
,
merge_request:
{
target_branch:
'master'
})
check
'merge_request[squash]'
check
'merge_request[squash]'
click_on
'Submit merge request'
click_on
'Submit merge request'
wait_for_requests
wait_for_requests
...
@@ -95,7 +95,7 @@ describe 'User squashes a merge request', :js do
...
@@ -95,7 +95,7 @@ describe 'User squashes a merge request', :js do
context
'when squash is not enabled on merge request creation'
do
context
'when squash is not enabled on merge request creation'
do
before
do
before
do
visit
project_new_merge_request_path
(
project
,
merge_request
:
{
target_branch:
'master'
,
source_branch:
source_branch
})
visit
project_new_merge_request_path
(
project
,
merge_request
_source_branch:
source_branch
,
merge_request:
{
target_branch:
'master'
})
click_on
'Submit merge request'
click_on
'Submit merge request'
wait_for_requests
wait_for_requests
end
end
...
...
spec/features/projects/merge_request_button_spec.rb
View file @
e40f8f27
...
@@ -22,8 +22,8 @@ describe 'Merge Request button' do
...
@@ -22,8 +22,8 @@ describe 'Merge Request button' do
it
'shows Create merge request button'
do
it
'shows Create merge request button'
do
href
=
project_new_merge_request_path
(
project
,
href
=
project_new_merge_request_path
(
project
,
merge_request
:
{
source_branch:
'feature'
,
merge_request
_
source_branch:
'feature'
,
target_branch:
'master'
})
merge_request:
{
target_branch:
'master'
})
visit
url
visit
url
...
@@ -77,8 +77,8 @@ describe 'Merge Request button' do
...
@@ -77,8 +77,8 @@ describe 'Merge Request button' do
it
'shows Create merge request button'
do
it
'shows Create merge request button'
do
href
=
project_new_merge_request_path
(
forked_project
,
href
=
project_new_merge_request_path
(
forked_project
,
merge_request
:
{
source_branch:
'feature'
,
merge_request
_
source_branch:
'feature'
,
target_branch:
'master'
})
merge_request:
{
target_branch:
'master'
})
visit
fork_url
visit
fork_url
...
...
spec/support/shared_examples/features/creatable_merge_request_shared_examples.rb
View file @
e40f8f27
...
@@ -17,10 +17,10 @@ RSpec.shared_examples 'a creatable merge request' do
...
@@ -17,10 +17,10 @@ RSpec.shared_examples 'a creatable merge request' do
sign_in
(
user
)
sign_in
(
user
)
visit
project_new_merge_request_path
(
visit
project_new_merge_request_path
(
target_project
,
target_project
,
merge_request_source_branch:
'fix'
,
merge_request:
{
merge_request:
{
source_project_id:
source_project
.
id
,
source_project_id:
source_project
.
id
,
target_project_id:
target_project
.
id
,
target_project_id:
target_project
.
id
,
source_branch:
'fix'
,
target_branch:
'master'
target_branch:
'master'
})
})
end
end
...
...
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