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
ebfc7d05
Commit
ebfc7d05
authored
Mar 18, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix condensed range in MR push comment.
parent
dbd347bf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
app/models/note.rb
app/models/note.rb
+6
-2
app/services/merge_requests/refresh_service.rb
app/services/merge_requests/refresh_service.rb
+1
-1
No files found.
app/models/note.rb
View file @
ebfc7d05
...
@@ -151,7 +151,7 @@ class Note < ActiveRecord::Base
...
@@ -151,7 +151,7 @@ class Note < ActiveRecord::Base
)
)
end
end
def
create_new_commits_note
(
merge_request
,
project
,
author
,
new_commits
,
existing_commits
=
[])
def
create_new_commits_note
(
merge_request
,
project
,
author
,
new_commits
,
existing_commits
=
[]
,
oldrev
=
nil
)
total_count
=
new_commits
.
length
+
existing_commits
.
length
total_count
=
new_commits
.
length
+
existing_commits
.
length
commits_text
=
ActionController
::
Base
.
helpers
.
pluralize
(
total_count
,
'commit'
)
commits_text
=
ActionController
::
Base
.
helpers
.
pluralize
(
total_count
,
'commit'
)
body
=
"Added
#{
commits_text
}
:
\n\n
"
body
=
"Added
#{
commits_text
}
:
\n\n
"
...
@@ -161,7 +161,11 @@ class Note < ActiveRecord::Base
...
@@ -161,7 +161,11 @@ class Note < ActiveRecord::Base
if
existing_commits
.
length
==
1
if
existing_commits
.
length
==
1
existing_commits
.
first
.
short_id
existing_commits
.
first
.
short_id
else
else
"
#{
existing_commits
.
first
.
short_id
}
..
#{
existing_commits
.
last
.
short_id
}
"
if
oldrev
"
#{
Commit
.
truncate_sha
(
oldrev
)
}
...
#{
existing_commits
.
last
.
short_id
}
"
else
"
#{
existing_commits
.
first
.
short_id
}
..
#{
existing_commits
.
last
.
short_id
}
"
end
end
end
commits_text
=
ActionController
::
Base
.
helpers
.
pluralize
(
existing_commits
.
length
,
'commit'
)
commits_text
=
ActionController
::
Base
.
helpers
.
pluralize
(
existing_commits
.
length
,
'commit'
)
...
...
app/services/merge_requests/refresh_service.rb
View file @
ebfc7d05
...
@@ -89,7 +89,7 @@ module MergeRequests
...
@@ -89,7 +89,7 @@ module MergeRequests
end
end
Note
.
create_new_commits_note
(
merge_request
,
merge_request
.
project
,
Note
.
create_new_commits_note
(
merge_request
,
merge_request
.
project
,
@current_user
,
new_commits
,
existing_commits
)
@current_user
,
new_commits
,
existing_commits
,
@oldrev
)
end
end
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