Commit c7299701 authored by Hiroyuki Sato's avatar Hiroyuki Sato

Add previous revision link

parent 12970a8a
......@@ -207,6 +207,14 @@
border-left-color: mix($blame-gray, $blame-cyan, $i / 4 * 100%);
}
}
.doc-versions {
color: $gray-600;
&:hover {
color: $gray-900;
}
}
}
&.logs {
......
......@@ -20,8 +20,14 @@
.commit-row-title
%span.item-title.str-truncated-100
= link_to commit.title, project_commit_path(@project, commit.id), class: "cdark", title: commit.title
.float-right
= link_to commit.short_id, project_commit_path(@project, commit), class: "commit-sha"
%span
- 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
= 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:
If you hover over a commit in the UI, you'll see a precise date and time
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
If you're running `git` from the command line, the equivalent command is
......
......@@ -19982,6 +19982,9 @@ msgstr ""
msgid "View app"
msgstr ""
msgid "View blame prior to this change"
msgstr ""
msgid "View dependency details for your project"
msgstr ""
......
......@@ -229,6 +229,16 @@ describe "User browses files" do
expect(page).to have_content("*.rb")
.and have_content("Dmitriy Zaporozhets")
.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
......
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