extend Git.Queue to be able to queue more than simple git commands

While I was in there, I noticed and fixed a bug in the queue size
calculations. It was never encountered only because Queue.add was
only ever run with 1 file in the list.
This commit is contained in:
Joey Hess 2012-06-07 15:19:44 -04:00
parent 727158ff55
commit 0a11b35d89
8 changed files with 94 additions and 43 deletions

View file

@ -121,5 +121,5 @@ cleanup file key hascontent = do
( return [Param "-f"]
, return []
)
Annex.Queue.add "add" (params++[Param "--"]) [file]
Annex.Queue.addCommand "add" (params++[Param "--"]) [file]
return True

View file

@ -36,5 +36,5 @@ perform file link = do
cleanup :: FilePath -> CommandCleanup
cleanup file = do
Annex.Queue.add "add" [Param "--force", Param "--"] [file]
Annex.Queue.addCommand "add" [Param "--force", Param "--"] [file]
return True

View file

@ -39,5 +39,5 @@ perform key file = do
cleanup :: FilePath -> CommandCleanup
cleanup file = do
Annex.Queue.add "add" [Param "--"] [file]
Annex.Queue.addCommand "add" [Param "--"] [file]
return True

View file

@ -155,7 +155,7 @@ fixLink key file = do
liftIO $ createDirectoryIfMissing True (parentDir file)
liftIO $ removeFile file
liftIO $ createSymbolicLink want file
Annex.Queue.add "add" [Param "--force", Param "--"] [file]
Annex.Queue.addCommand "add" [Param "--force", Param "--"] [file]
return True
{- Checks that the location log reflects the current status of the key,

View file

@ -24,5 +24,5 @@ start file = do
perform :: FilePath -> CommandPerform
perform file = do
Annex.Queue.add "checkout" [Param "--"] [file]
Annex.Queue.addCommand "checkout" [Param "--"] [file]
next $ return True -- no cleanup needed