separate RemoteConfig parsing basically working
Many special remotes are not updated yet and are commented out.
This commit is contained in:
parent
71f78fe45d
commit
963239da5c
26 changed files with 282 additions and 212 deletions
14
Config.hs
14
Config.hs
|
@ -20,10 +20,7 @@ import Config.DynamicConfig
|
|||
import Types.Availability
|
||||
import Git.Types
|
||||
import qualified Types.Remote as Remote
|
||||
import qualified Annex.SpecialRemote.Config as SpecialRemote
|
||||
import Types.ProposedAccepted
|
||||
|
||||
import qualified Data.Map as M
|
||||
import qualified Data.ByteString as S
|
||||
|
||||
type UnqualifiedConfigKey = S.ByteString
|
||||
|
@ -65,9 +62,6 @@ instance RemoteNameable RemoteName where
|
|||
instance RemoteNameable Remote where
|
||||
getRemoteName = Remote.name
|
||||
|
||||
instance RemoteNameable Remote.RemoteConfig where
|
||||
getRemoteName c = fromMaybe "" (SpecialRemote.lookupName c)
|
||||
|
||||
{- A per-remote config setting in git config. -}
|
||||
remoteConfig :: RemoteNameable r => r -> UnqualifiedConfigKey -> ConfigKey
|
||||
remoteConfig r key = ConfigKey $
|
||||
|
@ -112,14 +106,6 @@ setCrippledFileSystem b = do
|
|||
setConfig (annexConfig "crippledfilesystem") (Git.Config.boolConfig b)
|
||||
Annex.changeGitConfig $ \c -> c { annexCrippledFileSystem = b }
|
||||
|
||||
exportTree :: Remote.RemoteConfig -> Bool
|
||||
exportTree c = fromMaybe False $ yesNo . fromProposedAccepted
|
||||
=<< M.lookup SpecialRemote.exportTreeField c
|
||||
|
||||
importTree :: Remote.RemoteConfig -> Bool
|
||||
importTree c = fromMaybe False $ yesNo . fromProposedAccepted
|
||||
=<< M.lookup SpecialRemote.importTreeField c
|
||||
|
||||
yesNo :: String -> Maybe Bool
|
||||
yesNo "yes" = Just True
|
||||
yesNo "no" = Just False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue