Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Moved execution of diff to DiffUtil package. Remade align to use flag of DiffUtil::diffFiles. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
656ffb667300988acd2b07a2f7987a7a |
User & Date: | peter 2004-05-23 11:09:06.000 |
Context
2004-05-23
| ||
13:16 | Changed separate diff to use -range option to DiffUtil::diffFiles. Moved widget related global data to ::widgets. check-in: 8b189f3385 user: peter tags: trunk | |
11:09 | Moved execution of diff to DiffUtil package. Remade align to use flag of DiffUtil::diffFiles. check-in: 656ffb6673 user: peter tags: trunk | |
2004-05-18
| ||
19:28 | Moved everything into Makefile. check-in: 9c9694729d user: peter tags: trunk | |
Changes
Changes to src/eskil.tcl.
︙ | ︙ | |||
47 48 49 50 51 52 53 | # Add a dummy if it does not exist. proc addBalloon {args} {} } else { namespace import -force psballoon::addBalloon } set debug 0 | | < | | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | # Add a dummy if it does not exist. proc addBalloon {args} {} } else { namespace import -force psballoon::addBalloon } set debug 0 set diffver "Version 2.0.2+ 2004-05-23" set thisScript [file join [pwd] [info script]] set thisDir [file dirname $thisScript] # Follow any link set tmplink $thisScript while {[file type $tmplink] eq "link"} { set tmplink [file readlink $tmplink] set tmplink [file normalize [file join $thisDir $tmplink]] set thisDir [file dirname $tmplink] } unset tmplink set ::util(cvsExists) [expr {![string equal [auto_execok cvs] ""]}] set ::util(diffexe) diff # Diff functionality is in the DiffUtil package. package require DiffUtil # Figure out a place to store temporary files. locateTmp ::diff(tmpdir) if {$tcl_platform(platform) eq "windows"} { # Locate CVS if it is in c:/bin if {!$::util(cvsExists) && [file exists "c:/bin/cvs.exe"]} { set env(PATH) "$env(PATH);c:\\bin" auto_reset set ::util(cvsExists) [expr {![string equal [auto_execok cvs] ""]}] } } |
︙ | ︙ | |||
137 138 139 140 141 142 143 | } errMsg]} { tk_messageBox -icon error -title "Eskil Error" -message \ "An error occured in the close process.\n$errMsg\n\ (This is a bug)\nTerminating application." -type ok } if {$cont} return | < < < | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | } errMsg]} { tk_messageBox -icon error -title "Eskil Error" -message \ "An error occured in the close process.\n$errMsg\n\ (This is a bug)\nTerminating application." -type ok } if {$cont} return clearTmp exit } # Format a line number proc myFormL {lineNo} { if {![string is integer -strict $lineNo]} {return "$lineNo\n"} |
︙ | ︙ | |||
1088 1089 1090 1091 1092 1093 1094 | set state left set end2 [expr {$rightLine - 1}] set start1 $leftLine } elseif {[string match >>>>>>* $line] && $state eq "left"} { set state both regexp {>*\s*(.*)} $line -> leftName set end1 [expr {$leftLine - 1}] | | > > | 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 | set state left set end2 [expr {$rightLine - 1}] set start1 $leftLine } elseif {[string match >>>>>>* $line] && $state eq "left"} { set state both regexp {>*\s*(.*)} $line -> leftName set end1 [expr {$leftLine - 1}] lappend diff($top,conflictDiff) [list \ $start1 [expr {$end1 - $start1 + 1}] \ $start2 [expr {$end2 - $start2 + 1}]] } elseif {$state eq "both"} { puts $ch1 $line puts $ch2 $line incr leftLine incr rightLine } elseif {$state eq "left"} { puts $ch1 $line |
︙ | ︙ | |||
1580 1581 1582 1583 1584 1585 1586 | normalCursor $top return } else { prepareFiles $top } # Run diff and parse the result. | < | > | | > | < | < < < < < < < < | | < | | | | > | | < | < < < < < < < < < < < < < < < | < < < < < < < | < < < < < < < | 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 | normalCursor $top return } else { prepareFiles $top } # Run diff and parse the result. set opts $Pref(ignore) if {[info exists ::diff($top,aligns)] && \ [llength $::diff($top,aligns)] > 0} { lappend opts -align $::diff($top,aligns) } set differr [catch {eval DiffUtil::diffFiles $opts \ \$diff($top,leftFile) \$diff($top,rightFile)} diffres] # In conflict mode we can use the diff information collected when # parsing the conflict file. This makes sure the blocks in the conflict # file become change-blocks during merge. if {$diff($top,mode) eq "conflictPure"} { set diffres $diff($top,conflictDiff) } if {$differr != 0} { $::diff($top,wDiff1) insert end $diffres normalCursor $top return } if {[llength $diffres] == 0} { set ::diff($top,eqLabel) "=" } else { set ::diff($top,eqLabel) " " } # Update the equal label immediately for better feedback update idletasks set firstview 1 set ch1 [open $diff($top,leftFile)] set ch2 [open $diff($top,rightFile)] if {$::tcl_platform(platform) eq "windows" && $Pref(crlf)} { fconfigure $ch1 -translation crlf fconfigure $ch2 -translation crlf } set doingLine1 1 set doingLine2 1 set t 0 foreach i $diffres { foreach {line1 n1 line2 n2} $i break doText $top $ch1 $ch2 $n1 $n2 $line1 $line2 if {$::diff($top,limitlines) && \ ($::diff($top,mapMax) > $::diff($top,limitlines))} { break } bindHighlight $top incr ::HighLightCount |
︙ | ︙ | |||
2634 2635 2636 2637 2638 2639 2640 | } ################ # Align function ################ proc enableAlign {top} { | | < < | < < < < < < | < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < | | > > | 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 | } ################ # Align function ################ proc enableAlign {top} { eval $::diff($top,enableAlignCmd) } proc disableAlign {top} { eval $::diff($top,disableAlignCmd) } proc clearAlign {top} { set ::diff($top,aligns) {} disableAlign $top } # Mark a line as aligned. proc markAlign {top n line text} { set ::diff($top,align$n) $line set ::diff($top,aligntext$n) $text if {[info exists ::diff($top,align1)] && [info exists ::diff($top,align2)]} { set level 2 if {![string equal $::diff($top,aligntext1) $::diff($top,aligntext2)]} { set apa [tk_messageBox -icon question -title "Align" -type yesno \ -message "Those lines are not equal.\nReally align them?"] if {$apa != "yes"} { return } set level 3 } lappend ::diff($top,aligns) $::diff($top,align1) $::diff($top,align2) enableAlign $top unset ::diff($top,align1) unset ::diff($top,align2) unset ::diff($top,aligntext1) unset ::diff($top,aligntext2) } } # Called by popup menus over row numbers to add command for alignment. # Returns 1 if nothing was added. proc alignMenu {m top n x y} { # Get the row that was clicked |
︙ | ︙ | |||
3256 3257 3258 3259 3260 3261 3262 | -command makeDiffWin $top.mt.m add command -label "Directory Diff" -underline 0 \ -command makeDirDiffWin $top.mt.m add command -label "Clip Diff" -underline 0 \ -command makeClipDiffWin $top.mt.m add command -label "Merge" -underline 0 \ -command [list makeMergeWin $top] -state disabled | | | > > > > > | 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 | -command makeDiffWin $top.mt.m add command -label "Directory Diff" -underline 0 \ -command makeDirDiffWin $top.mt.m add command -label "Clip Diff" -underline 0 \ -command makeClipDiffWin $top.mt.m add command -label "Merge" -underline 0 \ -command [list makeMergeWin $top] -state disabled $top.mt.m add command -label "Clear Align" \ -command [list clearAlign $top] -state disabled set ::diff($top,enableAlignCmd) [list \ $top.mt.m entryconfigure "Clear Align" -state normal] set ::diff($top,disableAlignCmd) [list \ $top.mt.m entryconfigure "Clear Align" -state disabled] if {$::tcl_platform(platform) eq "windows"} { if {![catch {package require registry}]} { $top.mt.m add separator $top.mt.m add command -label "Setup Registry" -underline 6 \ -command makeRegistryWin } } |
︙ | ︙ |