diff options
author | Joey Hess <joey@kitenet.net> | 2013-03-16 16:31:46 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2013-03-16 16:31:59 -0400 |
commit | 8560f266ebcafb59b9da88a99144a336e1aa747e (patch) | |
tree | 0855097b863bc94ed7d514b30f43245e378da2d2 | |
parent | 0d967326df6332d701e39206d3389b4770735397 (diff) |
map: Combine duplicate repositories, for a nicer looking map.
-rw-r--r-- | Command/Map.hs | 12 | ||||
-rw-r--r-- | debian/changelog | 1 |
2 files changed, 11 insertions, 2 deletions
diff --git a/Command/Map.hs b/Command/Map.hs index 94b1289dc..f2ac52047 100644 --- a/Command/Map.hs +++ b/Command/Map.hs @@ -35,7 +35,7 @@ seek = [withNothing start] start :: CommandStart start = do - rs <- spider =<< gitRepo + rs <- combineSame <$> (spider =<< gitRepo) umap <- uuidMap trusted <- trustGet Trusted @@ -77,7 +77,7 @@ hostname r | otherwise = "localhost" 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, - or the remote name if not. -} @@ -236,3 +236,11 @@ tryScan r sshnote = do showAction "sshing" 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) diff --git a/debian/changelog b/debian/changelog index d8833865f..3cb1ec86b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 with the problems Google Talk has with not always sending presence 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 |