Eskil

Check-in [80ef88b0fc]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixed ClearCase support a bit. Release 2.0.2.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 80ef88b0fc60d56e79a8c835b9f205306fdefaa5
User & Date: peter 2004-05-03 16:27:48.000
Context
2004-05-03
16:31
Release 2.0.2. check-in: 18e750e27a user: peter tags: trunk
16:27
Fixed ClearCase support a bit. Release 2.0.2. check-in: 80ef88b0fc user: peter tags: trunk
2004-05-02
13:54
Started on Makefile. check-in: d82acf76ed user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/eskil.tcl.
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72

73
74
75
76
77
78
79
package require Tk 8.4
catch {package require textSearch}

package require pstools
namespace import -force pstools::*

if {[catch {package require psballoon}]} {
    # Add a dummy if it does not exists.
    proc addBalloon {args} {}
} else {
    namespace import -force psballoon::addBalloon
}

set debug 0
set diffver "Version 2.0.1+ 2004-03-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]
    set tmplink [file normalize [file join $thisDir $tmplink]]
    set thisDir [file dirname $tmplink]
}
unset tmplink

set ::util(cvsExists) [expr {![string equal [auto_execok cvs] ""]}]
set ::util(diffexe) diff
set ::util(diffWrapped) 0

# Experimenting with DiffUtil package
#set ::util(diffutil) [expr {![catch {package require DiffUtil}]}]

set ::util(diffutil) 0

# Figure out a place to store temporary files.
locateTmp ::diff(tmpdir)

# Locate a diff executable on windows.
proc locateDiffExe {} {







|






|


















>







40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
package require Tk 8.4
catch {package require textSearch}

package require pstools
namespace import -force pstools::*

if {[catch {package require psballoon}]} {
    # 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.2 2004-05-03"
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]
    set tmplink [file normalize [file join $thisDir $tmplink]]
    set thisDir [file dirname $tmplink]
}
unset tmplink

set ::util(cvsExists) [expr {![string equal [auto_execok cvs] ""]}]
set ::util(diffexe) diff
set ::util(diffWrapped) 0

# Experimenting with DiffUtil package
#set ::util(diffutil) [expr {![catch {package require DiffUtil}]}]
#puts "DiffUtil: $::util(diffutil)"
set ::util(diffutil) 0

# Figure out a place to store temporary files.
locateTmp ::diff(tmpdir)

# Locate a diff executable on windows.
proc locateDiffExe {} {
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485







1486
1487
1488
1489
1490
1491
1492
1493

    # Compare local file with latest version.
    set diff($top,leftFile) [tmpFile]
    set diff($top,rightLabel) $diff($top,RCSFile)
    set diff($top,rightFile) $diff($top,RCSFile)

    set diff($top,leftLabel) "$diff($top,RCSFile) (CT)"
    if {[catch {exec cleartool pwv -s} view] || $view eq "** NONE **"} {
        puts "MIFFFO"
        return
    }








    if {[catch {exec cleartool get -to $diff($top,leftFile) [file nativename $diff($top,RCSFile)@@/main/$view/LATEST]} msg]} {
        puts "Cleartool error: $msg"
        return
    }
}

# Prepare for a diff by creating needed temporary files
proc prepareFiles {top} {







|
|



>
>
>
>
>
>
>
|







1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501

    # Compare local file with latest version.
    set diff($top,leftFile) [tmpFile]
    set diff($top,rightLabel) $diff($top,RCSFile)
    set diff($top,rightFile) $diff($top,RCSFile)

    set diff($top,leftLabel) "$diff($top,RCSFile) (CT)"
    if {[catch {exec cleartool ls $diff($top,RCSFile)} info]} {
        puts "Cleartool error: $info"
        return
    }

    set prevV {}
    if {![regexp {@@(\S+)\s+from (\S+)\s+Rule} $info -> thisV prevV]} {
        regexp {@@(\S+)} $info -> thisV
        # Maybe do something fancy here?
        set prevV $thisV
    }

    if {[catch {exec cleartool get -to $diff($top,leftFile) [file nativename $diff($top,RCSFile)@@$prevV]} msg]} {
        puts "Cleartool error: $msg"
        return
    }
}

# Prepare for a diff by creating needed temporary files
proc prepareFiles {top} {
1522
1523
1524
1525
1526
1527
1528






















1529
1530
1531
1532
1533
1534
1535
        "virtual" {
            clearTmp $::diff($top,rightFile) $::diff($top,leftFile)
            set ::diff($top,leftFile)  $::diff($top,leftLabel)
            set ::diff($top,rightFile) $::diff($top,rightLabel)
        }
    }
}























# Main diff function.
proc doDiff {top} {
    global diff Pref
    global doingLine1 doingLine2

    if {$diff($top,mode) eq "" && ($diff($top,leftOK) == 0 || $diff($top,rightOK) == 0)} {







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
        "virtual" {
            clearTmp $::diff($top,rightFile) $::diff($top,leftFile)
            set ::diff($top,leftFile)  $::diff($top,leftLabel)
            set ::diff($top,rightFile) $::diff($top,rightLabel)
        }
    }
}

# FIXA: Working on adapting to DiffUtil.
proc RunDiff {top} {
    global diff Pref

    # Run diff and parse the result.
    if {$::util(diffutil)} {
        set differr [catch {eval DiffUtil::diffFiles $Pref(ignore) \
                \$diff($top,leftFile) \$diff($top,rightFile)} diffres]
    } else {
        set differr [catch {eval exec \$::util(diffexe) \
                $diff($top,dopt) $Pref(ignore) \
                \$diff($top,leftFile) \$diff($top,rightFile)} diffres]
        set apa [split $diffres "\n"]
        set result {}
        foreach i $apa {
            if {[string match {[0-9]*} $i]} {
                lappend result $i
            }
        }
    }
}

# Main diff function.
proc doDiff {top} {
    global diff Pref
    global doingLine1 doingLine2

    if {$diff($top,mode) eq "" && ($diff($top,leftOK) == 0 || $diff($top,rightOK) == 0)} {