aboutsummaryrefslogtreecommitdiff
path: root/Annex
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-11-15 23:28:01 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-11-15 23:28:01 -0400
commit21a925dcf1ebe088b5c64da0ce159ffb6d535f04 (patch)
treedf3851985ef279a81ceddd2f5e96fcacc30a7df9 /Annex
parent922e9af5281b01709e5fa631ebe048c7da7c4d71 (diff)
merge: Now runs in constant space.
Before, a merge was first calculated, by running various actions that called git and built up a list of lines, which were at the end sent to git update-index. This necessarily used space proportional to the size of the diff between the trees being merged. Now, lines are streamed into git update-index from each of the actions in turn. Runtime size of git-annex merge when merging 50000 location log files drops from around 100 mb to a constant 4 mb. Presumably it runs quite a lot faster, too.
Diffstat (limited to 'Annex')
-rw-r--r--Annex/Branch.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Annex/Branch.hs b/Annex/Branch.hs
index 20134003d..ae33f66cf 100644
--- a/Annex/Branch.hs
+++ b/Annex/Branch.hs
@@ -56,7 +56,8 @@ index g = gitAnnexDir g </> "index"
- and merge in changes from other branches.
-}
genIndex :: Git.Repo -> IO ()
-genIndex g = Git.UnionMerge.ls_tree fullname g >>= Git.UnionMerge.update_index g
+genIndex g = Git.UnionMerge.update_index_via g
+ [Git.UnionMerge.ls_tree fullname g]
{- Runs an action using the branch's index file. -}
withIndex :: Annex a -> Annex a