Commit 7e17f764 authored by Michael Kozono's avatar Michael Kozono

Merge branch '19299-blame-previous-revision' into 'master'

Add previous revision link to blame

Closes #19299

See merge request gitlab-org/gitlab!17088
parents 2fb48c50 c7299701
...@@ -207,6 +207,14 @@ ...@@ -207,6 +207,14 @@
border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%); border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
} }
} }
.doc-versions {
color: $gray-600;
&:hover {
color: $gray-900;
}
}
} }
&.logs { &.logs {
......
...@@ -20,8 +20,14 @@ ...@@ -20,8 +20,14 @@
.commit-row-title .commit-row-title
%span.item-title.str-truncated-100 %span.item-title.str-truncated-100
= link_to commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title = link_to commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title
.float-right %span
= link_to commit.short_id, project_commit_path(@project, commit), class: "commit-sha" - previous_commit_id = commit.parent_id
- if previous_commit_id
= link_to project_blame_path(@project, tree_join(previous_commit_id, @path)),
title: _('View blame prior to this change'),
aria: { label: _('View blame prior to this change') },
data: { toggle: 'tooltip', placement: 'right', container: 'body' } do
= sprite_icon('doc-versions', size: 16, css_class: 'doc-versions align-text-bottom')
   
.light .light
= commit_author_link(commit, avatar: false) = commit_author_link(commit, avatar: false)
......
---
title: Add previous revision link to blame
merge_request: 17088
author: Hiroyuki Sato
type: added
...@@ -23,6 +23,11 @@ noted information: ...@@ -23,6 +23,11 @@ noted information:
If you hover over a commit in the UI, you'll see a precise date and time If you hover over a commit in the UI, you'll see a precise date and time
for that commit. for that commit.
![Blame previous commit](img/file_blame_previous_commit_v12_7.png "Blame previous commit")
To see earlier revisions of a specific line, click **View blame prior to this change**
until you've found the changes you're interested in viewing.
## Associated `git` command ## Associated `git` command
If you're running `git` from the command line, the equivalent command is If you're running `git` from the command line, the equivalent command is
......
...@@ -20048,6 +20048,9 @@ msgstr "" ...@@ -20048,6 +20048,9 @@ msgstr ""
msgid "View app" msgid "View app"
msgstr "" msgstr ""
msgid "View blame prior to this change"
msgstr ""
msgid "View dependency details for your project" msgid "View dependency details for your project"
msgstr "" msgstr ""
......
...@@ -229,6 +229,16 @@ describe "User browses files" do ...@@ -229,6 +229,16 @@ describe "User browses files" do
expect(page).to have_content("*.rb") expect(page).to have_content("*.rb")
.and have_content("Dmitriy Zaporozhets") .and have_content("Dmitriy Zaporozhets")
.and have_content("Initial commit") .and have_content("Initial commit")
.and have_content("Ignore DS files")
previous_commit_anchor = "//a[@title='Ignore DS files']/parent::span/following-sibling::span/a"
find(:xpath, previous_commit_anchor).click
expect(page).to have_content("*.rb")
.and have_content("Dmitriy Zaporozhets")
.and have_content("Initial commit")
expect(page).not_to have_content("Ignore DS files")
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment