map: Combine duplicate repositories, for a nicer looking map.

This commit is contained in:
Joey Hess 2013-03-16 16:31:46 -04:00
parent db2fe522ba
commit 6314be1e3c
2 changed files with 11 additions and 2 deletions

View file

@ -35,7 +35,7 @@ seek = [withNothing start]
start :: CommandStart start :: CommandStart
start = do start = do
rs <- spider =<< gitRepo rs <- combineSame <$> (spider =<< gitRepo)
umap <- uuidMap umap <- uuidMap
trusted <- trustGet Trusted trusted <- trustGet Trusted
@ -77,7 +77,7 @@ hostname r
| otherwise = "localhost" | otherwise = "localhost"
basehostname :: Git.Repo -> String basehostname :: Git.Repo -> String
basehostname r = Prelude.head $ split "." $ hostname r basehostname r = fromMaybe "" $ headMaybe $ split "." $ hostname r
{- A name to display for a repo. Uses the name from uuid.log if available, {- A name to display for a repo. Uses the name from uuid.log if available,
- or the remote name if not. -} - or the remote name if not. -}
@ -236,3 +236,11 @@ tryScan r
sshnote = do sshnote = do
showAction "sshing" showAction "sshing"
showOutput showOutput
{- Spidering can find multiple paths to the same repo, so this is used
- to combine (really remove) duplicate repos with the same UUID. -}
combineSame :: [Git.Repo] -> [Git.Repo]
combineSame = map snd . nubBy sameuuid . map pair
where
sameuuid (u1, _) (u2, _) = u1 == u2 && u1 /= NoUUID
pair r = (getUncachedUUID r, r)

1
debian/changelog vendored
View file

@ -14,6 +14,7 @@ git-annex (4.20130315) UNRELEASED; urgency=low
* xmpp: Re-enable XA flag, since disabling it did not turn out to help * xmpp: Re-enable XA flag, since disabling it did not turn out to help
with the problems Google Talk has with not always sending presence with the problems Google Talk has with not always sending presence
messages to clients. messages to clients.
* map: Combine duplicate repositories, for a nicer looking map.
-- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400 -- Joey Hess <joeyh@debian.org> Fri, 15 Mar 2013 00:10:07 -0400