Hi!
Should be self-explanatory. The hashed-storage diff between 0.4.3 and 0.4.4:
15:52:40 | morn@twi:~/dev/darcs/hashed-storage -> darcs diff --from-tag 0.4.3 --to-tag 0.4.4
Tue Jan 12 15:47:24 CET 2010 Petr Rockai <me@mornfall.net>
tagged 0.4.4
Tue Jan 12 15:47:16 CET 2010 Petr Rockai <me@mornfall.net>
* Bump version to 0.4.4.
Tue Jan 12 15:43:45 CET 2010 Petr Rockai <me@mornfall.net>
* Fix indexed hashes of empty directories.
Tue Jan 12 15:46:06 CET 2010 Petr Rockai <me@mornfall.net>
tagged 0.4.3
diff -rN -u -p old-hashed-storage/hashed-storage.cabal new-hashed-storage/hashed-storage.cabal
--- old-hashed-storage/hashed-storage.cabal 2010-01-12 15:52:51.000000000 +0100
+++ new-hashed-storage/hashed-storage.cabal 2010-01-12 15:52:51.000000000 +0100
@@ -1,5 +1,5 @@
name: hashed-storage
-version: 0.4.3
+version: 0.4.4
synopsis: Hashed file storage support code.
description: Support code for reading and manipulating hashed file storage
diff -rN -u -p old-hashed-storage/Storage/Hashed/Index.hs new-hashed-storage/Storage/Hashed/Index.hs
--- old-hashed-storage/Storage/Hashed/Index.hs 2010-01-12 15:52:51.000000000 +0100
+++ new-hashed-storage/Storage/Hashed/Index.hs 2010-01-12 15:52:51.000000000 +0100
@@ -62,6 +62,7 @@ import Control.Monad( when )
import Control.Exception.Extensible
import Control.Applicative( (<$>) )
+import qualified Data.ByteString.Lazy as BL
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BSC
import Data.ByteString.Unsafe( unsafeHead, unsafeDrop )
@@ -111,6 +112,8 @@ off_dsclen = off_aux + size_aux
off_hash = off_dsclen + size_dsclen
off_dsc = off_hash + size_hash
+emptyDirHash = sha256 BL.empty
+
itemAllocSize :: AnchoredPath -> Int
itemAllocSize apath =
align 4 $ size_hash + size_size + size_aux + size_dsclen + 2 + BS.length (flatten apath)
@@ -361,6 +364,7 @@ formatIndex mmap_ptr old reference =
let path'' = path' `appendPath` name
noff <- subs xs
create x path'' noff
+ when (null $ listImmediate s) $ updateItem i 0 emptyDirHash
lastOff <- subs (listImmediate s)
xlatePoke64 (iAux i) (fromIntegral lastOff)
return lastOff
1 patch for repository darcs-unstable@darcs.net:darcs:
Tue Jan 12 15:48:31 CET 2010 Petr Rockai <me@mornfall.net>
* Resolve issue1677: require hashed-storage 0.4.4.
This version of hashed-storage produces index with correct hashes for empty
directories (the previous versions would use zeroes as the hash instead of the
hash of empty string there, leading to hash mismatches in the index).
Attachments
|