Add "View annotation prior to this change" button in the annotate view of Git (#35432).

Patch by Takenori TAKAKI.


git-svn-id: https://svn.redmine.org/redmine/trunk@22217 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2023-04-30 04:00:57 +00:00
parent 24fc9a2a8e
commit d97beec1d4
8 changed files with 38 additions and 3 deletions

View File

@@ -376,11 +376,14 @@ module Redmine
identifier = ''
# git shows commit author on the first occurrence only
authors_by_commit = {}
prev_blames_by_commit = {}
content.split("\n").each do |line|
if line =~ /^([0-9a-f]{39,40})\s.*/
identifier = $1
elsif line =~ /^author (.+)/
authors_by_commit[identifier] = $1.strip
elsif line =~ /^previous (.+)/
prev_blames_by_commit[identifier] = $1.strip
elsif line =~ /^\t(.*)/
blame.add_line(
$1,
@@ -389,7 +392,8 @@ module Redmine
:revision => identifier,
:scmid => identifier,
:author => authors_by_commit[identifier]
)
),
prev_blames_by_commit[identifier]
)
identifier = ''
author = ''