Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rest-fs-openacs
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-rest-fs-openacs
Commits
0f1dc5cc
Commit
0f1dc5cc
authored
Jan 21, 2019
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed SHA1 calculation for files who didn't get it from the client
parent
8b2df8e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
file-tree.json.tcl
www/file-tree.json.tcl
+13
-0
No files found.
www/file-tree.json.tcl
View file @
0f1dc5cc
...
...
@@ -110,6 +110,19 @@ db_foreach files $sql {
if
{
""
eq
$version
_type_id
}
{
set version_type_id
[
im_file_type_default
]
}
if
{
""
eq
$revision
_id
}
{
set revision_id 0
}
if
{
""
eq
$content
_length
}
{
set content_length 0
}
if
{
""
eq
$version
_sha1 && 0 ne
$revision
_id
}
{
# needed to calculate sha1 for an
"old"
file
set storage_area_key
"CR_FILES"
set storage_area_path
[
cr_fs_path
$storage
_area_key
]
ns_log Debug
"file-tree.json.tcl: storage_area_key(
$storage
_area_key) storage_area_path(
$storage
_area_path)"
set filename
[
db_string filename
"select :storage_area_path || content from cr_revisions where revision_id = :revision_id"
]
ns_log Notice
"file-tree.json: Calculating sha1 for file=
$filename
"
set version_sha1
[
string
range
[
exec
/usr/bin/sha1sum
"
$filename
"
]
0 39
]
ns_log Notice
"file-tree.json: Calculating sha1 for file=
$filename:
$version
_sha1"
}
set version_list
[
list
]
if
{[
info
exists version_hash
(
$file
_id
)]}
{
set version_list
$version
_hash
(
$file
_id
)
}
lappend version_list
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment