509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
|
# next to each other.
# As the previous procedure, this would need a complete rework and a
# better algorithm.
proc compareBlocks {block1 block2} {
set size1 [llength $block1]
set size2 [llength $block2]
if {$size1 * $size2 > 1000} {
puts "Eskil warning: Analyzing a large block. ($size1 $size2)"
update idletasks
}
# Swap if block1 is bigger
if {$size1 > $size2} {
set apa $block1
set block1 $block2
set block2 $apa
set size1 [llength $block1]
set size2 [llength $block2]
|
<
<
<
<
<
|
509
510
511
512
513
514
515
516
517
518
519
520
521
522
|
# next to each other.
# As the previous procedure, this would need a complete rework and a
# better algorithm.
proc compareBlocks {block1 block2} {
set size1 [llength $block1]
set size2 [llength $block2]
# Swap if block1 is bigger
if {$size1 > $size2} {
set apa $block1
set block1 $block2
set block2 $apa
set size1 [llength $block1]
set size2 [llength $block2]
|
819
820
821
822
823
824
825
826
827
828
829
830
831
832
|
incr doingLine2
}
# Insert two blocks of lines in the compare windows.
# Returns number of lines used to display the blocks
proc insertMatchingBlocks {top block1 block2} {
global doingLine1 doingLine2
set apa [compareBlocks $block1 $block2]
set t1 0
set t2 0
foreach c $apa {
if {$c eq "c"} {
|
>
>
>
>
>
>
>
|
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
|
incr doingLine2
}
# Insert two blocks of lines in the compare windows.
# Returns number of lines used to display the blocks
proc insertMatchingBlocks {top block1 block2} {
global doingLine1 doingLine2
# A large block may take time. Give a small warning.
if {[llength $block1] * [llength $block2] > 1000} {
set ::diff($top,eqLabel) "!"
#puts "Eskil warning: Analyzing a large block. ($size1 $size2)"
update idletasks
}
set apa [compareBlocks $block1 $block2]
set t1 0
set t2 0
foreach c $apa {
if {$c eq "c"} {
|
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
|
set w $::diff($top,$item)
$w configure -state disabled
}
update idletasks
$::diff($top,wLine2) see 1.0
normalCursor $top
showDiff $top 0
cleanupFiles $top
if {[string match "conflict*" $diff($top,mode)]} {
if {$::diff($top,eqLabel) != "="} {
makeMergeWin $top
}
}
|
>
>
>
|
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
|
set w $::diff($top,$item)
$w configure -state disabled
}
update idletasks
$::diff($top,wLine2) see 1.0
normalCursor $top
showDiff $top 0
if {$::diff($top,eqLabel) eq "!"} {
set ::diff($top,eqLabel) " "
}
cleanupFiles $top
if {[string match "conflict*" $diff($top,mode)]} {
if {$::diff($top,eqLabel) != "="} {
makeMergeWin $top
}
}
|