gitweb: Add history and blame to git_difftree_body()

Add blame and history to Deleted files.
Add blame and history to Modified or Type changed files.
Add blame and history to Renamed or Copied files.

This allows us to do
	blame->commit->blame->commit->blame->...
instead of
	blame->commit->file->blame->commit->file->blame->...
which is longer and easier to get wrong.

Signed-off-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Luben Tuikov 2006-09-27 17:24:49 -07:00 коммит произвёл Junio C Hamano
Родитель 499faeda1b
Коммит eb51ec9c05
1 изменённых файлов: 23 добавлений и 12 удалений

Просмотреть файл

@ -1761,6 +1761,9 @@ sub git_difftree_body {
print $cgi->a({-href => "#patch$patchno"}, "patch"); print $cgi->a({-href => "#patch$patchno"}, "patch");
print " | "; print " | ";
} }
print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
file_name=>$diff{'file'})},
"blame") . " | ";
print $cgi->a({-href => href(action=>"history", hash_base=>$parent, print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
file_name=>$diff{'file'})}, file_name=>$diff{'file'})},
"history"); "history");
@ -1803,8 +1806,11 @@ sub git_difftree_body {
} }
print " | "; print " | ";
} }
print $cgi->a({-href => href(action=>"history", print $cgi->a({-href => href(action=>"blame", hash_base=>$hash,
hash_base=>$hash, file_name=>$diff{'file'})}, file_name=>$diff{'file'})},
"blame") . " | ";
print $cgi->a({-href => href(action=>"history", hash_base=>$hash,
file_name=>$diff{'file'})},
"history"); "history");
print "</td>\n"; print "</td>\n";
@ -1830,17 +1836,22 @@ sub git_difftree_body {
if ($action eq 'commitdiff') { if ($action eq 'commitdiff') {
# link to patch # link to patch
$patchno++; $patchno++;
print " | " . print $cgi->a({-href => "#patch$patchno"}, "patch");
$cgi->a({-href => "#patch$patchno"}, "patch");
} else { } else {
print " | " . print $cgi->a({-href => href(action=>"blobdiff",
$cgi->a({-href => href(action=>"blobdiff",
hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'}, hash=>$diff{'to_id'}, hash_parent=>$diff{'from_id'},
hash_base=>$hash, hash_parent_base=>$parent, hash_base=>$hash, hash_parent_base=>$parent,
file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})}, file_name=>$diff{'to_file'}, file_parent=>$diff{'from_file'})},
"diff"); "diff");
} }
print " | ";
} }
print $cgi->a({-href => href(action=>"blame", hash_base=>$parent,
file_name=>$diff{'from_file'})},
"blame") . " | ";
print $cgi->a({-href => href(action=>"history", hash_base=>$parent,
file_name=>$diff{'from_file'})},
"history");
print "</td>\n"; print "</td>\n";
} # we should not encounter Unmerged (U) or Unknown (X) status } # we should not encounter Unmerged (U) or Unknown (X) status