2012-06-22 13:39:44 -04:00
|
|
|
{- git-annex assistant commit tracking
|
|
|
|
-
|
2015-01-21 12:50:09 -04:00
|
|
|
- Copyright 2012 Joey Hess <id@joeyh.name>
|
2012-06-23 01:20:40 -04:00
|
|
|
-
|
|
|
|
- Licensed under the GNU GPL version 3 or higher.
|
2012-06-22 13:39:44 -04:00
|
|
|
-}
|
|
|
|
|
|
|
|
module Assistant.Commits where
|
|
|
|
|
2012-10-29 19:35:18 -04:00
|
|
|
import Assistant.Common
|
|
|
|
import Assistant.Types.Commits
|
2013-04-24 17:16:04 -04:00
|
|
|
import Utility.TList
|
2012-06-22 13:39:44 -04:00
|
|
|
|
2013-03-10 21:36:13 -04:00
|
|
|
import Control.Concurrent.STM
|
|
|
|
|
2012-06-22 13:39:44 -04:00
|
|
|
{- Gets all unhandled commits.
|
|
|
|
- Blocks until at least one commit is made. -}
|
2012-10-29 19:35:18 -04:00
|
|
|
getCommits :: Assistant [Commit]
|
2013-04-24 17:16:04 -04:00
|
|
|
getCommits = (atomically . getTList) <<~ commitChan
|
2012-06-22 13:39:44 -04:00
|
|
|
|
|
|
|
{- Records a commit in the channel. -}
|
2012-10-29 19:35:18 -04:00
|
|
|
recordCommit :: Assistant ()
|
2013-04-24 17:16:04 -04:00
|
|
|
recordCommit = (atomically . flip consTList Commit) <<~ commitChan
|