diff --git a/Command/Map.hs b/Command/Map.hs index da129c8f65..0f32e1130d 100644 --- a/Command/Map.hs +++ b/Command/Map.hs @@ -16,6 +16,7 @@ import qualified Git import qualified Git.Url import qualified Git.Config import qualified Git.Construct +import qualified Annex import Annex.UUID import Logs.UUID import Logs.Trust @@ -40,10 +41,14 @@ start = do trusted <- trustGet Trusted liftIO $ writeFile file (drawMap rs umap trusted) - showLongNote $ "running: dot -Tx11 " ++ file - showOutput - r <- liftIO $ boolSystem "dot" [Param "-Tx11", File file] - next $ next $ return r + next $ next $ do + fast <- Annex.getState Annex.fast + if fast + then return True + else do + showLongNote $ "running: dot -Tx11 " ++ file + showOutput + liftIO $ boolSystem "dot" [Param "-Tx11", File file] where file = "map.dot" diff --git a/debian/changelog b/debian/changelog index e187d8f6fa..600687d94b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,7 @@ git-annex (3.20111212) UNRELEASED; urgency=low * reinject: Add a sanity check for using an annexed file as the source file. * Properly handle multiline git config values. * Fix the hook special remote, which bitrotted a while ago. + * map: --fast disables use of dot to display map -- Joey Hess Mon, 12 Dec 2011 01:57:49 -0400 diff --git a/doc/git-annex.mdwn b/doc/git-annex.mdwn index d7a51663fd..b3d671bb89 100644 --- a/doc/git-annex.mdwn +++ b/doc/git-annex.mdwn @@ -268,9 +268,10 @@ subdirectories). Helps you keep track of your repositories, and the connections between them, by going out and looking at all the ones it can get to, and generating a Graphviz file displaying it all. If the `dot` command is available, it is - used to display the file to your screen (using x11 backend). + used to display the file to your screen (using x11 backend). (To disable + this display, specify --fast) - Note that this only connects to hosts that the host it's run on can + This command only connects to hosts that the host it's run on can directly connect to. It does not try to tunnel through intermediate hosts. So it might not show all connections between the repositories in the network. diff --git a/test.hs b/test.hs index a3935cf66e..aa2cd8be75 100644 --- a/test.hs +++ b/test.hs @@ -108,6 +108,7 @@ blackbox = TestLabel "blackbox" $ TestList , test_merge , test_status , test_sync + , test_map , test_hook_remote , test_directory_remote , test_rsync_remote @@ -526,6 +527,17 @@ test_sync :: Test test_sync = "git-annex sync" ~: intmpclonerepo $ do git_annex "sync" [] @? "sync failed" +test_map :: Test +test_map = "git-annex map" ~: intmpclonerepo $ do + -- set descriptions, that will be looked for in the map + git_annex "describe" [".", "this repo"] @? "describe 1 failed" + git_annex "describe" ["origin", "origin repo"] @? "describe 2 failed" + -- --fast avoids it running graphviz, not a build dependency + git_annex "map" ["--fast"] @? "map failed" + doesFileExist "map.dot" @? "map.dot not generated" + c <- readFile "map.dot" + not ("this repo" `isInfixOf` c && "origin repo" `isInfixOf` c) @? "map.dot bad content" + test_hook_remote :: Test test_hook_remote = "git-annex hook remote" ~: intmpclonerepo $ do git_annex "initremote" (words "foo type=hook encryption=none hooktype=foo") @? "initremote failed"