From 9dd2651e8e5efbbf3a9cc59cab3afa1fef7446f2 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 6 Sep 2017 13:39:33 -0400 Subject: record incomplete exports in export.log Not yet used, but essential for resuming cleanly. Note that, in normmal operation, only one commit is made to export.log during an export; the incomplete version only gets to the journal and is then overwritten. This commit was supported by the NSF-funded DataLad project. --- Command/Export.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'Command') diff --git a/Command/Export.hs b/Command/Export.hs index 3387a14ad..878cda8e3 100644 --- a/Command/Export.hs +++ b/Command/Export.hs @@ -79,9 +79,10 @@ seek o = do inRepo (Git.Ref.tree (exportTreeish o)) old <- getExport (uuid r) + recordExportBeginning (uuid r) new when (length old > 1) $ warning "Export conflict detected. Different trees have been exported to the same special remote. Resolving.." - + db <- openDb (uuid r) -- First, diff the old and new trees and delete all changed @@ -89,7 +90,7 @@ seek o = do -- have the content from the new treeish. -- -- (Also, when there was an export conflict, this resolves it.) - forM_ old $ \oldtreesha -> do + forM_ (map exportedTreeish old) $ \oldtreesha -> do (diff, cleanup) <- inRepo $ Git.DiffTree.diffTreeRecursive oldtreesha new seekActions $ pure $ map (startUnexport r db) diff @@ -99,7 +100,7 @@ seek o = do -- if this export is interrupted, there are no files left over -- from a previous export, that are not part of this export. recordExport (uuid r) $ ExportChange - { oldTreeish = old + { oldTreeish = map exportedTreeish old , newTreeish = new } -- cgit v1.2.3