1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
#!/bin/sh
#
# Copyright (C) 1999-2002 Peter Spjuth
#
#-----------------------------------------------
# $Revision$
#-----------------------------------------------
# the next line restarts using wish \
exec wish "$0" "$@"
package require Tk 8.3
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
if {[file type $thisScript] == "link"} {
set tmplink [file readlink $thisScript]
set thisDir [file dirname [file join $thisDir $tmplink]]
unset tmplink
}
if {$tcl_platform(platform) == "windows"} {
package require dde
}
if {$::tcl_platform(platform) == "unix"} {
set editor emacs
set diffExe diff
} else {
|
|
>
>
>
>
>
>
>
>
>
>
>
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#!/bin/sh
#
# Copyright (C) 1999-2003 Peter Spjuth
#
#-----------------------------------------------
# $Revision$
#-----------------------------------------------
# the next line restarts using wish \
exec wish "$0" "$@"
package require Tk 8.3
set debug 0
set thisScript [file join [pwd] [info script]]
set thisDir [file dirname $thisScript]
if {[file type $thisScript] == "link"} {
set tmplink [file readlink $thisScript]
set thisDir [file dirname [file join $thisDir $tmplink]]
unset tmplink
}
set tclDiffExe [list [info nameofexecutable] [file join $::thisDir diff.tcl]]
# Support for FreeWrap 5.5
if {[info proc ::freewrap::unpack] != ""} {
set debug 0
set thisDir [file dirname [info nameofexecutable]]
set thisScript ""
# Assume a wrapped diff too
set tclDiffExe [list [file join $::thisDir tcldiff.exe]]
}
if {$::tcl_platform(platform) == "windows"} {
package require dde
}
if {$::tcl_platform(platform) == "unix"} {
set editor emacs
set diffExe diff
} else {
|
︙ | | | ︙ | |
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
|
error "Bad from argument to editFile: $from"
}
exec $::editor $src &
}
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}} {
|
<
|
<
|
<
|
|
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
|
error "Bad from argument to editFile: $from"
}
exec $::editor $src &
}
proc remoteDiff {file1 file2} {
set cmd [list remoteDiff $file1 $file2]
if {$::tcl_platform(platform) == "unix"} {
# send -async Diff $cmd
eval exec $::tclDiffExe -server \$file1 \$file2 &
} else {
if {[catch {dde eval -async Diff $cmd}]} {
catch {eval exec $::tclDiffExe -server &}
after 500
catch {dde eval -async Diff $cmd}
}
}
}
proc upDir {{n 0}} {
|
︙ | | | ︙ | |
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
|
.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 .]
frame .fm
frame .fe1
frame .fe2
|
|
|
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
|
.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
eval destroy [winfo children .]
frame .fm
frame .fe1
frame .fe2
|
︙ | | | ︙ | |
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
|
-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 \
-label "Diff, ignore RCS"
menubutton .md -text Debug -menu .md.m -relief ridge
menu .md.m
if {$tcl_platform(platform) == "windows"} {
.md.m add checkbutton -label Console -variable consolestate \
-onvalue show -offvalue hide -command {console $consolestate}
.md.m add separator
}
.md.m add command -label "Stack trace" -command {bgerror Debug}
.md.m add separator
.md.m add command -label "Reread Source" -command {source $thisScript}
.md.m add separator
.md.m add command -label "Redraw Window" -command {makeDirDiffWin}
pack .mo .md -in .fm -side left
button .bc -text Compare -command doCompare
button .bu -text Up -command upDir
button .bu1 -text Up -command {upDir 1}
button .bu2 -text Up -command {upDir 2}
pack .bc .bu -in .fm -side right
|
>
>
|
|
|
|
|
|
|
<
<
|
|
|
>
|
<
|
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
|
-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 \
-label "Diff, ignore RCS"
pack .mo -in .fm -side left
if {$::debug} {
menubutton .md -text Debug -menu .md.m -relief ridge
menu .md.m
if {$::tcl_platform(platform) == "windows"} {
.md.m add checkbutton -label Console -variable consolestate \
-onvalue show -offvalue hide -command {console $consolestate}
.md.m add separator
}
.md.m add command -label "Reread Source" -command {source $thisScript}
.md.m add separator
.md.m add command -label "Redraw Window" -command {makeDirDiffWin}
pack .md -in .fm -side left
}
button .bc -text Compare -command doCompare
button .bu -text Up -command upDir
button .bu1 -text Up -command {upDir 1}
button .bu2 -text Up -command {upDir 2}
pack .bc .bu -in .fm -side right
|
︙ | | | ︙ | |