+2006-12-10 Steve Huntley <stephen.huntley@alum.mit.edu>
+
+ * library/template/versionvfs.tcl: when time attribute is set,
+ files created after set time are made invisible.
+
2006-11-14 Jean-Claude Wippler <jcw@equi4.com>
* library/mkclvfs.tcl: removed, now part of the vlerq extension again
Written by Stephen Huntley (stephen.huntley@alum.mit.edu)
License: Tcl license
-Version 1.02
+Version 1.03
A versioning virtual filesystem. Requires the template vfs in templatevfs.tcl.
set latest [lindex [lindex [lsort [set allVersions [VersionsAll $path $relative]]] end] 0]
set acquired [lindex [split [set fileName [VAcquireFile $path $root $relative]] \;] 1]
if ![string first .&dir [file tail $fileName]] {::vfs::filesystem posixerror $::vfs::posix(ENOENT)}
-
# process vfs-specific attributes:
if {($relative == {}) && ([string map {-keep 1 -project 1 -time 1} $attribute] == 1)} {
set attribute [string range $attribute 1 end]
if {$args == {}} {return [file tail $fileName]}
error "cannot set attribute \"-version_filename\" for file \"[file tail $relative]\": attribute is readonly"
}
-
# check if current version is latest, if not disallow edit:
if {($args != {}) && ($acquired != {}) && ($latest != $acquired)} {::vfs::filesystem posixerror $::vfs::posix(EPERM)}
set returnValue [eval file attributes \$fileName $attribute $args]
-
# collect values for vfs-specific attributes:
if {$attribute == {}} {
append returnValue " [list -versions $allVersions]"
set projectLength [llength $tags]
if {($projectLength > 1) && !$projectMember} {return [file join $path $relative]}
}
+
+# if time tag value is before creation date of chosen version, make file invisible:
+ if {[info exists ::vfs::template::version::time($root)] && ([lindex [split $fileName \;] 1] > "$::vfs::template::version::time($root)000")} {
+ return [file join $path $relative]
+ }
+
if ![string first .&dir [file tail $relative]] {
set fileName [file join $path [file dirname $relative]]
return [file normalize $fileName]