@ -5023,28 +5023,25 @@ proc startdiff {ids} {
proc path_filter {filter name} {
proc path_filter {filter name} {
foreach p $filter {
foreach p $filter {
set l [string length $p]
set l [string length $p]
if {[string index $p end] eq "/"} {
if {[string compare -length $l $p $name] == 0} {
return 1
}
} else {
if {[string compare -length $l $p $name] == 0 &&
if {[string compare -length $l $p $name] == 0 &&
([string length $name] == $l || [string index $name $l] eq "/")} {
([string length $name] == $l ||
[string index $name $l] eq "/")} {
return 1
return 1
}
}
}
}
}
return 0
return 0
}
}
proc addtocflist {ids} {
proc addtocflist {ids} {
global treediffs cflist viewfiles curview limitdiffs
global treediffs
if {$limitdiffs && $viewfiles($curview) ne {}} {
add_flist $treediffs($ids)
set flist {}
foreach f $treediffs($ids) {
if {[path_filter $viewfiles($curview) $f]} {
lappend flist $f
}
}
} else {
set flist $treediffs($ids)
}
add_flist $flist
getblobdiffs $ids
getblobdiffs $ids
}
}
@ -5100,7 +5097,7 @@ proc gettreediffs {ids} {
proc gettreediffline {gdtf ids} {
proc gettreediffline {gdtf ids} {
global treediff treediffs treepending diffids diffmergeid
global treediff treediffs treepending diffids diffmergeid
global cmitmode
global cmitmode viewfiles curview limitdiffs
set nr 0
set nr 0
while {[incr nr] <= 1000 && [gets $gdtf line] >= 0} {
while {[incr nr] <= 1000 && [gets $gdtf line] >= 0} {
@ -5117,7 +5114,17 @@ proc gettreediffline {gdtf ids} {
return [expr {$nr >= 1000? 2: 1}]
return [expr {$nr >= 1000? 2: 1}]
}
}
close $gdtf
close $gdtf
if {$limitdiffs && $viewfiles($curview) ne {}} {
set flist {}
foreach f $treediff {
if {[path_filter $viewfiles($curview) $f]} {
lappend flist $f
}
}
set treediffs($ids) $flist
} else {
set treediffs($ids) $treediff
set treediffs($ids) $treediff
}
unset treepending
unset treepending
if {$cmitmode eq "tree"} {
if {$cmitmode eq "tree"} {
gettree $diffids
gettree $diffids
@ -7565,7 +7572,7 @@ proc prefscan {} {
proc prefsok {} {
proc prefsok {} {
global maxwidth maxgraphpct
global maxwidth maxgraphpct
global oldprefs prefstop showneartags showlocalchanges
global oldprefs prefstop showneartags showlocalchanges
global charspc ctext tabstop limitdiffs
global charspc ctext tabstop limitdiffs treediffs
catch {destroy $prefstop}
catch {destroy $prefstop}
unset prefstop
unset prefstop
@ -7577,6 +7584,10 @@ proc prefsok {} {
dohidelocalchanges
dohidelocalchanges
}
}
}
}
if {$limitdiffs != $oldprefs(limitdiffs)} {
# treediffs elements are limited by path
catch {unset treediffs}
}
if {$maxwidth != $oldprefs(maxwidth)
if {$maxwidth != $oldprefs(maxwidth)
|| $maxgraphpct != $oldprefs(maxgraphpct)} {
|| $maxgraphpct != $oldprefs(maxgraphpct)} {
redisplay
redisplay