[darcs-users] [patch137] Resolve issue1677: require hashed-storage 0.4.4.

Petr Ročkai bugs at darcs.net
Tue Jan 12 14:53:52 UTC 2010


New submission from Petr Ročkai <me at mornfall.net>:

Hi!

Should be self-explanatory. The hashed-storage diff between 0.4.3 and 0.4.4:

15:52:40 | morn at 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 at mornfall.net>
  tagged 0.4.4
Tue Jan 12 15:47:16 CET 2010  Petr Rockai <me at mornfall.net>
  * Bump version to 0.4.4.
Tue Jan 12 15:43:45 CET 2010  Petr Rockai <me at mornfall.net>
  * Fix indexed hashes of empty directories.
Tue Jan 12 15:46:06 CET 2010  Petr Rockai <me at 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 at darcs.net:darcs:

Tue Jan 12 15:48:31 CET 2010  Petr Rockai <me at 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).

----------
files: resolve-issue1677_-require-hashed_storage-0_4_4_.dpatch, unnamed
messages: 9790
nosy: darcs-users, mornfall
status: needs-review
title: Resolve issue1677: require hashed-storage 0.4.4.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch137>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: resolve-issue1677_-require-hashed_storage-0_4_4_.dpatch
Type: text/x-darcs-patch
Size: 77499 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100112/bcd6009e/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: unnamed
URL: <http://lists.osuosl.org/pipermail/darcs-users/attachments/20100112/bcd6009e/attachment-0001.diff>


More information about the darcs-users mailing list