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
13a2352c
Commit
13a2352c
authored
Oct 23, 2020
by
Kev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop offenses
parent
ea42b27c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
11 deletions
+13
-11
app/models/merge_request.rb
app/models/merge_request.rb
+11
-9
app/views/projects/merge_requests/_merge_request.html.haml
app/views/projects/merge_requests/_merge_request.html.haml
+1
-1
app/views/projects/merge_requests/_mr_title.html.haml
app/views/projects/merge_requests/_mr_title.html.haml
+1
-1
No files found.
app/models/merge_request.rb
View file @
13a2352c
...
...
@@ -1576,13 +1576,13 @@ class MergeRequest < ApplicationRecord
!
merge_commit
.
has_been_reverted?
(
current_user
,
notes_association
)
end
def
is_reverted
?
(
current_user
)
def
reverted_by_merge_request
?
(
current_user
)
!!
reverting_merge_request
(
current_user
)
end
def
reverting_merge_request
(
current_user
)
return
nil
unless
merge_commit
return
nil
unless
merged_at
return
unless
merge_commit
return
unless
merged_at
cutoff
=
merged_at
-
1
.
minute
...
...
@@ -1590,12 +1590,14 @@ class MergeRequest < ApplicationRecord
reverting_commit
=
merge_commit
.
reverting_commit
(
current_user
,
notes_association
)
MergeRequestsFinder
.
new
(
current_user
,
project_id:
project
.
id
,
commit_sha:
reverting_commit
.
sha
,
state:
'merged'
).
execute
.
first
if
reverting_commit
if
reverting_commit
MergeRequestsFinder
.
new
(
current_user
,
project_id:
project
.
id
,
commit_sha:
reverting_commit
.
sha
,
state:
'merged'
).
execute
.
first
end
end
def
merged_at
...
...
app/views/projects/merge_requests/_merge_request.html.haml
View file @
13a2352c
...
...
@@ -40,7 +40,7 @@
.issuable-meta
%ul
.controls.d-flex.align-items-end
-
if
merge_request
.
is_reverted
?
(
current_user
)
-
if
merge_request
.
reverted_by_merge_request
?
(
current_user
)
%li
.issuable-status.d-none.d-sm-inline-block
=
_
(
'MERGED (REVERTED)'
)
-
elsif
merge_request
.
merged?
...
...
app/views/projects/merge_requests/_mr_title.html.haml
View file @
13a2352c
...
...
@@ -14,7 +14,7 @@
.detail-page-header-body
.issuable-status-box.status-box
{
class:
status_box_class
(
@merge_request
)
}
=
sprite_icon
(
state_icon_name
,
css_class:
'd-block d-sm-none'
)
-
if
@merge_request
.
is_reverted
?
(
current_user
)
-
if
@merge_request
.
reverted_by_merge_request
?
(
current_user
)
%span
.d-none.d-sm-block
=
_
(
'Merged (%{reverted})'
).
html_safe
%
{
reverted:
link_to
(
'reverted'
,
merge_request_path
(
@merge_request
.
reverting_merge_request
(
current_user
)),
class:
'gl-text-white! gl-text-decoration-underline'
)
}
-
else
...
...
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