Eskil

Diff
Login

Differences From Artifact [b8c85357ce]:

To Artifact [6268c8ab2d]:


71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#     1.8     DA-PS    001115   Highlight current diff.
#                               New -conflict flag to handle merge conflicts.
#
#-----------------------------------------------
# the next line restarts using wish \
exec wish "$0" "$@"

set debug 0
set diffver "Version 1.8  001115"
set tmpcnt 0
set tmpfiles {}
set thisscript [file join [pwd] [info script]]
set thisdir [file dirname $thisscript]

if {$tcl_platform(platform) == "windows"} {
    cd $thisdir







|
|







71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#     1.8     DA-PS    001115   Highlight current diff.
#                               New -conflict flag to handle merge conflicts.
#
#-----------------------------------------------
# the next line restarts using wish \
exec wish "$0" "$@"

set debug 1
set diffver "Version 1.8.1  001128"
set tmpcnt 0
set tmpfiles {}
set thisscript [file join [pwd] [info script]]
set thisdir [file dirname $thisscript]

if {$tcl_platform(platform) == "windows"} {
    cd $thisdir
830
831
832
833
834
835
836


837
838
839
840
841
842
843
    set ch2 [open $diff(rightFile) w]
    set ch [open $diff(conflictFile) r]

    set diff(conflictDiff) {}
    set leftLine 1
    set rightLine 1
    set state both


    while {[gets $ch line] != -1} {
        if {[string match <<<<<<* $line]} {
            set state right
            regexp {<*\s*(.*)} $line -> rightName
            set start2 $rightLine
        } elseif {[string match ======* $line] && $state == "right"} {
            set state left







>
>







830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
    set ch2 [open $diff(rightFile) w]
    set ch [open $diff(conflictFile) r]

    set diff(conflictDiff) {}
    set leftLine 1
    set rightLine 1
    set state both
    set rightName ""
    set leftName ""
    while {[gets $ch line] != -1} {
        if {[string match <<<<<<* $line]} {
            set state right
            regexp {<*\s*(.*)} $line -> rightName
            set start2 $rightLine
        } elseif {[string match ======* $line] && $state == "right"} {
            set state left
860
861
862
863
864
865
866





867
868
869
870
871
872
873
            puts $ch2 $line
            incr rightLine
        }
    }
    close $ch
    close $ch1
    close $ch2





    set diff(leftLabel) $leftName
    set diff(rightLabel) $rightName
    update idletasks
}

# Clean up after a conflict diff.
proc cleanupConflict {} {







>
>
>
>
>







862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
            puts $ch2 $line
            incr rightLine
        }
    }
    close $ch
    close $ch1
    close $ch2

    if {$leftName == "" && $rightName == ""} {
        set leftName "No Conflict: [file tail $diff(conflictFile)]"
        set rightName $leftName
    }
    set diff(leftLabel) $leftName
    set diff(rightLabel) $rightName
    update idletasks
}

# Clean up after a conflict diff.
proc cleanupConflict {} {
1028
1029
1030
1031
1032
1033
1034

1035
1036
1037
1038
1039
1040
1041
            return
        } else {
            set eqLabel "="
        }
    } else {
        set eqLabel " "
    }


    set ch1 [open $diff(leftFile)]
    set ch2 [open $diff(rightFile)]
    if {$::tcl_platform(platform) == "windows" && $Pref(crlf)} {
        fconfigure $ch1 -translation crlf
        fconfigure $ch2 -translation crlf
    }







>







1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
            return
        } else {
            set eqLabel "="
        }
    } else {
        set eqLabel " "
    }
    update idletasks

    set ch1 [open $diff(leftFile)]
    set ch2 [open $diff(rightFile)]
    if {$::tcl_platform(platform) == "windows" && $Pref(crlf)} {
        fconfigure $ch1 -translation crlf
        fconfigure $ch2 -translation crlf
    }
1113
1114
1115
1116
1117
1118
1119

1120

1121
1122
1123
1124
1125
1126
1127
    normalCursor
    showDiff 0

    if {$diff(mode) == "RCS" || $diff(mode) == "CVS"} {
        cleanupRCS
    } elseif {[string match "conflict*" $diff(mode)]} {
        cleanupConflict

        after idle makeMergeWin

    }
}

# This is the entrypoint to do a diff via DDE or Send
proc remoteDiff {file1 file2} {
    global diff








>
|
>







1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
    normalCursor
    showDiff 0

    if {$diff(mode) == "RCS" || $diff(mode) == "CVS"} {
        cleanupRCS
    } elseif {[string match "conflict*" $diff(mode)]} {
        cleanupConflict
        if {$eqLabel != "="} {
            after idle makeMergeWin
        }
    }
}

# This is the entrypoint to do a diff via DDE or Send
proc remoteDiff {file1 file2} {
    global diff