diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-11 14:14:45 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-11 14:14:45 -0400 |
commit | 454fd01fb7ea8b23a46849cdc6982f77064593cf (patch) | |
tree | 5e3af481f074c8a37b47834ec342d41301727c8d /Assistant | |
parent | 893860527ee8044cf990abaf03bf0405ff1ddd53 (diff) |
finish fast direct mode rename handling. wow, it's fast
Diffstat (limited to 'Assistant')
-rw-r--r-- | Assistant/Threads/Committer.hs | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/Assistant/Threads/Committer.hs b/Assistant/Threads/Committer.hs index e77c55dfd..f1e26f9aa 100644 --- a/Assistant/Threads/Committer.hs +++ b/Assistant/Threads/Committer.hs @@ -266,14 +266,13 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do Just cache -> case M.lookup (inodeCacheToKey ct cache) m of Nothing -> add c - Just k -> fastadd c k cache + Just k -> fastadd c k - fastadd :: Change -> Key -> InodeCache -> Assistant (Maybe Change) - fastadd change key cache = do - -- TODO do fast method - debug ["rename detected", show change, show key, show cache] - add change - --return $ Just $ finishedChange change key + fastadd :: Change -> Key -> Assistant (Maybe Change) + fastadd change key = do + let source = keySource change + liftAnnex $ Command.Add.finishIngestDirect key source + done change (keyFilename source) key removedKeysMap :: InodeComparisonType -> [Change] -> Annex (M.Map InodeCacheKey Key) removedKeysMap ct l = do @@ -291,16 +290,15 @@ handleAdds delayadd cs = returnWhen (null incomplete) $ do liftAnnex showEndFail return Nothing - done change file key = do - liftAnnex $ do - logStatus key InfoPresent - link <- ifM isDirect - ( calcGitLink file key - , Command.Add.link file key True - ) - whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ do - stageSymlink file =<< hashSymlink link - showEndOk + done change file key = liftAnnex $ do + logStatus key InfoPresent + link <- ifM isDirect + ( calcGitLink file key + , Command.Add.link file key True + ) + whenM (pure DirWatcher.eventsCoalesce <||> isDirect) $ do + stageSymlink file =<< hashSymlink link + showEndOk return $ Just $ finishedChange change key {- Check that the keysource's keyFilename still exists, |