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
9ee49c5c
Commit
9ee49c5c
authored
Oct 08, 2013
by
Andrew Kumanyaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update merge requests from fork project to origin project
Fix error described in
https://github.com/gitlabhq/gitlabhq/issues/5185
parent
c147b571
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
project.rb
app/models/project.rb
+5
-1
No files found.
app/models/project.rb
View file @
9ee49c5c
...
...
@@ -53,6 +53,7 @@ class Project < ActiveRecord::Base
has_many
:services
,
dependent: :destroy
has_many
:events
,
dependent: :destroy
has_many
:merge_requests
,
dependent: :destroy
,
foreign_key:
"target_project_id"
has_many
:fork_merge_requests
,
dependent: :destroy
,
foreign_key:
"source_project_id"
,
class_name:
MergeRequest
has_many
:issues
,
dependent: :destroy
,
order:
"state DESC, created_at DESC"
has_many
:milestones
,
dependent: :destroy
has_many
:notes
,
dependent: :destroy
...
...
@@ -312,8 +313,11 @@ class Project < ActiveRecord::Base
branch_name
=
ref
.
gsub
(
"refs/heads/"
,
""
)
c_ids
=
self
.
repository
.
commits_between
(
oldrev
,
newrev
).
map
(
&
:id
)
# Update code for merge requests
# Update code for merge requests
into project between project branches
mrs
=
self
.
merge_requests
.
opened
.
by_branch
(
branch_name
).
all
# Update code for merge requests between project and project fork
mrs
+=
self
.
fork_merge_requests
.
opened
.
by_branch
(
branch_name
).
all
mrs
.
each
{
|
merge_request
|
merge_request
.
reload_code
;
merge_request
.
mark_as_unchecked
}
# Close merge requests
...
...
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