Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Improved ClearCase support. Option -r is fully handled now. Show file names in window title. Don't show changed dirs in directory diff scroll map. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
87bde8e3e4428c8f958a58e07a019778 |
User & Date: | peter 2004-06-30 18:18:46.000 |
Context
2004-07-03
| ||
15:34 | In ClearCase revisions, a missing rev number now means latest. Init vars correctly in conflict mode check-in: 0e57fae9f8 user: peter tags: trunk | |
2004-06-30
| ||
18:18 | Improved ClearCase support. Option -r is fully handled now. Show file names in window title. Don't show changed dirs in directory diff scroll map. check-in: 87bde8e3e4 user: peter tags: trunk | |
2004-06-24
| ||
16:08 | Clip Diff window existance did not stop Eskil from exiting. Refactored all CVS/RCS/CT handling to common procs. Some file dialog procs did not track current directory correctly. check-in: 3a57f4d664 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 | # 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.4+ 2004-06-30" 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] |
︙ | ︙ | |||
1146 1147 1148 1149 1150 1151 1152 | # Get an RCS revision proc getRcsRev {filename outfile {rev {}}} { catch {exec co -p$rev [file nativename $filename] \ > $outfile} } # Get a ClearCase revision | | | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 | # Get an RCS revision proc getRcsRev {filename outfile {rev {}}} { catch {exec co -p$rev [file nativename $filename] \ > $outfile} } # Get a ClearCase revision proc getCtRev {filename outfile rev} { set filerev [file nativename $filename@@$rev] if {[catch {exec cleartool get -to $outfile $filerev} msg]} { tk_messageBox -icon error -title "Cleartool error" -message $msg return } } # Figure out ClearCase revision from arguments proc ParseCtRevs {filename stream rev} { # If the argument is of the form "name/rev", look for a fitting one if {[regexp {^[^/.]+/\d+$} $rev]} { if {[catch {exec cleartool lshistory -short $filename} allrevs]} { tk_messageBox -icon error -title "Cleartool error" \ -message $allrevs return } set allrevs [split $allrevs \n] set i [lsearch -glob $allrevs "*$rev" ] if {$i >= 0} { set rev [lindex [split [lindex $allrevs $i] "@"] end] } } set rev [file normalize [file join $stream $rev]] return $rev } # Get the last two elements in a file path proc GetLastTwoPath {path} { set last [file tail $path] set penultimate [file tail [file dirname $path]] if {$penultimate eq "."} { return $last } else { return [file join $penultimate $last] } } # Prepare for RCS/CVS/CT diff. Checkout copies of the versions needed. proc prepareRev {top} { global Pref set type $::diff($top,modetype) |
︙ | ︙ | |||
1185 1186 1187 1188 1189 1190 1191 1192 | lappend revs $::diff($top,doptrev1) } if {$::diff($top,doptrev2) != ""} { lappend revs $::diff($top,doptrev2) } if {$type eq "CT"} { foreach rev $revs { | > > > | < | < | > | > | | | < | | > | > | < | < | 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 | lappend revs $::diff($top,doptrev1) } if {$::diff($top,doptrev2) != ""} { lappend revs $::diff($top,doptrev2) } if {$type eq "CT"} { set revs2 {} set revlabels {} foreach rev $revs { set rev [ParseCtRevs $::diff($top,RevFile) $stream $rev] lappend revs2 $rev lappend revlabels [GetLastTwoPath $rev] } set revs $revs2 } else { set revlabels $revs } if {[llength $revs] < 2} { # Compare local file with specified version. if {[llength $revs] == 0} { set r "" if {$type eq "CT"} { set r [file join $stream $latest] } set tag "($type)" } else { set r [lindex $revs 0] set tag "($type [lindex $revlabels 0])" } set ::diff($top,leftFile) [tmpFile] set ::diff($top,leftLabel) "$::diff($top,RevFile) $tag" set ::diff($top,rightLabel) $::diff($top,RevFile) set ::diff($top,rightFile) $::diff($top,RevFile) if {$type eq "CVS"} { getCvsRev $::diff($top,RevFile) $::diff($top,leftFile) $r } elseif {$type eq "RCS"} { getRcsRev $::diff($top,RevFile) $::diff($top,leftFile) $r } else { getCtRev $::diff($top,RevFile) $::diff($top,leftFile) $r } } else { # Compare the two specified versions. set r1 [lindex $revs 0] set r2 [lindex $revs 1] set ::diff($top,leftFile) [tmpFile] set ::diff($top,rightFile) [tmpFile] set ::diff($top,leftLabel) \ "$::diff($top,RevFile) ($type [lindex $revlabels 0])" set ::diff($top,rightLabel) \ "$::diff($top,RevFile) ($type [lindex $revlabels 1])" if {$type eq "CVS"} { getCvsRev $::diff($top,RevFile) $::diff($top,leftFile) $r1 getCvsRev $::diff($top,RevFile) $::diff($top,rightFile) $r2 } elseif {$type eq "RCS"} { getRcsRev $::diff($top,RevFile) $::diff($top,leftFile) $r1 getRcsRev $::diff($top,RevFile) $::diff($top,rightFile) $r2 } else { getCtRev $::diff($top,RevFile) $::diff($top,leftFile) $r1 getCtRev $::diff($top,RevFile) $::diff($top,rightFile) $r2 } } # Make sure labels are updated before processing starts update idletasks } # Clean up after a RCS/CVS/CT diff. |
︙ | ︙ | |||
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 | clearMap $top set ::HighLightCount 0 highLightChange $top -1 # Display a star during diff execution, to know when the internal # processing starts, and when the label is "valid". set ::widgets($top,eqLabel) "*" update idletasks if {$::diff($top,mode) eq "patch"} { displayPatch $top drawMap $top -1 foreach item {wLine1 wLine2} { set w $::widgets($top,$item) $w configure -state disabled } update idletasks $::widgets($top,wLine2) see 1.0 normalCursor $top return } else { prepareFiles $top } # Run diff and parse the result. set opts $Pref(ignore) if {$Pref(nocase)} {lappend opts -nocase} if {[info exists ::diff($top,aligns)] && \ [llength $::diff($top,aligns)] > 0} { lappend opts -align $::diff($top,aligns) | > > > > > > > > > > > > > > > | 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 | clearMap $top set ::HighLightCount 0 highLightChange $top -1 # Display a star during diff execution, to know when the internal # processing starts, and when the label is "valid". set ::widgets($top,eqLabel) "*" wm title $top "Eskil:" update idletasks if {$::diff($top,mode) eq "patch"} { displayPatch $top drawMap $top -1 foreach item {wLine1 wLine2} { set w $::widgets($top,$item) $w configure -state disabled } update idletasks wm title $top "Eskil: [file tail $::diff($top,patchFile)]" $::widgets($top,wLine2) see 1.0 normalCursor $top return } else { prepareFiles $top } set tail1 [file tail $::diff($top,rightLabel)] set tail2 [file tail $::diff($top,leftLabel)] if {$::diff($top,mode) ne "" || $tail1 eq $tail2} { if {$::diff($top,mode) eq "rev"} { set tail1 [file tail $::diff($top,RevFile)] } elseif {$::diff($top,mode) eq "conflict"} { set tail1 [file tail $::diff($top,conflictFile)] } wm title $top "Eskil: $tail1" } else { wm title $top "Eskil: $tail2 vs $tail1" } # Run diff and parse the result. set opts $Pref(ignore) if {$Pref(nocase)} {lappend opts -nocase} if {[info exists ::diff($top,aligns)] && \ [llength $::diff($top,aligns)] > 0} { lappend opts -align $::diff($top,aligns) |
︙ | ︙ | |||
2407 2408 2409 2410 2411 2412 2413 | while 1 { set i [lsearch -integer -start $i $::diff($top,aligns) $leftline] if {$i < 0} break if {($i % 2) == 0} { set ::diff($top,aligns) [lreplace $::diff($top,aligns) \ $i [expr {$i + 1}]] break | | | 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 | while 1 { set i [lsearch -integer -start $i $::diff($top,aligns) $leftline] if {$i < 0} break if {($i % 2) == 0} { set ::diff($top,aligns) [lreplace $::diff($top,aligns) \ $i [expr {$i + 1}]] break } incr i } } if {[llength $::diff($top,aligns)] == 0} { disableAlign $top } |
︙ | ︙ | |||
2889 2890 2891 2892 2893 2894 2895 | incr t } set top .diff$t toplevel $top lappend ::diff(diffWindows) $top } | | | 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 | incr t } set top .diff$t toplevel $top lappend ::diff(diffWindows) $top } wm title $top "Eskil:" wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top] frame $top.f grid $top.f -row 0 -columnspan 4 -sticky news if {$tcl_platform(platform) eq "windows"} { #frame $top.f.line -height 1 -bg SystemButtonHighlight |
︙ | ︙ | |||
3113 3114 3115 3116 3117 3118 3119 | if {[info procs textSearch::enableSearch] != ""} { textSearch::enableSearch $top.ft1.tt -label ::widgets($top,isearchLabel) textSearch::enableSearch $top.ft2.tt -label ::widgets($top,isearchLabel) } label $top.le -textvariable ::widgets($top,eqLabel) -width 1 addBalloon $top.le "* means external diff is running.\n= means files do\ | > | | 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 | if {[info procs textSearch::enableSearch] != ""} { textSearch::enableSearch $top.ft1.tt -label ::widgets($top,isearchLabel) textSearch::enableSearch $top.ft2.tt -label ::widgets($top,isearchLabel) } label $top.le -textvariable ::widgets($top,eqLabel) -width 1 addBalloon $top.le "* means external diff is running.\n= means files do\ not differ.\n! means a large block is being processed.\nBlank\ means files differ." label $top.ls -width 1 -pady 0 -padx 0 \ -textvariable ::widgets($top,isearchLabel) addBalloon $top.ls "Incremental search indicator" canvas $top.c -width 6 -bd 0 -selectborderwidth 0 -highlightthickness 0 applyColor |
︙ | ︙ | |||
3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 | set tag2 new2 set maptag new2 } elseif {!$diff} { set tag2 "" } else { if {$info & 8} { set tag2 changed } else { set tag2 change } } if {$df2 eq ""} { set tag1 new1 set maptag new1 } elseif {!$diff} { set tag1 "" } else { if {$info & 4} { set tag1 changed } else { set tag1 change } } addChange .dirdiff 1 $maptag 0 0 0 0 if {$df2 eq ""} { | > > | 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 | set tag2 new2 set maptag new2 } elseif {!$diff} { set tag2 "" } else { if {$info & 8} { set tag2 changed set maptag "" } else { set tag2 change } } if {$df2 eq ""} { set tag1 new1 set maptag new1 } elseif {!$diff} { set tag1 "" } else { if {$info & 4} { set tag1 changed set maptag "" } else { set tag1 change } } addChange .dirdiff 1 $maptag 0 0 0 0 if {$df2 eq ""} { |
︙ | ︙ | |||
3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 | if {![file isdirectory $dirdiff(rightDir)]} return set dirdiff(leftFiles) {} set dirdiff(rightFiles) {} set dirdiff(infoFiles) {} set dirdiff(leftMark) "" set dirdiff(rightMark) "" $dirdiff(wLeft) delete 1.0 end $dirdiff(wRight) delete 1.0 end set top .dirdiff busyCursor $top clearMap $top update idletasks compareDirs $dirdiff(leftDir) $dirdiff(rightDir) | > > > > > > > > | 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 | if {![file isdirectory $dirdiff(rightDir)]} return set dirdiff(leftFiles) {} set dirdiff(rightFiles) {} set dirdiff(infoFiles) {} set dirdiff(leftMark) "" set dirdiff(rightMark) "" set tail1 [file tail $dirdiff(leftDir)] set tail2 [file tail $dirdiff(rightDir)] if {$tail1 eq $tail2} { wm title .dirdiff "Eskil Dir: $tail1" } else { wm title .dirdiff "Eskil Dir: $tail1 vs $tail2" } $dirdiff(wLeft) delete 1.0 end $dirdiff(wRight) delete 1.0 end set top .dirdiff busyCursor $top clearMap $top update idletasks compareDirs $dirdiff(leftDir) $dirdiff(rightDir) |
︙ | ︙ | |||
3985 3986 3987 3988 3989 3990 3991 | } } else { destroy $top toplevel $top lappend ::diff(diffWindows) $top } | | | 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 | } } else { destroy $top toplevel $top lappend ::diff(diffWindows) $top } wm title $top "Eskil Dir" wm protocol $top WM_DELETE_WINDOW [list cleanupAndExit $top] frame $top.fm frame $top.fe1 frame $top.fe2 menubutton $top.mf -menu $top.mf.m -text "File" -underline 0 |
︙ | ︙ | |||
4262 4263 4264 4265 4266 4267 4268 | $w.t insert end "A Tcl/Tk frontend to diff\n\n" $w.t insert end "$diffver\n\n" $w.t insert end "Made by Peter Spjuth\n" $w.t insert end "E-Mail: peter.spjuth@space.se\n" $w.t insert end "\nURL: http://spjuth.pointclark.net/Eskil.html\n" $w.t insert end "\nTcl version: [info patchlevel]\n" | > > > > > > > | | 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 | $w.t insert end "A Tcl/Tk frontend to diff\n\n" $w.t insert end "$diffver\n\n" $w.t insert end "Made by Peter Spjuth\n" $w.t insert end "E-Mail: peter.spjuth@space.se\n" $w.t insert end "\nURL: http://spjuth.pointclark.net/Eskil.html\n" $w.t insert end "\nTcl version: [info patchlevel]\n" set du [package provide DiffUtil] if {[info procs DiffUtil::LocateDiffExe] ne ""} { append du " (tcl)" } else { append du " (c)" } $w.t insert end "DiffUtil version: $du\n" $w.t insert end "\nCredits:\n" $w.t insert end "Ideas for scrollbar map and merge function\n" $w.t insert end "taken from TkDiff" set last [lindex [split [$w.t index end] "."] 0] $w.t configure -height $last $w.t configure -state disabled |
︙ | ︙ | |||
4414 4415 4416 4417 4418 4419 4420 | -char : The analysis of changes can be done on either -word : character or word basis. -char is the default. -noignore : Don't ignore any whitespace. -b : Ignore space changes. Default. -w : Ignore all spaces. | | > > | 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 | -char : The analysis of changes can be done on either -word : character or word basis. -char is the default. -noignore : Don't ignore any whitespace. -b : Ignore space changes. Default. -w : Ignore all spaces. -nocase : Ignore case changes. -r <ver> : Version info for CVS/RCS/ClearCase diff. -conflict : Treat file as a merge conflict file and enter merge mode. -o <file> : Specify merge result output file. -browse : Automatically bring up file dialog after starting. -server : Set up Eskil to be controllable from the outside. |
︙ | ︙ |