Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Robuster call to diff.tcl Binary comparison added. Special tag for directories. Command line arguments. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
7c093622ddada4f5eb5609a96a085c66 |
User & Date: | spjutp 2000-02-17 12:14:49.000 |
Context
2000-04-27
| ||
10:58 | Restricted parsing of large blocks. Fixed bug with spaces in file names. Regular screen updates during processing. CVS support. check-in: 5f76fd4f5d user: spjutp tags: trunk | |
2000-02-17
| ||
12:14 | Robuster call to diff.tcl Binary comparison added. Special tag for directories. Command line arguments. check-in: 7c093622dd user: spjutp tags: trunk | |
2000-01-31
| ||
11:35 | Bug-fix in printing. Release 1.6 check-in: dbfc80fcf3 user: spjutp tags: trunk | |
Changes
Changes to dirdiff.tcl.
︙ | ︙ | |||
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 | return 0 } if {[file isdirectory $file1] || [file isdirectory $file2]} { return 0 } switch $Pref(comparelevel) { 1 { #Check contents internally set bufsz 65536 set eq 1 set ch1 [open $file1 r] set ch2 [open $file2 r] while {![eof $ch1] && ![eof $ch2]} { set f1 [read $ch1 $bufsz] set f2 [read $ch2 $bufsz] if {![string equal $f1 $f2]} { set eq 0 break } | > > > > > | 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | return 0 } if {[file isdirectory $file1] || [file isdirectory $file2]} { return 0 } switch $Pref(comparelevel) { 1b - 1 { #Check contents internally set bufsz 65536 set eq 1 set ch1 [open $file1 r] set ch2 [open $file2 r] if {$Pref(comparelevel) == "1b"} { fconfigure $ch1 -translation binary fconfigure $ch2 -translation binary } while {![eof $ch1] && ![eof $ch2]} { set f1 [read $ch1 $bufsz] set f2 [read $ch2 $bufsz] if {![string equal $f1 $f2]} { set eq 0 break } |
︙ | ︙ | |||
126 127 128 129 130 131 132 | if {!$diff} { set tag2 "" incr info -8 } elseif {$df1 == ""} { set tag2 new2 } else { | > > > | > > > > | > | 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 | if {!$diff} { set tag2 "" incr info -8 } elseif {$df1 == ""} { set tag2 new2 } else { if {$info & 4} { set tag2 changed } else { set tag2 change } } if {$df2 == ""} { set tag1 new1 .t2 insert end \n } else { if {$info & 2} { set tag1 changed } else { set tag1 change } .t2 insert end [format "%-30s %8d %16s\n" $f2 [file size $df2] \ [clock format [file mtime $df2] -format "%Y-%m-%d %H:%M"]] \ $tag2 } if {!$diff} { set tag1 "" } |
︙ | ︙ | |||
266 267 268 269 270 271 272 | proc remoteDiff {file1 file2} { global tcl_platform set cmd [list remoteDiff $file1 $file2] if {$tcl_platform(platform) == "unix"} { #send -async Diff $cmd | > | | > | 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 | proc remoteDiff {file1 file2} { global tcl_platform set cmd [list remoteDiff $file1 $file2] if {$tcl_platform(platform) == "unix"} { #send -async Diff $cmd exec [info nameofexecutable] [file join $::thisDir diff.tcl]\ -server $file1 $file2 & } else { if {[catch {dde eval -async Diff $cmd}]} { catch {exec [info nameofexecutable]\ [file join $::thisDir diff.tcl] -server &} after 500 catch {dde eval -async Diff $cmd} } } } proc upDir {{n 0}} { |
︙ | ︙ | |||
316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | } proc applyColor {} { global Pref .t1 tag configure new1 -foreground $Pref(colornew1) -background $Pref(bgnew1) .t1 tag configure change -foreground $Pref(colorchange) -background $Pref(bgchange) .t2 tag configure new2 -foreground $Pref(colornew2) -background $Pref(bgnew2) .t2 tag configure change -foreground $Pref(colorchange) -background $Pref(bgchange) } proc makeDirDiffWin {} { global Pref tcl_platform eval destroy [winfo children .] | > > | 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | } proc applyColor {} { global Pref .t1 tag configure new1 -foreground $Pref(colornew1) -background $Pref(bgnew1) .t1 tag configure change -foreground $Pref(colorchange) -background $Pref(bgchange) .t1 tag configure changed -foreground $Pref(colorchange) .t2 tag configure new2 -foreground $Pref(colornew2) -background $Pref(bgnew2) .t2 tag configure change -foreground $Pref(colorchange) -background $Pref(bgchange) .t2 tag configure changed -foreground $Pref(colorchange) } proc makeDirDiffWin {} { global Pref tcl_platform eval destroy [winfo children .] |
︙ | ︙ | |||
341 342 343 344 345 346 347 348 349 350 351 352 353 354 | .mo.m add checkbutton -variable Pref(autocompare) -label "Auto Compare" menu .mo.mc .mo.mc add radiobutton -variable Pref(comparelevel) -value 0 \ -label "Do not check contents" .mo.mc add radiobutton -variable Pref(comparelevel) -value 1 \ -label "Internal compare" .mo.mc add radiobutton -variable Pref(comparelevel) -value 2 \ -label "Use Diff" .mo.mc add radiobutton -variable Pref(comparelevel) -value 3 \ -label "Diff, ignore blanks" .mo.mc add radiobutton -variable Pref(comparelevel) -value 4 \ -label "Diff, ignore case" .mo.mc add radiobutton -variable Pref(comparelevel) -value 5 \ | > > | 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 | .mo.m add checkbutton -variable Pref(autocompare) -label "Auto Compare" menu .mo.mc .mo.mc add radiobutton -variable Pref(comparelevel) -value 0 \ -label "Do not check contents" .mo.mc add radiobutton -variable Pref(comparelevel) -value 1 \ -label "Internal compare" .mo.mc add radiobutton -variable Pref(comparelevel) -value 1b \ -label "Internal compare (bin)" .mo.mc add radiobutton -variable Pref(comparelevel) -value 2 \ -label "Use Diff" .mo.mc add radiobutton -variable Pref(comparelevel) -value 3 \ -label "Diff, ignore blanks" .mo.mc add radiobutton -variable Pref(comparelevel) -value 4 \ -label "Diff, ignore case" .mo.mc add radiobutton -variable Pref(comparelevel) -value 5 \ |
︙ | ︙ | |||
419 420 421 422 423 424 425 | set Pref(fontfamily) courier set Pref(colorchange) red set Pref(colornew1) darkgreen set Pref(colornew2) blue set Pref(bgchange) gray set Pref(bgnew1) gray set Pref(bgnew2) gray | | > > > > > > > | | | | 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 | set Pref(fontfamily) courier set Pref(colorchange) red set Pref(colornew1) darkgreen set Pref(colornew2) blue set Pref(bgchange) gray set Pref(bgnew1) gray set Pref(bgnew2) gray set Pref(comparelevel) 1 set Pref(recursive) 0 set Pref(diffonly) 0 set Pref(autocompare) 1 if {[file exists "~/.dirdiffrc"]} { source "~/.dirdiffrc" } } proc parseCommandLine {} { global argc argv leftDir rightDir Pref if {$argc == 2} { set leftDir [lindex $argv 0] set rightDir [lindex $argv 1] } elseif {$argc == 1} { set leftDir [lindex $argv 0] set rightDir [lindex $argv 0] } else { set leftDir [pwd] set rightDir [pwd] } } if {![winfo exists .fm]} { getOptions parseCommandLine makeDirDiffWin } |