darcs

Patch 137 Resolve issue1677: require hashed-storage 0.4.4.

Title Resolve issue1677: require hashed-storage 0.4.4.
Superseder Nosy List darcs-users, ganesh, kowey, mornfall
Related Issues pristine problems with darcs 2.3
View: 1677
Status accepted Assigned To ganesh
Milestone

Created on 2010-01-12.14:53:52 by mornfall, last changed 2011-05-10.19:06:19 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
resolve-issue1677_-require-hashed_storage-0_4_4_.dpatch mornfall, 2010-01-12.14:53:50 text/x-darcs-patch
unnamed mornfall, 2010-01-12.14:53:50 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg9790 (view) Author: mornfall Date: 2010-01-12.14:53:50
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
msg9791 (view) Author: kowey Date: 2010-01-12.14:59:39
I think this is a high-priority one as it's release-critical.

Normally, I like to spread patches out in a way that forces people to know as
many parts of Darcs as possible, but I think for expediency, I'd like Ganesh to
look at this one (since he knows the hashed-storage code best)
msg9795 (view) Author: ganesh Date: 2010-01-12.20:21:31
Looks fine to me, just adds a special case for empty directories. Ideally we
should have a test case for issue1677 so we can demonstrate that this patch
fixes it, but I don't think it's crucial.
msg9811 (view) Author: darcswatch Date: 2010-01-13.21:45:37
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-afa8423557c4ace5d53a17a6c2cc8e43d5809514
msg14151 (view) Author: darcswatch Date: 2011-05-10.19:06:19
This patch bundle (with 1 patches) was just applied to the repository http://darcs.net/reviewed.
This message was brought to you by DarcsWatch
http://darcswatch.nomeata.de/repo_http:__darcs.net_reviewed.html#bundle-afa8423557c4ace5d53a17a6c2cc8e43d5809514
History
Date User Action Args
2010-01-12 14:53:52mornfallcreate
2010-01-12 14:55:29darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-afa8423557c4ace5d53a17a6c2cc8e43d5809514
2010-01-12 14:59:40koweysetnosy: + kowey, ganesh
messages: + msg9791
assignedto: ganesh
2010-01-12 20:21:32ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg9795
issues: + pristine problems with darcs 2.3
2010-01-13 21:45:37darcswatchsetstatus: accepted-pending-tests -> accepted
messages: + msg9811
2011-05-10 19:06:19darcswatchsetmessages: + msg14151