diff options
author | Joey Hess <joey@kitenet.net> | 2014-09-11 13:36:28 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-09-11 13:36:28 -0400 |
commit | b0a86d81a39f25f2e57b0e4fd564acc70cbdf850 (patch) | |
tree | fca828650876bfe16d6ef24cb0f2a516e1c390d9 | |
parent | de679a571cc4f8bf6a320222697e40900fd962cf (diff) |
Promote file not found warning message to an error.
-rw-r--r-- | CmdLine/Seek.hs | 3 | ||||
-rw-r--r-- | Messages.hs | 14 | ||||
-rw-r--r-- | Types/Messages.hs | 5 | ||||
-rw-r--r-- | debian/changelog | 1 | ||||
-rw-r--r-- | doc/bugs/__39__git_annex_get__39___returns_success_when_file_not_found.mdwn | 4 |
5 files changed, 7 insertions, 20 deletions
diff --git a/CmdLine/Seek.hs b/CmdLine/Seek.hs index 431b2e118..397a48118 100644 --- a/CmdLine/Seek.hs +++ b/CmdLine/Seek.hs @@ -189,10 +189,9 @@ seekHelper :: ([FilePath] -> Git.Repo -> IO ([FilePath], IO Bool)) -> [FilePath] seekHelper a params = do ll <- inRepo $ \g -> runSegmentPaths (\fs -> Git.Command.leaveZombie <$> a fs g) params - {- Show warnings only for files/directories that do not exist. -} forM_ (map fst $ filter (null . snd) $ zip params ll) $ \p -> unlessM (isJust <$> liftIO (catchMaybeIO $ getSymbolicLinkStatus p)) $ - fileNotFound p + error $ p ++ " not found" return $ concat ll notSymlink :: FilePath -> IO Bool diff --git a/Messages.hs b/Messages.hs index f27755f3a..3ffa14814 100644 --- a/Messages.hs +++ b/Messages.hs @@ -25,7 +25,6 @@ module Messages ( showErr, warning, warningIO, - fileNotFound, indent, maybeShowJSON, showFullJSON, @@ -45,7 +44,6 @@ import System.Log.Logger import System.Log.Formatter import System.Log.Handler (setFormatter, LogHandler) import System.Log.Handler.Simple -import qualified Data.Set as S import Common hiding (handle) import Types @@ -172,18 +170,6 @@ warningIO w = do hFlush stdout hPutStrLn stderr w -{- Displays a warning one time about a file the user specified not existing. -} -fileNotFound :: FilePath -> Annex () -fileNotFound file = do - st <- Annex.getState Annex.output - let shown = fileNotFoundShown st - when (S.notMember file shown) $ do - let shown' = S.insert file shown - let st' = st { fileNotFoundShown = shown' } - Annex.changeState $ \s -> s { Annex.output = st' } - liftIO $ hPutStrLn stderr $ unwords - [ "git-annex:", file, "not found" ] - indent :: String -> String indent = intercalate "\n" . map (\l -> " " ++ l) . lines diff --git a/Types/Messages.hs b/Types/Messages.hs index 4fcce79f8..2196028e3 100644 --- a/Types/Messages.hs +++ b/Types/Messages.hs @@ -7,8 +7,6 @@ module Types.Messages where -import qualified Data.Set as S - data OutputType = NormalOutput | QuietOutput | JSONOutput data SideActionBlock = NoBlock | StartBlock | InBlock @@ -17,8 +15,7 @@ data SideActionBlock = NoBlock | StartBlock | InBlock data MessageState = MessageState { outputType :: OutputType , sideActionBlock :: SideActionBlock - , fileNotFoundShown :: S.Set FilePath } defaultMessageState :: MessageState -defaultMessageState = MessageState NormalOutput NoBlock S.empty +defaultMessageState = MessageState NormalOutput NoBlock diff --git a/debian/changelog b/debian/changelog index c5cde761c..0e267eb0a 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,6 +10,7 @@ git-annex (5.20140832) UNRELEASED; urgency=medium * The annex-rsync-transport configuration is now also used when checking if a key is present on a rsync remote, and when dropping a key from the remote. + * Promote file not found warning message to an error. -- Joey Hess <joeyh@debian.org> Thu, 04 Sep 2014 16:17:22 -0400 diff --git a/doc/bugs/__39__git_annex_get__39___returns_success_when_file_not_found.mdwn b/doc/bugs/__39__git_annex_get__39___returns_success_when_file_not_found.mdwn index 3c6220cf6..93f2a8fd9 100644 --- a/doc/bugs/__39__git_annex_get__39___returns_success_when_file_not_found.mdwn +++ b/doc/bugs/__39__git_annex_get__39___returns_success_when_file_not_found.mdwn @@ -24,3 +24,7 @@ henry@commsbox:~/work/tmp/test$ echo $? """]] + +> Ok, I can find no reason why it was implemented as a warning in +> 5f3661238de9f31e6fed0be74fca9d5f1659278c in the bug report associated +> with that commit. So, promoted to error. [[done]] --[[Joey]] |