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
358426d6
Commit
358426d6
authored
Oct 08, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5290 from zzet/patch-3
Update merge requests from fork project to origin project
parents
c147b571
9ee49c5c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
app/models/project.rb
app/models/project.rb
+5
-1
No files found.
app/models/project.rb
View file @
358426d6
...
...
@@ -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