From 17bbf2840159c656a583726f8128d3d665c5c3e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 9 Feb 2017 15:32:22 -0400 Subject: Make import --deduplicate and --skip-duplicates only hash once, not twice import: --deduplicate and --skip-duplicates were implemented inneficiently; they unncessarily hashed each file twice. They have been improved to only hash once. The new approach is to lock down (minimally) and hash files, and then reuse that information when importing them. This was rather tricky, especially in detecting changes to files while they are being imported. The output of import changed slightly. While before it silently skipped over files with eg --skip-duplicates, now it shows each file as it starts to act on it. Since every file is hashed first thing, it would otherwise not be clear what file import is chewing on. (Actually, it wasn't clear before when any of the duplicates switches were used.) This commit was sponsored by Alexander Thompson on Patreon. --- Assistant/Threads/Committer.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Assistant/Threads/Committer.hs') diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index 7b366bc0a..dbd030b33 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -322,7 +322,7 @@ handleAdds havelsof delayadd cs = returnWhen (null incomplete) $ do doadd = sanitycheck ks $ do (mkey, mcache) <- liftAnnex $ do showStart "add" $ keyFilename ks - ingest $ Just $ LockedDown lockdownconfig ks + ingest (Just $ LockedDown lockdownconfig ks) Nothing maybe (failedingest change) (done change mcache $ keyFilename ks) mkey add _ _ = return Nothing -- cgit v1.2.3