Fossil SCM
Bugfix for 3852590ce6. Make the use of cache files in the rcs parser actually dependent on the user option.
Commit
f6f5c902e60fdbf223c96ef7424d1fff548941d3
Parent
72dac950c36d76f…
1 file changed
+11
-5
+11
-5
| --- tools/lib/rcsparser.tcl | ||
| +++ tools/lib/rcsparser.tcl | ||
| @@ -59,25 +59,31 @@ | ||
| 59 | 59 | } |
| 60 | 60 | return |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | proc ::vc::rcs::parser::process {path} { |
| 64 | - set cache [Cache $path] | |
| 64 | + variable cache | |
| 65 | + | |
| 66 | + if {!$cache} { | |
| 67 | + return [Process $path] | |
| 68 | + } | |
| 69 | + | |
| 70 | + set cachefile [Cache $path] | |
| 65 | 71 | if { |
| 66 | - [file exists $cache] && | |
| 67 | - ([file mtime $cache] > [file mtime $path]) | |
| 72 | + [file exists $cachefile] && | |
| 73 | + ([file mtime $cachefile] > [file mtime $path]) | |
| 68 | 74 | } { |
| 69 | 75 | # Use preparsed data if not invalidated by changes to the |
| 70 | 76 | # archive they are derived from. |
| 71 | 77 | write 4 rcs {Load preparsed data block} |
| 72 | - return [fileutil::cat -encoding binary $cache] | |
| 78 | + return [fileutil::cat -encoding binary $cachefile] | |
| 73 | 79 | } |
| 74 | 80 | |
| 75 | 81 | set res [Process $path] |
| 76 | 82 | |
| 77 | 83 | # Save parse result for quick pickup by future runs. |
| 78 | - fileutil::writeFile $cache $res | |
| 84 | + fileutil::writeFile $cachefile $res | |
| 79 | 85 | |
| 80 | 86 | return $res |
| 81 | 87 | } |
| 82 | 88 | |
| 83 | 89 | # ----------------------------------------------------------------------------- |
| 84 | 90 |
| --- tools/lib/rcsparser.tcl | |
| +++ tools/lib/rcsparser.tcl | |
| @@ -59,25 +59,31 @@ | |
| 59 | } |
| 60 | return |
| 61 | } |
| 62 | |
| 63 | proc ::vc::rcs::parser::process {path} { |
| 64 | set cache [Cache $path] |
| 65 | if { |
| 66 | [file exists $cache] && |
| 67 | ([file mtime $cache] > [file mtime $path]) |
| 68 | } { |
| 69 | # Use preparsed data if not invalidated by changes to the |
| 70 | # archive they are derived from. |
| 71 | write 4 rcs {Load preparsed data block} |
| 72 | return [fileutil::cat -encoding binary $cache] |
| 73 | } |
| 74 | |
| 75 | set res [Process $path] |
| 76 | |
| 77 | # Save parse result for quick pickup by future runs. |
| 78 | fileutil::writeFile $cache $res |
| 79 | |
| 80 | return $res |
| 81 | } |
| 82 | |
| 83 | # ----------------------------------------------------------------------------- |
| 84 |
| --- tools/lib/rcsparser.tcl | |
| +++ tools/lib/rcsparser.tcl | |
| @@ -59,25 +59,31 @@ | |
| 59 | } |
| 60 | return |
| 61 | } |
| 62 | |
| 63 | proc ::vc::rcs::parser::process {path} { |
| 64 | variable cache |
| 65 | |
| 66 | if {!$cache} { |
| 67 | return [Process $path] |
| 68 | } |
| 69 | |
| 70 | set cachefile [Cache $path] |
| 71 | if { |
| 72 | [file exists $cachefile] && |
| 73 | ([file mtime $cachefile] > [file mtime $path]) |
| 74 | } { |
| 75 | # Use preparsed data if not invalidated by changes to the |
| 76 | # archive they are derived from. |
| 77 | write 4 rcs {Load preparsed data block} |
| 78 | return [fileutil::cat -encoding binary $cachefile] |
| 79 | } |
| 80 | |
| 81 | set res [Process $path] |
| 82 | |
| 83 | # Save parse result for quick pickup by future runs. |
| 84 | fileutil::writeFile $cachefile $res |
| 85 | |
| 86 | return $res |
| 87 | } |
| 88 | |
| 89 | # ----------------------------------------------------------------------------- |
| 90 |