Eskil

Changes On Branch thread
Login

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

Changes In Branch thread Excluding Merge-Ins

This is equivalent to a diff from c9e28d0c53 to a36a8fc470

2016-08-14
23:07
Bumped revision to 2.7.2 check-in: e2431aa5ca user: peter tags: trunk
2016-08-06
18:59
Handle vfs in threads Leaf check-in: a36a8fc470 user: peter tags: thread
2016-08-03
17:45
Merge from trunk check-in: d1d44e3aed user: peter tags: thread
2016-07-29
22:03
Include plugin options in plugin dialog. check-in: c9e28d0c53 user: peter tags: trunk
20:14
Restructured plugin dialog. check-in: a8c940bcc5 user: peter tags: trunk

Changes to src/dirdiff.tcl.

1362
1363
1364
1365
1366
1367
1368






1369
1370
1371
1372
1373
1374
1375
            }
            set ::dirdiff(leftDir) $d1
            if {$rev2 ne ""} {
                .dirdiffX.l2 configure -text "and rev $rev2..."
                update
                set d2 [eskil::rev::${type}::mount $fullname $rev2]
                set ::dirdiff(rightDir) $d2






            }
            destroy .dirdiffX
        }
    }

    destroy .dirdiff
    DirDiff .dirdiff







>
>
>
>
>
>







1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
            }
            set ::dirdiff(leftDir) $d1
            if {$rev2 ne ""} {
                .dirdiffX.l2 configure -text "and rev $rev2..."
                update
                set d2 [eskil::rev::${type}::mount $fullname $rev2]
                set ::dirdiff(rightDir) $d2
            }
            # VcsVfs mounts are thread local. Transfer them to any worker thread
            foreach tid $::eskil(threads) {
                .dirdiffX.l2 configure -text "and rev $rev2... (+thread)"
                update
                vcsvfs::transfer $tid
            }
            destroy .dirdiffX
        }
    }

    destroy .dirdiff
    DirDiff .dirdiff

Changes to src/eskil.syntax.

39
40
41
42
43
44
45







46
47
48
49
50
51
52
##nagelfar subcmd vfs::filesystem mount posixerror
##nagelfar syntax vfs::filesystem\ mount x x
##nagelfar syntax vfs::filesystem\ posixerror x
##nagelfar syntax vfs::matchDirectories x
##nagelfar syntax vfs::matchFiles x
##nagelfar syntax vfs::accessMode x
##nagelfar package known vfs








##nagelfar syntax pdf4tcl::getPaperSize x
##nagelfar syntax pdf4tcl::getPaperSizeList
##nagelfar syntax pdf4tcl::loadBaseType1Font 3
##nagelfar syntax pdf4tcl::loadBaseTrueTypeFont r 2 3
##nagelfar syntax pdf4tcl::createFont 3
##nagelfar package known pdf4tcl







>
>
>
>
>
>
>







39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
##nagelfar subcmd vfs::filesystem mount posixerror
##nagelfar syntax vfs::filesystem\ mount x x
##nagelfar syntax vfs::filesystem\ posixerror x
##nagelfar syntax vfs::matchDirectories x
##nagelfar syntax vfs::matchFiles x
##nagelfar syntax vfs::accessMode x
##nagelfar package known vfs

##nagelfar syntax thread::create o*
##nagelfar syntax thread::send x x*
##nagelfar package known Thread

##nagelfar syntax starkit::startup 0
##nagelfar package known starkit

##nagelfar syntax pdf4tcl::getPaperSize x
##nagelfar syntax pdf4tcl::getPaperSizeList
##nagelfar syntax pdf4tcl::loadBaseType1Font 3
##nagelfar syntax pdf4tcl::loadBaseTrueTypeFont r 2 3
##nagelfar syntax pdf4tcl::createFont 3
##nagelfar package known pdf4tcl

Changes to src/eskil.tcl.

1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
    }
    if {[info exists ::eskil($top,rightFileDiff)]} {
        set dFile2 $::eskil($top,rightFileDiff)
    } else {
        set dFile2 $::eskil($top,rightFile)
    }

    set differr [catch {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 {$::eskil($top,mode) eq "conflict" && $::eskil($top,modetype) eq "Pure"} {
        set diffres $::eskil($top,conflictDiff)
    }







|
|







1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
    }
    if {[info exists ::eskil($top,rightFileDiff)]} {
        set dFile2 $::eskil($top,rightFileDiff)
    } else {
        set dFile2 $::eskil($top,rightFile)
    }

    set cmd [list DiffUtil::diffFiles {*}$opts $dFile1 $dFile2]
    set differr [catch {SubEval $cmd} 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 {$::eskil($top,mode) eq "conflict" && $::eskil($top,modetype) eq "Pure"} {
        set diffres $::eskil($top,conflictDiff)
    }
2943
2944
2945
2946
2947
2948
2949

2950
2951
2952
2953
2954
2955
2956
        AddDebugMenu $top
    }
}

# Runtime disable of C version of DiffUtil
proc DisableDiffUtilC {} {
    uplevel \#0 [list source $::eskil(thisDir)/../lib/diffutil/tcl/diffutil.tcl]

}

# Add a debug menu to a toplevel window
proc AddDebugMenu {top} {
    set dMenu [DebugMenu $top.m]
    $dMenu add checkbutton -label "Wrap" -variable wrapstate \
        -onvalue char -offvalue none -command \







>







2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
        AddDebugMenu $top
    }
}

# Runtime disable of C version of DiffUtil
proc DisableDiffUtilC {} {
    uplevel \#0 [list source $::eskil(thisDir)/../lib/diffutil/tcl/diffutil.tcl]
    SubEval [list source $::eskil(thisDir)/../lib/diffutil/tcl/diffutil.tcl]
}

# Add a debug menu to a toplevel window
proc AddDebugMenu {top} {
    set dMenu [DebugMenu $top.m]
    $dMenu add checkbutton -label "Wrap" -variable wrapstate \
        -onvalue char -offvalue none -command \

Changes to src/help.tcl.

54
55
56
57
58
59
60




61
62
63
64
65
66
67
    $w.t insert end "E-Mail: peter.spjuth@gmail.com\n"
    $w.t insert end "\nURL: http://eskil.tcl.tk\n"
    $w.t insert end "\nTcl version: [info patchlevel]\n"

    set du $::DiffUtil::version
    append du " ($::DiffUtil::implementation)"
    $w.t insert end "DiffUtil version: $du\n"





    # Provide debug info to help when DiffUtil does not load.
    if {[info exists ::DiffUtil::DebugLibFile]} {
        set lf $::DiffUtil::DebugLibFile
        set exist [file exists $lf]
        set lf [file join {*}[lrange [file split $lf] end-1 end]]
        if {$exist} {







>
>
>
>







54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
    $w.t insert end "E-Mail: peter.spjuth@gmail.com\n"
    $w.t insert end "\nURL: http://eskil.tcl.tk\n"
    $w.t insert end "\nTcl version: [info patchlevel]\n"

    set du $::DiffUtil::version
    append du " ($::DiffUtil::implementation)"
    $w.t insert end "DiffUtil version: $du\n"
 
    set du [SubEval {set ::DiffUtil::version}]
    append du " ([SubEval {set ::DiffUtil::implementation}])"
    $w.t insert end "(sub) DiffUtil version: $du\n"

    # Provide debug info to help when DiffUtil does not load.
    if {[info exists ::DiffUtil::DebugLibFile]} {
        set lf $::DiffUtil::DebugLibFile
        set exist [file exists $lf]
        set lf [file join {*}[lrange [file split $lf] end-1 end]]
        if {$exist} {

Changes to src/rev.tcl.

1225
1226
1227
1228
1229
1230
1231








1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
    }
    set gitmsg [string trim $gitmsg]
    if {$sts} {
        tk_messageBox -icon error -title "GIT revert error" -message $gitmsg \
                -parent $top
    }
}









# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::FOSSIL::mount {dir rev} {
    return [vcsvfs::fossil::mount $dir $rev]
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::SVN::mount {dir rev} {
    return [vcsvfs::svn::mount $dir $rev]
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::HG::mount {dir rev} {
    return [vcsvfs::hg::mount $dir $rev]
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::GIT::mount {dir rev} {
    return [vcsvfs::git::mount $dir $rev]
}

# View log between displayed versions
proc eskil::rev::CVS::viewLog {top filename revs} {
    set cmd [list exec cvs -q log -N]
    if {[llength $revs] > 1} {
        lappend cmd -r[join $revs ":"]







>
>
>
>
>
>
>
>



|




|




|




|







1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
    }
    set gitmsg [string trim $gitmsg]
    if {$sts} {
        tk_messageBox -icon error -title "GIT revert error" -message $gitmsg \
                -parent $top
    }
}

# Common helper function to handle the mount command
proc eskil::rev::mount {args} {
    set res [{*}$args]
    # Also mount it in the sub interpreter, unless it is already there
    SubEval [list if "!\[[list file isdir $res]\]" $args]
    return $res
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::FOSSIL::mount {dir rev} {
    return [eskil::rev::mount vcsvfs::fossil::mount $dir $rev]
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::SVN::mount {dir rev} {
    return [eskil::rev::mount vcsvfs::svn::mount $dir $rev]
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::HG::mount {dir rev} {
    return [eskil::rev::mount vcsvfs::hg::mount $dir $rev]
}

# Mount a directory revision as a VFS, and return the mount point
proc eskil::rev::GIT::mount {dir rev} {
    return [eskil::rev::mount vcsvfs::git::mount $dir $rev]
}

# View log between displayed versions
proc eskil::rev::CVS::viewLog {top filename revs} {
    set cmd [list exec cvs -q log -N]
    if {[llength $revs] > 1} {
        lappend cmd -r[join $revs ":"]

Changes to src/startup.tcl.

77
78
79
80
81
82
83
























84
85
86
87
88
89

90
91

92
93
94
95
96
97
98
    }

    if {[file exists $::eskil(thisDir)/../version.txt]} {
        set ch [open $::eskil(thisDir)/../version.txt]
        set ::eskil(diffver) [string trim [read $ch 100]]
        close $ch
    }

























    # Get all other source files
    InitReSource

    # Diff functionality is in the DiffUtil package.
    package require DiffUtil

    # Help DiffUtil to find a diff executable, if needed
    catch {DiffUtil::LocateDiffExe $::eskil(thisScript)}


    # Create font for PDF
    if {$::Pref(printFont) eq ""} {
        set fontfile $::eskil(thisDir)/embedfont.ttf
    } else {
        set fontfile $::Pref(printFont)
    }







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






>


>







77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
    }

    if {[file exists $::eskil(thisDir)/../version.txt]} {
        set ch [open $::eskil(thisDir)/../version.txt]
        set ::eskil(diffver) [string trim [read $ch 100]]
        close $ch
    }

    ##nagelfar syntax SubEval c
    set ::eskil(threads) {}
    if {[catch {package require Thread}]} {
        interp create _tinterp_
        interp alias {} SubEval _tinterp_ eval
    } else {
        set tid [thread::create -preserved]
        interp alias {} SubEval {} thread::send $tid
        lappend ::eskil(threads) $tid
    }
    SubEval [list set ::auto_path $::auto_path]
    SubEval [list set ::argv0 $::argv0]
    SubEval [list namespace eval ::starkit {}]
    SubEval [list set ::starkit::topdir $::starkit::topdir]
    SubEval {
        if {![file isdir $::starkit::topdir]} {
            vfs::mk4::Mount $::starkit::topdir $::starkit::topdir
        }
    }
    SubEval [list array set ::eskil [array get ::eskil]]
    SubEval [list proc InitReSource {} [info body InitReSource]]
    SubEval {package require snit}
    SubEval {InitReSource}

    # Get all other source files
    InitReSource

    # Diff functionality is in the DiffUtil package.
    package require DiffUtil
    SubEval {package require DiffUtil}
    # Help DiffUtil to find a diff executable, if needed
    catch {DiffUtil::LocateDiffExe $::eskil(thisScript)}
    SubEval [list catch [list DiffUtil::LocateDiffExe $::eskil(thisScript)]]

    # Create font for PDF
    if {$::Pref(printFont) eq ""} {
        set fontfile $::eskil(thisDir)/embedfont.ttf
    } else {
        set fontfile $::Pref(printFont)
    }

Changes to src/vcsvfs.tcl.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#----------------------------------------------------------------------
#  Virtual File System for Version Control Systems
#
#  Copyright (c) 2014-2015, Peter Spjuth
#
#  License for vcsvfs package: Same as for Tcl
#----------------------------------------------------------------------

package require vfs
package provide vcsvfs 0.2

namespace eval vcsvfs {
    variable DataRefChan
    variable mpoints {}
    namespace eval fossil {}
    namespace eval svn {}
    namespace eval git {}



|





|







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#----------------------------------------------------------------------
#  Virtual File System for Version Control Systems
#
#  Copyright (c) 2014-2016, Peter Spjuth
#
#  License for vcsvfs package: Same as for Tcl
#----------------------------------------------------------------------

package require vfs
package provide vcsvfs 0.3

namespace eval vcsvfs {
    variable DataRefChan
    variable mpoints {}
    namespace eval fossil {}
    namespace eval svn {}
    namespace eval git {}
747
748
749
750
751
752
753
































754
755
756
757
758
759
760
        createdirectory - deletefile - removedirectory - utime {
            # Read-only, always error
        }
    }
    vfs::filesystem posixerror $::vfs::posix(EACCES)
    return -code error $::vfs::posix(EACCES)
}

































##################################################################
# Test structure
##################################################################
if 0 {
# File traversing stuff from wiki...
proc ftw_1 {{dirs .}} {







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







747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
        createdirectory - deletefile - removedirectory - utime {
            # Read-only, always error
        }
    }
    vfs::filesystem posixerror $::vfs::posix(EACCES)
    return -code error $::vfs::posix(EACCES)
}

# Transfer VcsVfs mount point(s) to another Thread.
# TclVfs (which VcsVfs is based on) mounts are thread local
#
# threadId:   Thread id as created by Thread package
# mountpoint: Mount point to transfer.
#             If no mount point is given, tranfer all current mount points
#
# Returns: None
proc vcsvfs::transfer {threadId {mountpoint {}}} {
    variable mpoints
    thread::send -async $threadId "package require vcsvfs"
    if {$mountpoint eq ""} {
        set data $mpoints
    } else {
        set data [dict create $mountpoint [dict get $mpoints $mountpoint]]
    }
    # Data might be large. Is that a problem? Is there a more efficient way?
    thread::send -async $threadId [list vcsvfs::Receive $data]
}

# Create mount(s) from received data
proc vcsvfs::Receive {data} {
    variable mpoints
    foreach mountpoint [dict keys $data] {
        # Avoid duplicates
        if {![dict exists $mpoints $mountpoint]} {
            dict set mpoints $mountpoint [dict get $data $mountpoint]
            vfs::filesystem mount $mountpoint [list vcsvfs::Vfs]
        }
    }
}

##################################################################
# Test structure
##################################################################
if 0 {
# File traversing stuff from wiki...
proc ftw_1 {{dirs .}} {