new map subcommand, basically working

Still todo:

- add repos from uuid.log that were not directly found
- group repos into their respective hosts
- display inaccessible repos and broken remote connections in red
- anonymize the url display somewhat, so the maps can be shared
- use uuid info to tell when two apparently different repos are actually
  the same repo accessed in different ways
This commit is contained in:
Joey Hess 2011-02-03 18:55:12 -04:00
parent 14bc885de9
commit 0c7d17ae06
6 changed files with 185 additions and 6 deletions

10
UUID.hs
View file

@ -11,13 +11,15 @@
module UUID (
UUID,
getUUID,
getUncachedUUID,
prepUUID,
genUUID,
reposByUUID,
reposWithoutUUID,
prettyPrintUUIDs,
describeUUID,
uuidLog
uuidLog,
uuidMap
) where
import Control.Monad.State
@ -60,7 +62,7 @@ getUUID r = do
g <- Annex.gitRepo
let c = cached g
let u = uncached
let u = getUncachedUUID r
if c /= u && u /= ""
then do
@ -68,11 +70,13 @@ getUUID r = do
return u
else return c
where
uncached = Git.configGet r "annex.uuid" ""
cached g = Git.configGet g cachekey ""
updatecache g u = when (g /= r) $ Annex.setConfig cachekey u
cachekey = "remote." ++ Git.repoRemoteName r ++ ".annex-uuid"
getUncachedUUID :: Git.Repo -> UUID
getUncachedUUID r = Git.configGet r "annex.uuid" ""
{- Make sure that the repo has an annex.uuid setting. -}
prepUUID :: Annex ()
prepUUID = do