darcs

Patch 144 resolve issue1731: bump hashed-storage dependency to 0...

Title resolve issue1731: bump hashed-storage dependency to 0...
Superseder Nosy List darcs-users, ganesh, kowey, tux_rocker
Related Issues
Status accepted Assigned To ganesh
Milestone

Created on 2010-01-17.21:06:55 by tux_rocker, last changed 2011-05-10.19:36:08 by darcswatch. Tracked on DarcsWatch.

Files
File name Status Uploaded Type Edit Remove
resolve-issue1731_-bump-hashed_storage-dependency-to-0_4_5.dpatch tux_rocker, 2010-01-17.21:06:54 text/x-darcs-patch
unnamed tux_rocker, 2010-01-17.21:06:54 text/plain
See mailing list archives for discussion on individual patches.
Messages
msg9839 (view) Author: tux_rocker Date: 2010-01-17.21:06:54
Sun Jan 17 21:52:23 CET 2010  Reinier Lamers <tux_rocker@reinier.de>
  * resolve issue1731: bump hashed-storage dependency to 0.4.5
Attachments
msg9845 (view) Author: kowey Date: 2010-01-18.09:07:57
Hi Ganesh, could you have a look at the 0.4.5 changes to hashed-storage?  Thanks!
msg9851 (view) Author: ganesh Date: 2010-01-18.20:51:39
Looks ok to me. I would be interested whether making the hash in Blob lazy would
work as well; but I guess it creates the risk of hanging on to entire files
instead of hashing them and dropping the data.

[Defer SHA256 from MonadRW updates until disk flush, saving lots of cycles.
Petr Rockai <me@mornfall.net>**20100117161040
 Ignore-this: c7b045db905819711c0083934c5ec52a
] hunk ./Storage/Hashed/Darcs.hs 144
+darcsAddMissingHashes :: (Monad m, Functor m) => Tree m -> m (Tree m)
+darcsAddMissingHashes = updateTree update
+    where update (SubTree t) = return . SubTree $ t { treeHash = darcsTreeHash t }
+          update (File blob@(Blob con NoHash)) =
+              do hash <- sha256 <$> readBlob blob
+                 return $ File (Blob con hash)
+          update x = return x
+
hunk ./Storage/Hashed/Darcs.hs 226
-            modify $ \st -> st { tree = darcsUpdateDirHashes $ tree st }
+            hashed <- liftIO . darcsAddMissingHashes =<< gets tree
+            modify $ \st -> st { tree = hashed }
hunk ./Storage/Hashed/Monad.hs 170
-              hash = sha256 con
+              hash = NoHash -- we would like to say "sha256 con" here, but due
+                            -- to strictness of Hash in Blob, this would often
+                            -- lead to unnecessary computation which would then
+                            -- be discarded anyway; we rely on the sync
+                            -- implementation to fix up any NoHash occurrences
msg9854 (view) Author: darcswatch Date: 2010-01-18.21:45:50
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-7cac2b2c925d4f152fad8d2cede56921e6bfd98c
msg14179 (view) Author: darcswatch Date: 2011-05-10.19:36:08
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-7cac2b2c925d4f152fad8d2cede56921e6bfd98c
History
Date User Action Args
2010-01-17 21:06:55tux_rockercreate
2010-01-17 21:07:46darcswatchsetdarcswatchurl: http://darcswatch.nomeata.de/repo_http:__darcs.net_.html#bundle-7cac2b2c925d4f152fad8d2cede56921e6bfd98c
2010-01-18 09:07:57koweysetassignedto: ganesh
messages: + msg9845
nosy: + kowey, ganesh
2010-01-18 20:51:40ganeshsetstatus: needs-review -> accepted-pending-tests
messages: + msg9851
2010-01-18 21:45:52darcswatchsetstatus: accepted-pending-tests -> accepted
messages: + msg9854
2011-05-10 19:36:08darcswatchsetmessages: + msg14179