p2pHttpUrlWithoutUUID :: String -> String
p2pHttpUrlWithoutUUID = reverse . dropWhile (/= '/') . reverse
+
+unavailableP2PHttpUrl :: P2PHttpUrl -> P2PHttpUrl
+unavailableP2PHttpUrl p = p
+#ifdef WITH_SERVANT
+ { p2pHttpBaseUrl = (p2pHttpBaseUrl p) { baseUrlHost = "!dne!" } }
+#endif
| otherwise = expensiveRemoteCost
unavailable :: Git.Repo -> UUID -> RemoteConfig -> RemoteGitConfig -> RemoteStateHandle -> Annex (Maybe Remote)
-unavailable r = gen r'
+unavailable r u c gc = gen r' u c gc'
where
r' = case Git.location r of
Git.Local { Git.gitdir = d } ->
in r { Git.location = Git.Url (url { uriAuthority = Just auth' })}
Nothing -> r { Git.location = Git.Unknown }
_ -> r -- already unavailable
+ gc' = gc
+ { remoteAnnexP2PHttpUrl =
+ unavailableP2PHttpUrl <$> remoteAnnexP2PHttpUrl gc
+ }
{- Tries to read the config for a specified remote, updates state, and
- returns the updated repo. -}