summaryrefslogtreecommitdiff
path: root/Command
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-06 13:39:33 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-06 13:45:03 -0400
commit9dd2651e8e5efbbf3a9cc59cab3afa1fef7446f2 (patch)
tree31afde6ea8072120ed0bf7643b2f2d968d95b69d /Command
parentf1b255623bc026d1480d44808cfc30507537cda1 (diff)
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.
Diffstat (limited to 'Command')
-rw-r--r--Command/Export.hs7
1 files changed, 4 insertions, 3 deletions
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
}