From e9a5e4d6c686d730161ff00995ee9fe3aca7402a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 30 Dec 2014 12:49:34 -0400 Subject: [PATCH] Run shutdown cleanup actions even if there were failures processing the command. Amoung other fixes, this means that addurl will stage added files even if adding one of the urls fails. --- CmdLine.hs | 4 ++-- CmdLine/Action.hs | 9 +++++---- debian/changelog | 3 +++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CmdLine.hs b/CmdLine.hs index 41968a091a..1d93855ce8 100644 --- a/CmdLine.hs +++ b/CmdLine.hs @@ -53,8 +53,8 @@ dispatch fuzzyok allargs allcmds commonoptions fields header getgitrepo = do whenM (annexDebug <$> Annex.getGitConfig) $ liftIO enableDebugOutput startup - performCommandAction cmd params - shutdown $ cmdnocommit cmd + performCommandAction cmd params $ + shutdown $ cmdnocommit cmd go _flags params (Left e) = do when fuzzy $ autocorrect =<< Git.Config.global diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index db4f768ac3..65cdbec141 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -17,13 +17,14 @@ import qualified Annex.Queue type CommandActionRunner = CommandStart -> CommandCleanup {- Runs a command, starting with the check stage, and then - - the seek stage. Finishes by printing the number of commandActions that - - failed. -} -performCommandAction :: Command -> CmdParams -> Annex () -performCommandAction Command { cmdseek = seek, cmdcheck = c, cmdname = name } params = do + - the seek stage. Finishes by running the continutation, and + - then showing a count of any failures. -} +performCommandAction :: Command -> CmdParams -> Annex () -> Annex () +performCommandAction Command { cmdseek = seek, cmdcheck = c, cmdname = name } params cont = do mapM_ runCheck c Annex.changeState $ \s -> s { Annex.errcounter = 0 } seek params + cont showerrcount =<< Annex.getState Annex.errcounter where showerrcount 0 = noop diff --git a/debian/changelog b/debian/changelog index cdc53fd957..cead4170fe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,6 +4,9 @@ git-annex (5.20141220) UNRELEASED; urgency=medium * Work around statfs() overflow on some XFS systems. * sync: Now supports remote groups, the same way git remote update does. * setpresentkey: A new plumbing-level command. + * Run shutdown cleanup actions even if there were failures processing + the command. Amoung other fixes, this means that addurl will stage + added files even if adding one of the urls fails. -- Joey Hess Mon, 22 Dec 2014 15:16:38 -0400