add support for using hashDirLower in addition to hashDirMixed

Supporting multiple directory hash types will allow converting to a
different one, without a flag day.

gitAnnexLocation now checks which of the possible locations have a file.
This means more statting of files. Several places currently use
gitAnnexLocation and immediately check if the returned file exists;
those need to be optimised.
This commit is contained in:
Joey Hess 2011-11-28 22:43:51 -04:00
parent 2b3c120506
commit da9cd315be
15 changed files with 73 additions and 44 deletions

View file

@ -95,11 +95,11 @@ rsyncKeyDir :: RsyncOpts -> Key -> String
rsyncKeyDir o k = rsyncUrl o </> hashDirMixed k </> rsyncEscape o (keyFile k)
store :: RsyncOpts -> Key -> Annex Bool
store o k = rsyncSend o k =<< fromRepo (gitAnnexLocation k)
store o k = rsyncSend o k =<< inRepo (gitAnnexLocation k)
storeEncrypted :: RsyncOpts -> (Cipher, Key) -> Key -> Annex Bool
storeEncrypted o (cipher, enck) k = withTmp enck $ \tmp -> do
src <- fromRepo $ gitAnnexLocation k
src <- inRepo $ gitAnnexLocation k
liftIO $ withEncryptedContent cipher (L.readFile src) $ L.writeFile tmp
rsyncSend o enck tmp