make watch use the queue

May not work. Certianly needs to flush the queue from time to time
when only symlink changes are being made.
This commit is contained in:
Joey Hess 2012-06-07 15:40:44 -04:00
parent 0a11b35d89
commit 20f425be19
5 changed files with 35 additions and 24 deletions

View file

@ -1,12 +1,13 @@
{- git-annex command queue
-
- Copyright 2011 Joey Hess <joey@kitenet.net>
- Copyright 2011, 2012 Joey Hess <joey@kitenet.net>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Annex.Queue (
addCommand,
addUpdateIndex,
flush,
flushWhenFull
) where
@ -14,6 +15,7 @@ module Annex.Queue (
import Common.Annex
import Annex hiding (new)
import qualified Git.Queue
import qualified Git.UpdateIndex
import Config
{- Adds a git command to the queue. -}
@ -22,6 +24,12 @@ addCommand command params files = do
q <- get
store =<< inRepo (Git.Queue.addCommand command params files q)
{- Adds an update-index stream to the queue. -}
addUpdateIndex :: Git.UpdateIndex.Streamer -> Annex ()
addUpdateIndex streamer = do
q <- get
store =<< inRepo (Git.Queue.addUpdateIndex streamer q)
{- Runs the queue if it is full. Should be called periodically. -}
flushWhenFull :: Annex ()
flushWhenFull = do