start of generalizing remotes

Goal is to support multiple different types of remotes, some of which
are not git repositories. To that end, added a Remote class, and moved
git remote specific code into Remote.GitRemote.

Remotes.hs is still present as some code has not been converted to use the
new Remote class yet.
This commit is contained in:
Joey Hess 2011-03-27 15:56:43 -04:00
parent 2821effce9
commit b40f253d6e
6 changed files with 405 additions and 39 deletions

18
UUID.hs
View file

@ -14,8 +14,6 @@ module UUID (
getUncachedUUID,
prepUUID,
genUUID,
reposByUUID,
reposWithoutUUID,
prettyPrintUUIDs,
describeUUID,
uuidLog,
@ -87,22 +85,6 @@ prepUUID = do
uuid <- liftIO $ genUUID
Annex.setConfig configkey uuid
{- Filters a list of repos to ones that have listed UUIDs. -}
reposByUUID :: [Git.Repo] -> [UUID] -> Annex [Git.Repo]
reposByUUID repos uuids = filterM match repos
where
match r = do
u <- getUUID r
return $ u `elem` uuids
{- Filters a list of repos to ones that do not have the listed UUIDs. -}
reposWithoutUUID :: [Git.Repo] -> [UUID] -> Annex [Git.Repo]
reposWithoutUUID repos uuids = filterM unmatch repos
where
unmatch r = do
u <- getUUID r
return $ u `notElem` uuids
{- Pretty-prints a list of UUIDs -}
prettyPrintUUIDs :: [UUID] -> Annex String
prettyPrintUUIDs uuids = do