Eskil

Check-in [48fa641c5b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Respect block parse setting when showing patch.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 48fa641c5bee0e22c5aa4a418d6f5c229dacb00e
User & Date: peter.spjuth@gmail.com 2011-10-05 10:28:03.000
Context
2011-10-14
23:51
Normalize searchpath to find plugins in VFS. check-in: 2ef67553ab user: peter.spjuth@gmail.com tags: trunk
2011-10-05
10:28
Respect block parse setting when showing patch. check-in: 48fa641c5b user: peter.spjuth@gmail.com tags: trunk
10:18
Moved handling of noparse block to a proc. check-in: a08d6e2b43 user: peter.spjuth@gmail.com tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Changes.






1
2
3
4
5
6
7






2011-05-09
 Use mouse dragging to set alignment.

2011-05-09
 Rewritten directory diff to use tablelist.
 Redesigned appearance of directory diff.

>
>
>
>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
2011-10-05
 Respect block parse setting when showing a patch. [Bug 18147]

2011-10-04
 Fall back to Tcl-dialog when accessing a vfs. [Bug 18371]

2011-05-09
 Use mouse dragging to set alignment.

2011-05-09
 Rewritten directory diff to use tablelist.
 Redesigned appearance of directory diff.

Changes to src/eskil.tcl.
507
508
509
510
511
512
513
514
515
516
517
518

519










520
521
522
523
524
525
526
527
528
        addChange $top $n1 $tag1 $line1 $n1 $line2 $n2
        nextHighlight $top
    }
}

# Insert two blocks of lines in the compare windows.
proc insertMatchingBlocks {top block1 block2 line1 line2 details} {
    global doingLine1 doingLine2

    # A large block may take time.  Give a small warning.
    set n1 [llength $block1]
    set n2 [llength $block2]

    if {$n1 * $n2 > 1000} {










        set ::widgets($top,eqLabel) "!"
        #puts "Eskil warning: Analyzing a large block. ($size1 $size2)"
        update idletasks
    }
    
    # Detect if only newlines has changed within the block, e.g.
    # when rearranging newlines.
    if {$::eskil(ignorenewline)} {
        set res [ParseBlocksAcrossNewline $top $block1 $block2]







|

<


>
|
>
>
>
>
>
>
>
>
>
>

<







507
508
509
510
511
512
513
514
515

516
517
518
519
520
521
522
523
524
525
526
527
528
529
530

531
532
533
534
535
536
537
        addChange $top $n1 $tag1 $line1 $n1 $line2 $n2
        nextHighlight $top
    }
}

# Insert two blocks of lines in the compare windows.
proc insertMatchingBlocks {top block1 block2 line1 line2 details} {
    global doingLine1 doingLine2 Pref


    set n1 [llength $block1]
    set n2 [llength $block2]

    set large [expr {$n1 * $n2 > 1000}]

    if {$n1 == 0 || $n2 == 0 || $Pref(parse) < 2 || \
            ($large && $Pref(parse) < 3)} {
        # No extra parsing at all.
        insertMatchingBlocksNoParse $top $block1 $block2 $line1 $line2 $details
        return
    }

    # A large block may take time.  Give a small warning.
    if {$large} {
        set ::widgets($top,eqLabel) "!"

        update idletasks
    }
    
    # Detect if only newlines has changed within the block, e.g.
    # when rearranging newlines.
    if {$::eskil(ignorenewline)} {
        set res [ParseBlocksAcrossNewline $top $block1 $block2]
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
            lappend block1 $apa
        }
        set block2 {}
        for {set t 0} {$t < $n2} {incr t} {
            gets $ch2 apa
            lappend block2 $apa
        }
        if {$n1 != 0 && $n2 != 0 && $Pref(parse) >= 2 && \
                ($n1 * $n2 < 1000 || $Pref(parse) == 3)} {
            # Full block parsing
            insertMatchingBlocks $top $block1 $block2 $line1 $line2 1
        } else {
            # No extra parsing at all.
            insertMatchingBlocksNoParse $top $block1 $block2 $line1 $line2 1
        }
    }
    # Empty return value
    return
}

proc enableRedo {top} {
    $top.m.mf entryconfigure "Redo Diff" -state normal







<
<
<
|
<
<
<
<







784
785
786
787
788
789
790



791




792
793
794
795
796
797
798
            lappend block1 $apa
        }
        set block2 {}
        for {set t 0} {$t < $n2} {incr t} {
            gets $ch2 apa
            lappend block2 $apa
        }



        insertMatchingBlocks $top $block1 $block2 $line1 $line2 1




    }
    # Empty return value
    return
}

proc enableRedo {top} {
    $top.m.mf entryconfigure "Redo Diff" -state normal
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
            }
            continue
        }
        # No change block anymore. If one just ended, display it.
        if {[llength $lblock] > 0 || [llength $rblock] > 0} {
            set ::doingLine1 $lblockl
            set ::doingLine2 $rblockl
            # TODO: large/small block support
            #set Pref(parse) 2
            #if {$n1 != 0 && $n2 != 0 && $Pref(parse) >= 2 && \
                    #    ($n1 * $n2 < 1000 || $Pref(parse) == 3)} {
            # }
            insertMatchingBlocks $top $lblock $rblock $lblockl $rblockl 0
            set lblock {}
            set rblock {}
        }
        if {$lmode == "" && $rmode == ""} {
            insertLine $top 1 $lline $lstr
            insertLine $top 2 $rline $rstr







<
<
<
<
<







993
994
995
996
997
998
999





1000
1001
1002
1003
1004
1005
1006
            }
            continue
        }
        # No change block anymore. If one just ended, display it.
        if {[llength $lblock] > 0 || [llength $rblock] > 0} {
            set ::doingLine1 $lblockl
            set ::doingLine2 $rblockl





            insertMatchingBlocks $top $lblock $rblock $lblockl $rblockl 0
            set lblock {}
            set rblock {}
        }
        if {$lmode == "" && $rmode == ""} {
            insertLine $top 1 $lline $lstr
            insertLine $top 2 $rline $rstr
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
            continue
        }
    }
    # If the patch ended with a change block, display it.
    if {[llength $lblock] > 0 || [llength $rblock] > 0} {
        set ::doingLine1 $lblockl
        set ::doingLine2 $rblockl
        # TODO: large/small block support
        insertMatchingBlocks $top $lblock $rblock $lblockl $rblockl 0
        set lblock {}
        set rblock {}
    }
}

# Read a patch file and display it







<







1024
1025
1026
1027
1028
1029
1030

1031
1032
1033
1034
1035
1036
1037
            continue
        }
    }
    # If the patch ended with a change block, display it.
    if {[llength $lblock] > 0 || [llength $rblock] > 0} {
        set ::doingLine1 $lblockl
        set ::doingLine2 $rblockl

        insertMatchingBlocks $top $lblock $rblock $lblockl $rblockl 0
        set lblock {}
        set rblock {}
    }
}

# Read a patch file and display it