︙ | | | ︙ | |
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
source $::thisDir/clip.tcl
source $::thisDir/compare.tcl
source $::thisDir/map.tcl
source $::thisDir/merge.tcl
source $::thisDir/registry.tcl
source $::thisDir/dirdiff.tcl
source $::thisDir/help.tcl
source $::thisDir/printobj.tcl
source $::thisDir/print.tcl
source $::thisDir/rev.tcl
set ::util(diffexe) diff
# Diff functionality is in the DiffUtil package.
|
>
|
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
source $::thisDir/clip.tcl
source $::thisDir/compare.tcl
source $::thisDir/map.tcl
source $::thisDir/merge.tcl
source $::thisDir/registry.tcl
source $::thisDir/dirdiff.tcl
source $::thisDir/help.tcl
source $::thisDir/plugin.tcl
source $::thisDir/printobj.tcl
source $::thisDir/print.tcl
source $::thisDir/rev.tcl
set ::util(diffexe) diff
# Diff functionality is in the DiffUtil package.
|
︙ | | | ︙ | |
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
|
set ::diff($top,cleanup) ""
if {$::diff($top,mode) eq "rev"} {
prepareRev $top
set ::diff($top,cleanup) "rev"
} elseif {$::diff($top,mode) eq "conflict"} {
prepareConflict $top
set ::diff($top,cleanup) "conflict"
}
}
# Clean up after a diff
proc cleanupFiles {top} {
switch $::diff($top,cleanup) {
"rev" {cleanupRev $top}
"conflict" {cleanupConflict $top}
}
}
# Redo Diff command
proc redoDiff {top} {
# Note what rows are being displayed
set w $::widgets($top,wDiff1)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
|
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
|
set ::diff($top,cleanup) ""
if {$::diff($top,mode) eq "rev"} {
prepareRev $top
set ::diff($top,cleanup) "rev"
} elseif {$::diff($top,mode) eq "conflict"} {
prepareConflict $top
set ::diff($top,cleanup) "conflict"
} elseif {$::diff($top,plugin) ne ""} {
preparePlugin $top
set ::diff($top,cleanup) "plugin"
}
}
# Clean up after a diff
proc cleanupFiles {top} {
switch $::diff($top,cleanup) {
"rev" {cleanupRev $top}
"conflict" {cleanupConflict $top}
"plugin" {
if {[info exists ::diff($top,leftFileB)]} {
set ::diff($top,leftFile) $::diff($top,leftFileB)
}
if {[info exists ::diff($top,rightFileB)]} {
set ::diff($top,rightFile) $::diff($top,rightFileB)
}
unset -nocomplain ::diff($top,leftFileB) ::diff($top,rightFileB) \
::diff($top,leftFileD) ::diff($top,rightFileD)
}
}
}
# Redo Diff command
proc redoDiff {top} {
# Note what rows are being displayed
set w $::widgets($top,wDiff1)
|
︙ | | | ︙ | |
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
|
lappend opts -range $range
}
if {[llength $Pref(regsub)] > 0} {
lappend opts -regsub $Pref(regsub)
}
# Apply nodigit after preprocess
if {$Pref(nodigit)} {lappend opts -nodigit}
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 "conflict" && $::diff($top,modetype) eq "Pure"} {
set diffres $::diff($top,conflictDiff)
}
|
>
>
>
>
>
>
>
>
>
>
>
|
|
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
|
lappend opts -range $range
}
if {[llength $Pref(regsub)] > 0} {
lappend opts -regsub $Pref(regsub)
}
# Apply nodigit after preprocess
if {$Pref(nodigit)} {lappend opts -nodigit}
if {[info exists ::diff($top,leftFileD)]} {
set dFile1 $::diff($top,leftFileD)
} else {
set dFile1 $::diff($top,leftFile)
}
if {[info exists ::diff($top,rightFileD)]} {
set dFile2 $::diff($top,rightFileD)
} else {
set dFile2 $::diff($top,rightFile)
}
set differr [catch {eval DiffUtil::diffFiles $opts \
\$dFile1 \$dFile2} 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 "conflict" && $::diff($top,modetype) eq "Pure"} {
set diffres $::diff($top,conflictDiff)
}
|
︙ | | | ︙ | |
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
|
set ::diff($top,rightOK) 0
set ::diff($top,mode) ""
set ::diff($top,printFile) ""
set ::diff($top,printMode) "PDF"
set ::diff($top,mergeFile) ""
set ::diff($top,conflictFile) ""
set ::diff($top,limitlines) 0
}
# Create a new diff window and diff two files
proc newDiff {file1 file2 {range {}}} {
set top [makeDiffWin]
update
|
>
|
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
|
set ::diff($top,rightOK) 0
set ::diff($top,mode) ""
set ::diff($top,printFile) ""
set ::diff($top,printMode) "PDF"
set ::diff($top,mergeFile) ""
set ::diff($top,conflictFile) ""
set ::diff($top,limitlines) 0
set ::diff($top,plugin) ""
}
# Create a new diff window and diff two files
proc newDiff {file1 file2 {range {}}} {
set top [makeDiffWin]
update
|
︙ | | | ︙ | |
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
|
}
set allOpts {
-w --help -help -b -noignore -i -nocase -nodigit -nokeyword -prefix
-noparse -line -smallblock -block -char -word -limit -nodiff -dir
-clip -patch -browse -conflict -print -printps -printpdf
-server -o -r -context -cvs -svn -review
-foreach -preprocess -close -nonewline
}
# If the first option is "--query", use it to ask about options.
if {$::eskil(argc) == 2 && [lindex $::eskil(argv) 0] == "--query"} {
set arg [lindex $::eskil(argv) 1]
if {[lsearch -exact $allOpts $arg] < 0} {
set match [lsearch -glob -all -inline $allOpts $arg*]
|
|
|
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
|
}
set allOpts {
-w --help -help -b -noignore -i -nocase -nodigit -nokeyword -prefix
-noparse -line -smallblock -block -char -word -limit -nodiff -dir
-clip -patch -browse -conflict -print -printps -printpdf
-server -o -r -context -cvs -svn -review
-foreach -preprocess -close -nonewline -plugin -plugininfo
}
# If the first option is "--query", use it to ask about options.
if {$::eskil(argc) == 2 && [lindex $::eskil(argv) 0] == "--query"} {
set arg [lindex $::eskil(argv) 1]
if {[lsearch -exact $allOpts $arg] < 0} {
set match [lsearch -glob -all -inline $allOpts $arg*]
|
︙ | | | ︙ | |
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
|
set files ""
set nextArg ""
set revNo 1
set dopatch 0
set doreview 0
set foreach 0
set preferedRev "GIT"
foreach arg $::eskil(argv) {
if {$nextArg != ""} {
if {$nextArg eq "mergeFile"} {
set opts(mergeFile) [file join [pwd] $arg]
} elseif {$nextArg eq "printFile"} {
set opts(printFile) [file join [pwd] $arg]
} elseif {$nextArg eq "revision"} {
set opts(doptrev$revNo) $arg
incr revNo
} elseif {$nextArg eq "limitlines"} {
set opts(limitlines) $arg
} elseif {$nextArg eq "context"} {
set Pref(context) $arg
} elseif {$nextArg eq "prefix"} {
set RE [string map [list % $arg] {^.*?\m(%\w+).*$}]
if {$Pref(nocase)} {
set RE "(?i)$RE"
}
lappend ::Pref(regsub) $RE {\1}
} elseif {$nextArg eq "preprocess"} {
if {[catch {llength $arg} len]} {
} elseif {[llength $arg] % 2 == 1} {
} else {
# FIXA: better validity check
|
>
>
>
>
>
>
|
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
|
set files ""
set nextArg ""
set revNo 1
set dopatch 0
set doreview 0
set foreach 0
set preferedRev "GIT"
set plugin ""
set plugininfo ""
foreach arg $::eskil(argv) {
if {$nextArg != ""} {
if {$nextArg eq "mergeFile"} {
set opts(mergeFile) [file join [pwd] $arg]
} elseif {$nextArg eq "printFile"} {
set opts(printFile) [file join [pwd] $arg]
} elseif {$nextArg eq "revision"} {
set opts(doptrev$revNo) $arg
incr revNo
} elseif {$nextArg eq "limitlines"} {
set opts(limitlines) $arg
} elseif {$nextArg eq "context"} {
set Pref(context) $arg
} elseif {$nextArg eq "prefix"} {
set RE [string map [list % $arg] {^.*?\m(%\w+).*$}]
if {$Pref(nocase)} {
set RE "(?i)$RE"
}
lappend ::Pref(regsub) $RE {\1}
} elseif {$nextArg eq "plugin"} {
set plugin $arg
} elseif {$nextArg eq "plugininfo"} {
set plugininfo $arg
} elseif {$nextArg eq "preprocess"} {
if {[catch {llength $arg} len]} {
} elseif {[llength $arg] % 2 == 1} {
} else {
# FIXA: better validity check
|
︙ | | | ︙ | |
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
|
set Pref(nodigit) 1
} elseif {$arg eq "-nokeyword"} {
set Pref(dir,ignorekey) 1
} elseif {$arg eq "-prefix"} {
set nextArg prefix
} elseif {$arg eq "-preprocess"} {
set nextArg preprocess
} elseif {$arg eq "-context"} {
set nextArg context
} elseif {$arg eq "-noparse"} {
set Pref(parse) 0
} elseif {$arg eq "-line"} {
set Pref(parse) 1
} elseif {$arg eq "-smallblock"} {
|
>
>
>
>
|
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
|
set Pref(nodigit) 1
} elseif {$arg eq "-nokeyword"} {
set Pref(dir,ignorekey) 1
} elseif {$arg eq "-prefix"} {
set nextArg prefix
} elseif {$arg eq "-preprocess"} {
set nextArg preprocess
} elseif {$arg eq "-plugin"} {
set nextArg plugin
} elseif {$arg eq "-plugininfo"} {
set nextArg plugininfo
} elseif {$arg eq "-context"} {
set nextArg context
} elseif {$arg eq "-noparse"} {
set Pref(parse) 0
} elseif {$arg eq "-line"} {
set Pref(parse) 1
} elseif {$arg eq "-smallblock"} {
|
︙ | | | ︙ | |
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
|
} else {
lappend files $apa
}
}
}
Init
# Do we start in clip diff mode?
if {$doclip} {
makeClipDiffWin
return
}
|
>
>
>
>
>
>
>
>
>
|
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
|
} else {
lappend files $apa
}
}
}
Init
if {$plugin ne ""} {
set pinterp [createPluginInterp $plugin $plugininfo]
if {$pinterp eq ""} {
puts "Bad plugin: $plugin"
exit
}
set opts(plugin) $pinterp
}
# Do we start in clip diff mode?
if {$doclip} {
makeClipDiffWin
return
}
|
︙ | | | ︙ | |