Hey there,
this should fix the cases where applying a bunch of patches including a rename
could lead to bits missing from pristine. The actual fix is in hashed-storage:
Sun Jun 6 16:21:25 CEST 2010 Petr Rockai <me@mornfall.net>
* Track changed files across directory renames, in TreeMonad.
diff -rN -u -p old-hashed-storage/Storage/Hashed/Monad.hs new-hashed-storage/Storage/Hashed/Monad.hs
--- old-hashed-storage/Storage/Hashed/Monad.hs 2010-06-06 16:39:36.000000000 +0200
+++ new-hashed-storage/Storage/Hashed/Monad.hs 2010-06-06 16:39:36.000000000 +0200
@@ -117,6 +117,12 @@ modifyItem path item = do
, changed = (S.union paths (changed st))
, changesize = (changesize st + change) }
+renameChanged from to = modify $ \st -> st { changed = rename' $ changed st }
+ where rename' = S.fromList . map renameone . S.toList
+ renameone x | from `isPrefix` x = to `catPaths` relative from x
+ | otherwise = x
+ relative (AnchoredPath from) (AnchoredPath x) = AnchoredPath $ drop (length from) x
+
-- | Replace an item with a new version without modifying the content of the
-- tree. This does not do any change tracking. Ought to be only used from a
-- 'sync' implementation for a particular storage format. The presumed use-case
@@ -212,3 +218,4 @@ instance (Functor m, Monad m, MonadError
unless (isNothing item) $ do
modifyItem from Nothing
modifyItem to item
+ renameChanged from to
I agree it is a bit crude, but it should do for now. I will eventually refactor
the path handling code in h-s anyway.
3 patches for repository darcs-unstable@darcs.net:darcs:
Sun Jun 6 16:28:58 CEST 2010 Petr Rockai <me@mornfall.net>
* Accept issue1860: (Un)applying move patches may lead to incomplete pristine.
Thu Jun 3 22:53:30 CEST 2010 Petr Rockai <me@mornfall.net>
* Resolve issue1817: --external-merge broken, by bumping h-s dependency to 0.5.1.
This h-s releases fixes a problem in index handling code where reading files
from a Tree that was created from an index only worked in the same working
directory in which the index had been opened. This was breaking
externalResolution which called readBlob on index'd files (working) from a
temporary directory.
Sun Jun 6 16:29:19 CEST 2010 Petr Rockai <me@mornfall.net>
* Resolve issue1860: (Un)applying move patches may lead to incomplete pristine.
Fixed in hashed-storage 0.5.2 -- directory renames in TreeIO have caused
subsequent (disk) flush-es to be incomplete in some cases.
Attachments
|