darcs-2.18.2: a distributed, interactive, smart revision control system

Safe Haskell | None
Language | Haskell2010

Darcs.Repository.Job

Synopsis

- data RepoJob (rt :: AccessType) a
  - = RepoJob (TreePatchJob rt a)
  - | V1Job (V1PatchJob rt a)
  - | V2Job (V2PatchJob rt a)
  - | PrimV1Job (PrimV1PatchJob rt a)
  - | OldRebaseJob (TreePatchJob rt a)
- class IsPrimV1 (p :: Type -> Type -> Type) where
  - toPrimV1 :: p wX wY -> Prim wX wY
- withRepoLock :: UseCache -> UMask -> RepoJob 'RW a -> IO a
- withOldRepoLock :: RepoJob 'RW a -> IO a
- withRepoLockCanFail :: UseCache -> RepoJob 'RO () -> IO ()
- withRepository :: UseCache -> RepoJob 'RO a -> IO a
- withRepositoryLocation :: UseCache -> String -> RepoJob 'RO a -> IO a
- withUMaskFlag :: UMask -> IO a -> IO a

# Documentation

data RepoJob (rt :: AccessType) a #

A `RepoJob` wraps up an action to be performed with a repository. Because repositories can contain different types of patches, such actions typically need to be polymorphic in the kind of patch they work on. `RepoJob` is used to wrap up the polymorphism, and the various functions that act on a `RepoJob` are responsible for instantiating the underlying action with the appropriate patch type.

Constructors

RepoJob (TreePatchJob rt a) | The most common `RepoJob`; the underlying action can accept any patch whose `ApplyState` is `Tree`.
V1Job (V1PatchJob rt a) | A job that only works on darcs 1 patches
V2Job (V2PatchJob rt a) | A job that only works on darcs 2 patches
PrimV1Job (PrimV1PatchJob rt a) | A job that works on any repository where the patch type `p` has `PrimOf` `p` = `Prim`. This was added to support darcsden, which inspects the internals of V1 prim patches. In future it should be replaced with a more abstract inspection API as part of `PrimPatch`.
OldRebaseJob (TreePatchJob rt a) | A job that works even if there is an old-style rebase in progress.

class IsPrimV1 (p :: Type -> Type -> Type) where #

Methods

toPrimV1 :: p wX wY -> Prim wX wY #

#### Instances

Instances details

IsPrimV1 Prim # |
Instance details Defined in Darcs.Repository.Job Methods toPrimV1 :: Prim wX wY -> Prim wX wY #
IsPrimV1 Prim # |
Instance details Defined in Darcs.Repository.Job Methods toPrimV1 :: Prim wX wY -> Prim wX wY #

withRepoLock :: UseCache -> UMask -> RepoJob 'RW a -> IO a #

Apply a given RepoJob to a repository in the current working directory. However, before doing the job, take the repo lock and initializes a repo transaction.

withOldRepoLock :: RepoJob 'RW a -> IO a #

run a lock-taking job in an old-fashion repository. only used by `darcs optimize upgrade`.

withRepoLockCanFail :: UseCache -> RepoJob 'RO () -> IO () #

Apply a given RepoJob to a repository in the current working directory, taking a lock. If lock not takeable, do nothing. If old-fashioned repository, do nothing. The job must not touch pending or pending.tentative, because there is no call to revertRepositoryChanges. This entry point is currently only used for attemptCreatePatchIndex.

withRepository :: UseCache -> RepoJob 'RO a -> IO a #

apply a given RepoJob to a repository in the current working directory

withRepositoryLocation :: UseCache -> String -> RepoJob 'RO a -> IO a #

apply a given RepoJob to a repository in a given url

withUMaskFlag :: UMask -> IO a -> IO a #