summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-06-02 01:54:06 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-06-06 05:26:47 (GMT)
commit669fbc3d09b259bb3bc3bd2ab126ceb28db61b16 (patch)
treec851b7defe9b34e55054598bfc3e2eb174afe7e6
parent22c6769d917635732fe9e6824aa30536155266b3 (diff)
downloadgit-669fbc3d09b259bb3bc3bd2ab126ceb28db61b16.zip
git-669fbc3d09b259bb3bc3bd2ab126ceb28db61b16.tar.gz
git-669fbc3d09b259bb3bc3bd2ab126ceb28db61b16.tar.bz2
git-gui: Combine blame groups only if commit and filename match
Consecutive chunks of a file could come from the same commit, but have different original file names. Previously we would have put them into a single group, but then the hyperlink would jump to only one of the files, and the other would not be accessible. Now we can get to the other file too. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--lib/blame.tcl12
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/blame.tcl b/lib/blame.tcl
index 33e8489..33d5204 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -518,8 +518,10 @@ method _read_blame {fd} {
set first_lno $lno
while {
- ![catch {set ncmit $line_commit([expr {$first_lno - 1}])}]
+ ![catch {set ncmit $line_commit([expr {$first_lno - 1}])}]
+ && ![catch {set nfile $line_file([expr {$first_lno - 1}])}]
&& $ncmit eq $cmit
+ && $nfile eq $file
} {
incr first_lno -1
}
@@ -572,8 +574,12 @@ method _read_blame {fd} {
incr blame_lines
}
- while {![catch {set ncmit $line_commit($lno)}]
- && $ncmit eq $cmit} {
+ while {
+ ![catch {set ncmit $line_commit($lno)}]
+ && ![catch {set nfile $line_file($lno)}]
+ && $ncmit eq $cmit
+ && $nfile eq $file
+ } {
$w_cgrp delete $lno.0 "$lno.0 lineend"
if {$lno == $first_lno} {