Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Added infrastructure for ancestor file |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
cc9aa5b84c5c81bf6d27a7ef1e28cd41 |
User & Date: | peter.spjuth@gmail.com 2011-04-25 14:28:33.000 |
Context
2011-04-25
| ||
15:58 | 3-way diff now handles basic cases. check-in: 674c783efa user: peter.spjuth@gmail.com tags: trunk | |
14:28 | Added infrastructure for ancestor file check-in: cc9aa5b84c user: peter.spjuth@gmail.com tags: trunk | |
2011-04-24
| ||
16:06 | Bug fix in last commit. check-in: 3b774c1269 user: peter.spjuth@gmail.com tags: trunk | |
Changes
Changes to src/eskil.tcl.
︙ | ︙ | |||
1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 | return } } else { set ::widgets($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)] set doingLine1 1 set doingLine2 1 | > > > > | 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 | return } } else { set ::widgets($top,eqLabel) " " } # Update the equal label immediately for better feedback update idletasks if {$::diff($top,ancestorFile) ne ""} { collectAncestorInfo $top $dFile1 $dFile2 $opts } set firstview 1 set ch1 [open $::diff($top,leftFile)] set ch2 [open $::diff($top,rightFile)] set doingLine1 1 set doingLine2 1 |
︙ | ︙ | |||
1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 | set ::widgets($top,eqLabel) " " } cleanupFiles $top if {$::diff($top,mode) eq "conflict"} { if {$::widgets($top,eqLabel) != "="} { makeMergeWin $top } } if {$::diff($top,printFile) ne ""} { after idle "doPrint $top 1 ; cleanupAndExit all" } } | > > > > | 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 | set ::widgets($top,eqLabel) " " } cleanupFiles $top if {$::diff($top,mode) eq "conflict"} { if {$::widgets($top,eqLabel) != "="} { makeMergeWin $top } } elseif {$::diff($top,ancestorFile) ne ""} { if {$::widgets($top,eqLabel) != "="} { makeMergeWin $top } } if {$::diff($top,printFile) ne ""} { after idle "doPrint $top 1 ; cleanupAndExit all" } } |
︙ | ︙ | |||
2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 | # Fill in default data for a diff window proc initDiffData {top} { set ::diff($top,leftOK) 0 set ::diff($top,rightOK) 0 set ::diff($top,mode) "" set ::diff($top,printFile) "" 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 {}}} { | > | 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 | # Fill in default data for a diff window proc initDiffData {top} { set ::diff($top,leftOK) 0 set ::diff($top,rightOK) 0 set ::diff($top,mode) "" set ::diff($top,printFile) "" set ::diff($top,mergeFile) "" set ::diff($top,ancestorFile) "" 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 {}}} { |
︙ | ︙ | |||
3468 3469 3470 3471 3472 3473 3474 | 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 -printHeaderSize -printCharsPerLine -printPaper -printColorChange -printColorOld -printColorNew | | | 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 | 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 -printHeaderSize -printCharsPerLine -printPaper -printColorChange -printColorOld -printColorNew -server -o -a -r -context -cvs -svn -review -foreach -preprocess -close -nonewline -plugin -plugininfo -plugindump -pluginlist } # 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] |
︙ | ︙ | |||
3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 | set plugindump "" set pluginlist 0 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 "printHeaderSize"} { if {![string is double -strict $arg] || $arg <= 0} { puts "Argument -printHeaderSize must be a positive number" exit } | > > | 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 | set plugindump "" set pluginlist 0 foreach arg $::eskil(argv) { if {$nextArg != ""} { if {$nextArg eq "mergeFile"} { set opts(mergeFile) [file join [pwd] $arg] } elseif {$nextArg eq "ancestorFile"} { set opts(ancestorFile) [file join [pwd] $arg] } elseif {$nextArg eq "printFile"} { set opts(printFile) [file join [pwd] $arg] } elseif {$nextArg eq "printHeaderSize"} { if {![string is double -strict $arg] || $arg <= 0} { puts "Argument -printHeaderSize must be a positive number" exit } |
︙ | ︙ | |||
3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 | } } else { package require Tk tk appname Eskil } } elseif {$arg eq "-o"} { set nextArg mergeFile } elseif {$arg eq "-r"} { set nextArg revision } elseif {$arg eq "-debug"} { set ::eskil(debug) 1 } elseif {$arg eq "-svn"} { set preferedRev "SVN" } elseif {$arg eq "-cvs"} { | > > | 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 | } } else { package require Tk tk appname Eskil } } elseif {$arg eq "-o"} { set nextArg mergeFile } elseif {$arg eq "-a"} { set nextArg ancestorFile } elseif {$arg eq "-r"} { set nextArg revision } elseif {$arg eq "-debug"} { set ::eskil(debug) 1 } elseif {$arg eq "-svn"} { set preferedRev "SVN" } elseif {$arg eq "-cvs"} { |
︙ | ︙ |
Changes to src/merge.tcl.
︙ | ︙ | |||
411 412 413 414 415 416 417 | grid $w.sbx x -sticky we grid columnconfigure $w 0 -weight 1 grid rowconfigure $w 1 -weight 1 collectMergeData $top fillMergeWindow $top } | > > > > > > > > > > > > > > > > > > | 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 | grid $w.sbx x -sticky we grid columnconfigure $w 0 -weight 1 grid rowconfigure $w 1 -weight 1 collectMergeData $top fillMergeWindow $top } # Compare each file agains an ancestor file for three-way merge proc collectAncestorInfo {top dFile1 dFile2 opts} { set differrA1 [catch {DiffUtil::diffFiles {*}$opts \ $::diff($top,ancestorFile) $dFile1} diffresA1] set differrA2 [catch {DiffUtil::diffFiles {*}$opts \ $::diff($top,ancestorFile) $dFile2} diffresA2] if {$differrA1 != 0 || $differrA2 != 0} { puts $diffresA1 puts $diffresA2 return } foreach i $diffresA1 { lassign $i line1 n1 line2 n2 } } |