separate source of content from the filename associated with the key when generating a key

This already made migrate's code a lot simpler.
This commit is contained in:
Joey Hess 2012-06-05 19:51:03 -04:00
parent 77188ff04d
commit d3cee987ca
9 changed files with 59 additions and 57 deletions

View file

@ -12,7 +12,7 @@ import Annex.Exception
import Command
import qualified Annex
import qualified Annex.Queue
import qualified Backend
import Backend
import Logs.Location
import Annex.Content
import Utility.Touch
@ -46,8 +46,9 @@ start file = notBareRepo $ ifAnnexed file fixup add
perform :: FilePath -> CommandPerform
perform file = do
backend <- Backend.chooseBackend file
Backend.genKey file backend >>= go
let source = KeySource { keyFilename = file, contentLocation = file}
backend <- chooseBackend file
genKey source backend >>= go
where
go Nothing = stop
go (Just (key, _)) = do