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
70abcd5e
Commit
70abcd5e
authored
Oct 03, 2016
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix conflicts
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
bccf08ab
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
55 additions
and
126 deletions
+55
-126
app/models/group.rb
app/models/group.rb
+3
-28
app/models/member.rb
app/models/member.rb
+10
-28
app/models/project_team.rb
app/models/project_team.rb
+1
-5
app/services/merge_requests/update_service.rb
app/services/merge_requests/update_service.rb
+0
-3
app/services/notification_service.rb
app/services/notification_service.rb
+0
-4
app/views/shared/_sort_dropdown.html.haml
app/views/shared/_sort_dropdown.html.haml
+0
-4
doc/api/oauth2.md
doc/api/oauth2.md
+1
-5
lib/api/members.rb
lib/api/members.rb
+0
-10
spec/models/merge_request_spec.rb
spec/models/merge_request_spec.rb
+40
-39
No files found.
app/models/group.rb
View file @
70abcd5e
...
...
@@ -117,28 +117,6 @@ class Group < Namespace
self
[
:lfs_enabled
]
end
<<<<<<<
HEAD
def
add_users
(
user_ids
,
access_level
,
current_user:
nil
,
skip_notification:
false
,
expires_at:
nil
,
ldap:
false
)
user_ids
.
each
do
|
user_id
|
Member
.
add_user
(
self
.
group_members
,
user_id
,
access_level
,
current_user:
current_user
,
skip_notification:
skip_notification
,
expires_at:
expires_at
,
ldap:
ldap
)
end
end
def
add_user
(
user
,
access_level
,
current_user:
nil
,
skip_notification:
false
,
expires_at:
nil
)
add_users
([
user
],
access_level
,
current_user:
current_user
,
skip_notification:
skip_notification
,
expires_at:
expires_at
)
end
def
add_owner
(
user
,
current_user
=
nil
,
skip_notification:
false
)
add_user
(
user
,
Gitlab
::
Access
::
OWNER
,
current_user:
current_user
,
skip_notification:
skip_notification
)
=======
def
add_users
(
users
,
access_level
,
current_user:
nil
,
expires_at:
nil
)
GroupMember
.
add_users_to_group
(
self
,
...
...
@@ -149,15 +127,15 @@ class Group < Namespace
)
end
def
add_user
(
user
,
access_level
,
current_user:
nil
,
expires_at:
nil
)
def
add_user
(
user
,
access_level
,
current_user:
nil
,
expires_at:
nil
,
ldap:
false
)
GroupMember
.
add_user
(
self
,
user
,
access_level
,
current_user:
current_user
,
expires_at:
expires_at
expires_at:
expires_at
,
ldap:
ldap
)
>>>>>>>
ce
/
master
end
def
add_guest
(
user
,
current_user
=
nil
)
...
...
@@ -176,13 +154,10 @@ class Group < Namespace
add_user
(
user
,
:master
,
current_user:
current_user
)
end
<<<<<<<
HEAD
=======
def
add_owner
(
user
,
current_user
=
nil
)
add_user
(
user
,
:owner
,
current_user:
current_user
)
end
>>>>>>>
ce
/
master
def
has_owner?
(
user
)
owners
.
include?
(
user
)
end
...
...
app/models/member.rb
View file @
70abcd5e
...
...
@@ -81,25 +81,9 @@ class Member < ActiveRecord::Base
find_by
(
invite_token:
invite_token
)
end
<<<<<<<
HEAD
# This method is used to find users that have been entered into the "Add members" field.
# These can be the User objects directly, their IDs, their emails, or new emails to be invited.
def
user_for_id
(
user_id
)
return
user_id
if
user_id
.
is_a?
(
User
)
user
=
User
.
find_by
(
id:
user_id
)
user
||=
User
.
find_by
(
email:
user_id
)
user
||=
user_id
user
end
def
add_user
(
members
,
user_id
,
access_level
,
current_user:
nil
,
skip_notification:
false
,
expires_at:
nil
,
ldap:
false
)
user
=
user_for_id
(
user_id
)
=======
def
add_user
(
source
,
user
,
access_level
,
current_user:
nil
,
expires_at:
nil
)
def
add_user
(
source
,
user
,
access_level
,
current_user:
nil
,
expires_at:
nil
,
ldap:
false
)
user
=
retrieve_user
(
user
)
access_level
=
retrieve_access_level
(
access_level
)
>>>>>>>
ce
/
master
# `user` can be either a User object or an email to be invited
member
=
...
...
@@ -116,26 +100,24 @@ class Member < ActiveRecord::Base
member
.
attributes
=
{
created_by:
member
.
created_by
||
current_user
,
access_level:
access_level
,
expires_at:
expires_at
expires_at:
expires_at
,
skip_notification:
ldap
,
ldap:
ldap
}
if
member
.
request?
::
Members
::
ApproveAccessRequestService
.
new
(
source
,
current_user
,
id:
member
.
id
).
execute
::
Members
::
ApproveAccessRequestService
.
new
(
source
,
current_user
,
id:
member
.
id
,
access_level:
access_level
).
execute
else
member
.
save
end
<<<<<<<
HEAD
if
can_update_member?
(
current_user
,
member
)
||
project_creator?
(
member
,
access_level
)
member
.
created_by
||=
current_user
member
.
access_level
=
access_level
member
.
expires_at
=
expires_at
member
.
skip_notification
=
skip_notification
member
.
ldap
=
ldap
=======
member
end
>>>>>>>
ce
/
master
def
access_levels
Gitlab
::
Access
.
sym_options
...
...
app/models/project_team.rb
View file @
70abcd5e
...
...
@@ -33,13 +33,9 @@ class ProjectTeam
member
end
<<<<<<<
HEAD
def
add_users
(
users
,
access
,
current_user:
nil
,
expires_at:
nil
)
def
add_users
(
users
,
access_level
,
current_user:
nil
,
expires_at:
nil
)
return
false
if
group_member_lock
=======
def
add_users
(
users
,
access_level
,
current_user:
nil
,
expires_at:
nil
)
>>>>>>>
ce
/
master
ProjectMember
.
add_users_to_projects
(
[
project
.
id
],
users
,
...
...
app/services/merge_requests/update_service.rb
View file @
70abcd5e
...
...
@@ -16,12 +16,9 @@ module MergeRequests
end
merge_request
.
merge_params
[
'force_remove_source_branch'
]
=
params
.
delete
(
:force_remove_source_branch
)
<<<<<<<
HEAD
old_approvers
=
merge_request
.
overall_approvers
.
to_a
=======
handle_wip_event
(
merge_request
)
>>>>>>>
ce
/
master
update
(
merge_request
)
new_approvers
=
merge_request
.
overall_approvers
.
to_a
-
old_approvers
...
...
app/services/notification_service.rb
View file @
70abcd5e
...
...
@@ -578,7 +578,6 @@ class NotificationService
end
end
<<<<<<<
HEAD
def
approve_mr_email
(
merge_request
,
project
,
current_user
)
recipients
=
build_recipients
(
merge_request
,
project
,
current_user
)
...
...
@@ -595,10 +594,7 @@ class NotificationService
end
end
def
build_recipients
(
target
,
project
,
current_user
,
action:
nil
,
previous_assignee:
nil
)
=======
def
build_recipients
(
target
,
project
,
current_user
,
action:
nil
,
previous_assignee:
nil
,
skip_current_user:
true
)
>>>>>>>
ce
/
master
custom_action
=
build_custom_key
(
action
,
target
)
recipients
=
target
.
participants
(
current_user
)
...
...
app/views/shared/_sort_dropdown.html.haml
View file @
70abcd5e
...
...
@@ -18,16 +18,12 @@
=
sort_title_recently_updated
=
link_to
page_filter_path
(
sort:
sort_value_oldest_updated
,
label:
true
)
do
=
sort_title_oldest_updated
<
<<<<<<
HEAD
-
if
local_assigns
[
:type
]
==
:issues
=
link_to
page_filter_path
(
sort:
sort_value_more_weight
)
do
=
sort_title_more_weight
=
link_to
page_filter_path
(
sort:
sort_value_less_weight
)
do
=
sort_title_less_weight
=
link_to
page_filter_path
(
sort:
sort_value_milestone_soon
)
do
==
=====
=
link_to
page_filter_path
(
sort:
sort_value_milestone_soon
,
label:
true
)
do
>
>>>>>> ce/master
=
sort_title_milestone_soon
=
link_to
page_filter_path
(
sort:
sort_value_milestone_later
,
label:
true
)
do
=
sort_title_milestone_later
...
...
doc/api/oauth2.md
View file @
70abcd5e
...
...
@@ -130,12 +130,8 @@ For testing you can use the oauth2 ruby gem:
```
client = OAuth2::Client.new('the_client_id', 'the_client_secret', :site => "http://example.com")
<<<<<<< HEAD
access_token = client.password.get_token('user@example.com', 'sekret')
=======
access_token = client.password.get_token('user@example.com', 'secret')
puts access_token.token
>>>>>>> ce/master
```
[
personal access tokens
]:
./README.md#personal-access-tokens
lib/api/members.rb
View file @
70abcd5e
...
...
@@ -59,22 +59,12 @@ module API
authorize_admin_source!
(
source_type
,
source
)
required_attributes!
[
:user_id
,
:access_level
]
<<<<<<<
HEAD
## EE specific
if
source_type
==
'project'
&&
source
.
group
&&
source
.
group
.
membership_lock
not_allowed!
end
## EE specific
access_requester
=
source
.
requesters
.
find_by
(
user_id:
params
[
:user_id
])
if
access_requester
# We pass current_user = access_requester so that the requester doesn't
# receive a "access denied" email
::
Members
::
DestroyService
.
new
(
access_requester
,
access_requester
.
user
).
execute
end
=======
>>>>>>>
ce
/
master
member
=
source
.
members
.
find_by
(
user_id:
params
[
:user_id
])
# This is to ensure back-compatibility but 409 behavior should be used
...
...
spec/models/merge_request_spec.rb
View file @
70abcd5e
...
...
@@ -287,7 +287,46 @@ describe MergeRequest, models: true do
end
end
<<<<<<<
HEAD
describe
"#wipless_title"
do
[
'WIP '
,
'WIP:'
,
'WIP: '
,
'[WIP]'
,
'[WIP] '
,
' [WIP] WIP [WIP] WIP: WIP '
].
each
do
|
wip_prefix
|
it
"removes the '
#{
wip_prefix
}
' prefix"
do
wipless_title
=
subject
.
title
subject
.
title
=
"
#{
wip_prefix
}#{
subject
.
title
}
"
expect
(
subject
.
wipless_title
).
to
eq
wipless_title
end
it
"is satisfies the #work_in_progress? method"
do
subject
.
title
=
"
#{
wip_prefix
}#{
subject
.
title
}
"
subject
.
title
=
subject
.
wipless_title
expect
(
subject
.
work_in_progress?
).
to
eq
false
end
end
end
describe
"#wip_title"
do
it
"adds the WIP: prefix to the title"
do
wip_title
=
"WIP:
#{
subject
.
title
}
"
expect
(
subject
.
wip_title
).
to
eq
wip_title
end
it
"does not add the WIP: prefix multiple times"
do
wip_title
=
"WIP:
#{
subject
.
title
}
"
subject
.
title
=
subject
.
wip_title
subject
.
title
=
subject
.
wip_title
expect
(
subject
.
wip_title
).
to
eq
wip_title
end
it
"is satisfies the #work_in_progress? method"
do
subject
.
title
=
subject
.
wip_title
expect
(
subject
.
work_in_progress?
).
to
eq
true
end
end
describe
"#approvers_left"
do
let
(
:merge_request
)
{
create
:merge_request
}
...
...
@@ -359,27 +398,10 @@ describe MergeRequest, models: true do
blocked_developer
=
create
(
:user
).
tap
{
|
u
|
u
.
block!
}
group
.
add_developer
(
blocked_developer
)
end
.
to
change
{
merge_request
.
number_of_potential_approvers
}.
by
(
2
)
=======
describe
"#wipless_title"
do
[
'WIP '
,
'WIP:'
,
'WIP: '
,
'[WIP]'
,
'[WIP] '
,
' [WIP] WIP [WIP] WIP: WIP '
].
each
do
|
wip_prefix
|
it
"removes the '
#{
wip_prefix
}
' prefix"
do
wipless_title
=
subject
.
title
subject
.
title
=
"
#{
wip_prefix
}#{
subject
.
title
}
"
expect
(
subject
.
wipless_title
).
to
eq
wipless_title
end
it
"is satisfies the #work_in_progress? method"
do
subject
.
title
=
"
#{
wip_prefix
}#{
subject
.
title
}
"
subject
.
title
=
subject
.
wipless_title
expect
(
subject
.
work_in_progress?
).
to
eq
false
>>>>>>>
ce
/
master
end
end
end
<<<<<<<
HEAD
describe
"#approvals_required"
do
let
(
:merge_request
)
{
build
(
:merge_request
)
}
before
{
merge_request
.
target_project
.
update_attributes
(
approvals_before_merge:
3
)
}
...
...
@@ -396,27 +418,6 @@ describe MergeRequest, models: true do
it
"takes approvals_before_merge from the target project"
do
expect
(
merge_request
.
approvals_required
).
to
eq
(
3
)
end
=======
describe
"#wip_title"
do
it
"adds the WIP: prefix to the title"
do
wip_title
=
"WIP:
#{
subject
.
title
}
"
expect
(
subject
.
wip_title
).
to
eq
wip_title
end
it
"does not add the WIP: prefix multiple times"
do
wip_title
=
"WIP:
#{
subject
.
title
}
"
subject
.
title
=
subject
.
wip_title
subject
.
title
=
subject
.
wip_title
expect
(
subject
.
wip_title
).
to
eq
wip_title
end
it
"is satisfies the #work_in_progress? method"
do
subject
.
title
=
subject
.
wip_title
expect
(
subject
.
work_in_progress?
).
to
eq
true
>>>>>>>
ce
/
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