Eskil

Check-in [20adbf74ea]
Login

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

Overview
Comment:Serialization of vfs
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 20adbf74ea668f4fbba9db63bce7685626e5c53db9dbdf5b6c3d4de322fbdb6e
User & Date: peter 2023-04-27 19:49:06.263
Context
2023-04-27
19:51
Support more conflict formats check-in: eefb28de35 user: peter tags: trunk
19:49
Serialization of vfs check-in: 20adbf74ea user: peter tags: trunk
2023-04-26
12:02
Added -printLineSpace. Corrected -printHeaderSize. check-in: 36ea024713 user: peter tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/vcsvfs.tcl.
13
14
15
16
17
18
19



















20
21
22
23
24
25
26
    variable DataRefChan
    variable mpoints {}
    namespace eval fossil {}
    namespace eval svn {}
    namespace eval git {}
    namespace eval hg {}
}




















# Create a Virtual File System showing a revision of a fossil checkout
#
# dir: Directory in a fossil checkout
# rev: Revision to mount
#
# Returns: path to the generated VFS







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







13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
    variable DataRefChan
    variable mpoints {}
    namespace eval fossil {}
    namespace eval svn {}
    namespace eval git {}
    namespace eval hg {}
}

# Create a command which when eval'd recreates known file systems
proc vcsvfs::serialize {} {
    variable ::vcsvfs::mpoints
    return [list vcsvfs::deserialize $mpoints]
}

# Pick up the command created by serialize
proc vcsvfs::deserialize {data} {
    variable ::vcsvfs::mpoints
    dict for {key value} $data {
        dict set mpoints $key $value
        # Handle if this is done again, do not mount it twice
        if {[string match *vcsvfs* [file system $key]]} {
            continue
        }
        vfs::filesystem mount $key [list vcsvfs::Vfs]
    }
}

# Create a Virtual File System showing a revision of a fossil checkout
#
# dir: Directory in a fossil checkout
# rev: Revision to mount
#
# Returns: path to the generated VFS