summaryrefslogtreecommitdiff
path: root/Logs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2017-09-12 18:30:36 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2017-09-12 18:30:36 -0400
commit78e336434de08edcda121ddee2873023419672b2 (patch)
treece92cafdeed03f7aa25b9a6dd3d1a24708f6ceb4 /Logs
parent6c94a19c018154297c3aaee8e600debba50255ee (diff)
fix compaction of export.log
It was not getting old lines removed, because the tree graft confused the updater, so it union merged from the previous git-annex branch, which still contained the old lines. Fixed by carefully using setIndexSha. This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Logs')
-rw-r--r--Logs/Export.hs20
1 files changed, 2 insertions, 18 deletions
diff --git a/Logs/Export.hs b/Logs/Export.hs
index 2bc1b1705..b0eddba7c 100644
--- a/Logs/Export.hs
+++ b/Logs/Export.hs
@@ -11,6 +11,7 @@ import qualified Data.Map as M
import Annex.Common
import qualified Annex.Branch
+import Annex.Journal
import qualified Git
import qualified Git.Branch
import Git.Tree
@@ -97,7 +98,7 @@ recordExportBeginning remoteuuid newtree = do
showExportLog
. changeMapLog c ep new
. parseExportLog
- graftTreeish newtree
+ Annex.Branch.graftTreeish newtree (asTopFilePath "export.tree")
parseExportLog :: String -> MapLog ExportParticipants Exported
parseExportLog = parseMapLog parseExportParticipants parseExported
@@ -125,20 +126,3 @@ parseExported :: String -> Maybe Exported
parseExported s = case words s of
(et:it) -> Just $ Exported (Git.Ref et) (map Git.Ref it)
_ -> Nothing
-
--- To prevent git-annex branch merge conflicts, the treeish is
--- first grafted in and then removed in a subsequent commit.
-graftTreeish :: Git.Ref -> Annex ()
-graftTreeish treeish = do
- branchref <- Annex.Branch.getBranch
- Tree t <- inRepo $ getTree branchref
- t' <- inRepo $ recordTree $ Tree $
- RecordedSubTree (asTopFilePath graftpoint) treeish [] : t
- commit <- inRepo $ Git.Branch.commitTree Git.Branch.AutomaticCommit
- "export tree" [branchref] t'
- origtree <- inRepo $ recordTree (Tree t)
- commit' <- inRepo $ Git.Branch.commitTree Git.Branch.AutomaticCommit
- "export tree cleanup" [commit] origtree
- inRepo $ Git.Branch.update' Annex.Branch.fullname commit'
- where
- graftpoint = "export.tree"