Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
The reconstruct
command does (or, did) not work correctly
for repositories containing artifacts with both SHA1 and SHA3-256 checksums:
This branch enhances the reconstruct
command to set the
correct hash policy (SHA1 or SHA3-256) for artifacts read from disk, inferred
from the length of the path name.
Moreover, the new option --keep-rid1
is added for the
deconstruct
and reconstruct
commands, to ensure the artifact with RID=1 is a valid manifest, the reasons for
which are summarized here:
This is achieved by storing the filename of the artifact with RID=1 in the file
.rid1
in the data directory. This method is backwards-compatible, as previous
versions of Fossil will simply ignore the .rid1
file.
Test script (Windows batch file):
@echo off
rem Cleanup from previous runs
fossil close --force
del "sample*.fossil" "sample.txt"
rd /s /q "sample-data"
fossil init "sample.fossil" --sha1
fossil open "sample.fossil"
echo "sha1 0" >"sample.txt"
fossil add "sample.txt"
fossil ci -m "check-in sha1 0" --no-warnings --sha1sum
echo "sha1 1" >"sample.txt"
fossil ci -m "check-in sha1 1" --no-warnings --sha1sum
fossil hash-policy sha3
echo "sha3 0" >"sample.txt"
fossil ci -m "check-in sha3 0" --no-warnings --sha1sum
echo "sha3 1" >"sample.txt"
fossil ci -m "check-in sha3 1" --no-warnings --sha1sum
md "sample-data"
fossil deconstruct --prefixlength 9 "sample-data" --keep-rid1
fossil close
pause
fossil reconstruct "sample-reconstructed.fossil" "sample-data" --keep-rid1
start fossil ui "sample.fossil" --page bloblist?hclr
start fossil ui "sample-reconstructed.fossil" --page bloblist?hclr
Test variants:
- Run with both patched and unpatched versions of Fossil, and compare the
/bloblist?hclr
page for the reconstructed repositories. - Run with and without the
--keep-rid1
option. - Run with the
--prefixlength
option set to0
, and to1-9
, resulting in different lengths of the generated artifact path names. - During the
pause
, edit, scramble, or remove the.rid1
file.
Script to compare the artifacts (blobs) of two repositories (Windows batch file):
@echo off
if not exist "%~1" goto :usage
if not exist "%~2" goto :usage
echo Blobs not found in both %1 and %2:
( echo ATTACH DATABASE 'file:%~1?mode=rw' AS a;^
& echo ATTACH DATABASE 'file:%~2?mode=rw' AS b;^
& echo -- Lacking skills to build a FULL OUTER JOIN equivalent^
& echo -- query with SQLite, so do it the hard way ...^
& echo SELECT uuid FROM a.blob WHERE a.blob.uuid NOT IN^
& echo ^^^( SELECT uuid FROM b.blob ^^^);^
& echo SELECT uuid FROM b.blob WHERE b.blob.uuid NOT IN^
& echo ^^^( SELECT uuid FROM a.blob ^^^); ) | ^
fossil sql -list --no-repository
goto :eof
:usage
echo Usage: %~nx0 REPOSITORY1 REPOSITORY2
2019-02-05
| ||
15:43 | Enhance the "reconstruct" command so that sets the correct hash policy for artifacts read from disk. ... (check-in: 93bb3231 user: drh tags: trunk) | |
2019-01-29
| ||
14:29 | Add a test command to infer the hash policy from the length of path names on reconstruct (disabled by preprocessor directive). ... (Closed-Leaf check-in: 8d1ed47c user: florian tags: reconstruct-sha3) | |
14:09 | Calculate hash lengths with skipped directory slashes. ... (check-in: c47adb91 user: florian tags: reconstruct-sha3) | |
14:01 | Coding style fixes. ... (check-in: 1d49b5ad user: florian tags: reconstruct-sha3) | |
2019-01-28
| ||
14:02 | Fix an oversight from the previous check-in: add the short form of the command-line option. ... (check-in: a90d0617 user: florian tags: reconstruct-sha3) | |
10:18 | Add the new option --keep-rid1 for the 'deconstruct' and 'reconstruct' commands. ... (check-in: 79b51366 user: florian tags: reconstruct-sha3) | |
10:12 | Enhance the 'reconstruct' command to set the correct hash policy (SHA1 or SHA3-256) for artifacts read from disk, inferred from the length of the path name. Also enhance the 'deconstruct' and 'reconstruct' commands with an option to ensure the artifact with RID=1 is a valid manifest. See the wiki page linked to this branch for more information and tests. ... (check-in: 62a00bc7 user: florian tags: reconstruct-sha3) | |
2019-01-27
| ||
19:32 | Update the built-in SQLite to the latest 3.27.0 alpha. Updates to the change log. ... (check-in: 5280c1ab user: drh tags: trunk) | |