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
0
Merge Requests
0
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
iv
gitlab-ce
Commits
8fb4c506
Commit
8fb4c506
authored
Jun 16, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Display last commit of deleted branch in push events (!4699)
parent
4477dc24
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
9 deletions
+19
-9
CHANGELOG
CHANGELOG
+1
-0
app/models/event.rb
app/models/event.rb
+1
-1
app/views/events/event/_push.html.haml
app/views/events/event/_push.html.haml
+17
-8
No files found.
CHANGELOG
View file @
8fb4c506
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
...
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.10.0 (unreleased)
v 8.10.0 (unreleased)
- Replace Haml with Hamlit to make view rendering faster. !3666
- Replace Haml with Hamlit to make view rendering faster. !3666
- Wrap code blocks on Activies and Todos page. !4783 (winniehell)
- Wrap code blocks on Activies and Todos page. !4783 (winniehell)
- Display last commit of deleted branch in push events !4699 (winniehell)
- Add Sidekiq queue duration to transaction metrics.
- Add Sidekiq queue duration to transaction metrics.
- Fix MR-auto-close text added to description. !4836
- Fix MR-auto-close text added to description. !4836
- Eager load award emoji on notes
- Eager load award emoji on notes
...
...
app/models/event.rb
View file @
8fb4c506
...
@@ -315,7 +315,7 @@ class Event < ActiveRecord::Base
...
@@ -315,7 +315,7 @@ class Event < ActiveRecord::Base
def
body?
def
body?
if
push?
if
push?
push_with_commits?
push_with_commits?
||
rm_ref?
elsif
note?
elsif
note?
true
true
else
else
...
...
app/views/events/event/_push.html.haml
View file @
8fb4c506
-
project
=
event
.
project
.event-title
.event-title
%span
.author_name
=
link_to_author
event
%span
.author_name
=
link_to_author
event
%span
.event_label.pushed
#{
event
.
action_name
}
#{
event
.
ref_type
}
%span
.event_label.pushed
#{
event
.
action_name
}
#{
event
.
ref_type
}
...
@@ -5,19 +7,18 @@
...
@@ -5,19 +7,18 @@
%strong
=
event
.
ref_name
%strong
=
event
.
ref_name
-
else
-
else
%strong
%strong
=
link_to
event
.
ref_name
,
namespace_project_commits_path
(
event
.
project
.
namespace
,
event
.
project
,
event
.
ref_name
),
title:
h
(
event
.
target_title
)
=
link_to
event
.
ref_name
,
namespace_project_commits_path
(
project
.
namespace
,
project
,
event
.
ref_name
),
title:
h
(
event
.
target_title
)
at
at
=
link_to_project
event
.
project
=
link_to_project
project
-
if
event
.
push_with_commits?
-
if
event
.
push_with_commits?
-
project
=
event
.
project
.event-body
.event-body
%ul
.well-list.event_commits
%ul
.well-list.event_commits
-
few_commits
=
event
.
commits
[
0
...
2
]
-
few_commits
=
event
.
commits
[
0
...
2
]
-
few_commits
.
each
do
|
commit
|
-
few_commits
.
each
do
|
commit
|
=
render
"events/commit"
,
commit:
commit
,
project:
project
,
event:
event
=
render
"events/commit"
,
commit:
commit
,
project:
project
,
event:
event
-
create_mr
=
event
.
new_ref?
&&
create_mr_button?
(
event
.
project
.
default_branch
,
event
.
ref_name
,
event
.
project
)
-
create_mr
=
event
.
new_ref?
&&
create_mr_button?
(
project
.
default_branch
,
event
.
ref_name
,
project
)
-
if
event
.
commits_count
>
1
-
if
event
.
commits_count
>
1
%li
.commits-stat
%li
.commits-stat
-
if
event
.
commits_count
>
2
-
if
event
.
commits_count
>
2
...
@@ -27,18 +28,26 @@
...
@@ -27,18 +28,26 @@
-
from
=
event
.
commit_from
-
from
=
event
.
commit_from
-
from_label
=
truncate_sha
(
from
)
-
from_label
=
truncate_sha
(
from
)
-
else
-
else
-
from
=
event
.
project
.
default_branch
-
from
=
project
.
default_branch
-
from_label
=
from
-
from_label
=
from
=
link_to
namespace_project_compare_path
(
event
.
project
.
namespace
,
event
.
project
,
from:
from
,
to:
event
.
commit_to
)
do
=
link_to
namespace_project_compare_path
(
project
.
namespace
,
project
,
from:
from
,
to:
event
.
commit_to
)
do
Compare
#{
from_label
}
...
#{
truncate_sha
(
event
.
commit_to
)
}
Compare
#{
from_label
}
...
#{
truncate_sha
(
event
.
commit_to
)
}
-
if
create_mr
-
if
create_mr
%span
{
"data-user-is"
=>
event
.
author_id
,
"data-display"
=>
"inline"
}
%span
{
"data-user-is"
=>
event
.
author_id
,
"data-display"
=>
"inline"
}
or
or
=
link_to
create_mr_path
(
event
.
project
.
default_branch
,
event
.
ref_name
,
event
.
project
)
do
=
link_to
create_mr_path
(
project
.
default_branch
,
event
.
ref_name
,
project
)
do
create a merge request
create a merge request
-
elsif
create_mr
-
elsif
create_mr
%li
.commits-stat
{
"data-user-is"
=>
event
.
author_id
}
%li
.commits-stat
{
"data-user-is"
=>
event
.
author_id
}
=
link_to
create_mr_path
(
event
.
project
.
default_branch
,
event
.
ref_name
,
event
.
project
)
do
=
link_to
create_mr_path
(
project
.
default_branch
,
event
.
ref_name
,
project
)
do
Create Merge Request
Create Merge Request
-
elsif
event
.
rm_ref?
-
repository
=
project
.
repository
-
last_commit
=
repository
.
commit
(
event
.
commit_from
)
-
if
last_commit
.event-body
%ul
.well-list.event_commits
=
render
"events/commit"
,
commit:
last_commit
,
project:
project
,
event:
event
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