Merge branch 'new-monad-control'
Conflicts: debian/changelog
This commit is contained in:
commit
8f4fdb3f97
7 changed files with 27 additions and 11 deletions
17
Annex.hs
17
Annex.hs
|
@ -5,7 +5,7 @@
|
||||||
- Licensed under the GNU GPL version 3 or higher.
|
- Licensed under the GNU GPL version 3 or higher.
|
||||||
-}
|
-}
|
||||||
|
|
||||||
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
{-# LANGUAGE GeneralizedNewtypeDeriving, TypeFamilies, MultiParamTypeClasses #-}
|
||||||
|
|
||||||
module Annex (
|
module Annex (
|
||||||
Annex,
|
Annex,
|
||||||
|
@ -22,8 +22,9 @@ module Annex (
|
||||||
fromRepo,
|
fromRepo,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Monad.IO.Control
|
|
||||||
import Control.Monad.State
|
import Control.Monad.State
|
||||||
|
import Control.Monad.Trans.Control (StM, MonadBaseControl, liftBaseWith, restoreM)
|
||||||
|
import Control.Monad.Base (liftBase, MonadBase)
|
||||||
|
|
||||||
import Common
|
import Common
|
||||||
import qualified Git
|
import qualified Git
|
||||||
|
@ -45,12 +46,22 @@ newtype Annex a = Annex { runAnnex :: StateT AnnexState IO a }
|
||||||
deriving (
|
deriving (
|
||||||
Monad,
|
Monad,
|
||||||
MonadIO,
|
MonadIO,
|
||||||
MonadControlIO,
|
|
||||||
MonadState AnnexState,
|
MonadState AnnexState,
|
||||||
Functor,
|
Functor,
|
||||||
Applicative
|
Applicative
|
||||||
)
|
)
|
||||||
|
|
||||||
|
instance MonadBase IO Annex where
|
||||||
|
liftBase = Annex . liftBase
|
||||||
|
|
||||||
|
instance MonadBaseControl IO Annex where
|
||||||
|
newtype StM Annex a = StAnnex (StM (StateT AnnexState IO) a)
|
||||||
|
liftBaseWith f = Annex $ liftBaseWith $ \runInIO ->
|
||||||
|
f $ liftM StAnnex . runInIO . runAnnex
|
||||||
|
restoreM = Annex . restoreM . unStAnnex
|
||||||
|
where
|
||||||
|
unStAnnex (StAnnex st) = st
|
||||||
|
|
||||||
data OutputType = NormalOutput | QuietOutput | JSONOutput
|
data OutputType = NormalOutput | QuietOutput | JSONOutput
|
||||||
|
|
||||||
-- internal state storage
|
-- internal state storage
|
||||||
|
|
|
@ -11,8 +11,8 @@ module Annex.Exception (
|
||||||
throw,
|
throw,
|
||||||
) where
|
) where
|
||||||
|
|
||||||
import Control.Exception.Control (handle)
|
import Control.Exception.Lifted (handle)
|
||||||
import Control.Monad.IO.Control (liftIOOp)
|
import Control.Monad.Trans.Control (liftBaseOp)
|
||||||
import Control.Exception hiding (handle, throw)
|
import Control.Exception hiding (handle, throw)
|
||||||
|
|
||||||
import Common.Annex
|
import Common.Annex
|
||||||
|
@ -20,7 +20,7 @@ import Common.Annex
|
||||||
{- Runs an Annex action, with setup and cleanup both in the IO monad. -}
|
{- Runs an Annex action, with setup and cleanup both in the IO monad. -}
|
||||||
bracketIO :: IO c -> (c -> IO b) -> Annex a -> Annex a
|
bracketIO :: IO c -> (c -> IO b) -> Annex a -> Annex a
|
||||||
bracketIO setup cleanup go =
|
bracketIO setup cleanup go =
|
||||||
liftIOOp (Control.Exception.bracket setup cleanup) (const go)
|
liftBaseOp (Control.Exception.bracket setup cleanup) (const go)
|
||||||
|
|
||||||
{- Throws an exception in the Annex monad. -}
|
{- Throws an exception in the Annex monad. -}
|
||||||
throw :: Control.Exception.Exception e => e -> Annex a
|
throw :: Control.Exception.Exception e => e -> Annex a
|
||||||
|
|
5
debian/changelog
vendored
5
debian/changelog
vendored
|
@ -8,13 +8,14 @@ git-annex (3.20111212) UNRELEASED; urgency=low
|
||||||
* Test suite improvements. Current top-level test coverage: 75%
|
* Test suite improvements. Current top-level test coverage: 75%
|
||||||
* Improve deletion of files from rsync special remotes. Closes: #652849
|
* Improve deletion of files from rsync special remotes. Closes: #652849
|
||||||
* Add --include, which is the same as --not --exclude.
|
* Add --include, which is the same as --not --exclude.
|
||||||
* Can now be built with older git versions (before 1.7.7); the resulting
|
|
||||||
binary should only be used with old git.
|
|
||||||
* Format strings can be specified using the new --format option, to control
|
* Format strings can be specified using the new --format option, to control
|
||||||
what is output by git annex find.
|
what is output by git annex find.
|
||||||
* Support git annex find --json
|
* Support git annex find --json
|
||||||
* Fixed behavior when multiple insteadOf configs are provided for the
|
* Fixed behavior when multiple insteadOf configs are provided for the
|
||||||
same url base.
|
same url base.
|
||||||
|
* Can now be built with older git versions (before 1.7.7); the resulting
|
||||||
|
binary should only be used with old git.
|
||||||
|
* Updated to build with monad-control 0.3.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Mon, 12 Dec 2011 01:57:49 -0400
|
-- Joey Hess <joeyh@debian.org> Mon, 12 Dec 2011 01:57:49 -0400
|
||||||
|
|
||||||
|
|
3
debian/control
vendored
3
debian/control
vendored
|
@ -13,7 +13,8 @@ Build-Depends:
|
||||||
libghc-utf8-string-dev,
|
libghc-utf8-string-dev,
|
||||||
libghc-hs3-dev (>= 0.5.6),
|
libghc-hs3-dev (>= 0.5.6),
|
||||||
libghc-testpack-dev [any-i386 any-amd64],
|
libghc-testpack-dev [any-i386 any-amd64],
|
||||||
libghc-monad-control-dev,
|
libghc-monad-control-dev (>= 0.3),
|
||||||
|
libghc-lifted-base-dev,
|
||||||
libghc-json-dev,
|
libghc-json-dev,
|
||||||
ikiwiki,
|
ikiwiki,
|
||||||
perlmagick,
|
perlmagick,
|
||||||
|
|
|
@ -25,6 +25,7 @@ To build and use git-annex, you will need:
|
||||||
* [SHA](http://hackage.haskell.org/package/SHA)
|
* [SHA](http://hackage.haskell.org/package/SHA)
|
||||||
* [dataenc](http://hackage.haskell.org/package/dataenc)
|
* [dataenc](http://hackage.haskell.org/package/dataenc)
|
||||||
* [monad-control](http://hackage.haskell.org/package/monad-control)
|
* [monad-control](http://hackage.haskell.org/package/monad-control)
|
||||||
|
* [lifted-base](http://hackage.haskell.org/package/lifted-base)
|
||||||
* [TestPack](http://hackage.haskell.org/cgi-bin/hackage-scripts/package/testpack)
|
* [TestPack](http://hackage.haskell.org/cgi-bin/hackage-scripts/package/testpack)
|
||||||
* [QuickCheck 2](http://hackage.haskell.org/package/QuickCheck)
|
* [QuickCheck 2](http://hackage.haskell.org/package/QuickCheck)
|
||||||
* [HTTP](http://hackage.haskell.org/package/HTTP)
|
* [HTTP](http://hackage.haskell.org/package/HTTP)
|
||||||
|
|
|
@ -5,3 +5,5 @@ Git-annex doesn't compile with the latest version of monad-control. Would it be
|
||||||
>
|
>
|
||||||
> There is now a branch in git called `new-monad-control` that will build
|
> There is now a branch in git called `new-monad-control` that will build
|
||||||
> with the new monad-control. --[[Joey]]
|
> with the new monad-control. --[[Joey]]
|
||||||
|
|
||||||
|
>> Now merged to master. [[done]] --[[Joey]]
|
||||||
|
|
|
@ -30,8 +30,8 @@ Executable git-annex
|
||||||
Main-Is: git-annex.hs
|
Main-Is: git-annex.hs
|
||||||
Build-Depends: MissingH, hslogger, directory, filepath,
|
Build-Depends: MissingH, hslogger, directory, filepath,
|
||||||
unix, containers, utf8-string, network, mtl, bytestring, old-locale, time,
|
unix, containers, utf8-string, network, mtl, bytestring, old-locale, time,
|
||||||
pcre-light, extensible-exceptions, dataenc, SHA, process, hS3, HTTP,
|
pcre-light, extensible-exceptions, dataenc, SHA, process, hS3, json, HTTP,
|
||||||
base < 5, monad-control < 0.3, json
|
base < 5, monad-control, transformers-base, lifted-base
|
||||||
|
|
||||||
Executable git-annex-shell
|
Executable git-annex-shell
|
||||||
Main-Is: git-annex-shell.hs
|
Main-Is: git-annex-shell.hs
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue