| Safe Haskell | Safe-Infered |
|---|
Darcs.Repository.Internal
- data Repository p wRecordedstate wUnrecordedstate wTentativestate = Repo !String ![DarcsFlag] !RepoFormat !(RepoType p)
- data RepoType p = DarcsRepository !Pristine Cache
- data RepoJob a
- = RepoJob (forall p wR wU. (RepoPatch p, ApplyState p ~ Tree, ApplyState (PrimOf p) ~ Tree) => Repository p wR wU wR -> IO a)
- | V1Job (forall wR wU. Repository (Patch Prim) wR wU wR -> IO a)
- | V2Job (forall wR wU. Repository (RealPatch Prim) wR wU wR -> IO a)
- maybeIdentifyRepository :: [DarcsFlag] -> String -> IO (IdentifyRepo p wR wU wT)
- identifyDarcsRepository :: forall p wR wU wT. [DarcsFlag] -> String -> IO (Repository p wR wU wT)
- identifyRepositoryFor :: forall p wR wU wT. RepoPatch p => Repository p wR wU wT -> String -> IO (Repository p wR wU wT)
- data IdentifyRepo p wR wU wT
- = BadRepository String
- | NonRepository String
- | GoodRepository (Repository p wR wU wT)
- findRepository :: [DarcsFlag] -> IO (Either String ())
- amInRepository :: [DarcsFlag] -> IO (Either String ())
- amNotInRepository :: [DarcsFlag] -> IO (Either String ())
- amInHashedRepository :: [DarcsFlag] -> IO (Either String ())
- revertRepositoryChanges :: RepoPatch p => Repository p wR wU wT -> IO ()
- announceMergeConflicts :: (PrimPatch p, PatchInspect p) => String -> [DarcsFlag] -> FL p wX wY -> IO Bool
- setTentativePending :: forall p wR wU wT wX wY. RepoPatch p => Repository p wR wU wT -> FL (PrimOf p) wX wY -> IO ()
- checkUnrecordedConflicts :: forall p wT wY. RepoPatch p => [DarcsFlag] -> FL (Named p) wT wY -> IO Bool
- readRepo :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> IO (PatchSet p Origin wR)
- readTentativeRepo :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> IO (PatchSet p Origin wT)
- readRepoUsingSpecificInventory :: (RepoPatch p, ApplyState p ~ Tree) => String -> Repository p wR wU wT -> IO (PatchSet p Origin wT)
- prefsUrl :: Repository p wR wU wT -> String
- makePatchLazy :: RepoPatch p => Repository p wR wU wT -> PatchInfoAnd p wX wY -> IO (PatchInfoAnd p wX wY)
- withRecorded :: RepoPatch p => Repository p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
- withTentative :: forall p a wR wU wT. (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
- withRepoLock :: [DarcsFlag] -> RepoJob a -> IO a
- withRepoReadLock :: [DarcsFlag] -> RepoJob a -> IO a
- withRepository :: [DarcsFlag] -> RepoJob a -> IO a
- withRepositoryDirectory :: [DarcsFlag] -> String -> RepoJob a -> IO a
- withGutsOf :: Repository p wR wU wT -> IO a -> IO a
- tentativelyAddPatch :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> Compression -> PatchInfoAnd p wT wY -> IO (Repository p wR wU wY)
- tentativelyRemovePatches :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> Compression -> FL (PatchInfoAnd p) wX wT -> IO (Repository p wR wU wX)
- tentativelyAddToPending :: forall p wR wU wT wX wY. RepoPatch p => Repository p wR wU wT -> [DarcsFlag] -> FL (PrimOf p) wX wY -> IO ()
- tentativelyAddPatch_ :: (RepoPatch p, ApplyState p ~ Tree) => UpdatePristine -> Repository p wR wU wT -> Compression -> PatchInfoAnd p wT wY -> IO (Repository p wR wU wY)
- tentativelyReplacePatches :: forall p wR wU wT wX. (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> Compression -> FL (PatchInfoAnd p) wX wT -> IO ()
- finalizeRepositoryChanges :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> IO ()
- unrevertUrl :: Repository p wR wU wT -> String
- applyToWorking :: (ApplyState (PrimOf p) ~ Tree, RepoPatch p) => Repository p wR wU wT -> [DarcsFlag] -> FL (PrimOf p) wU wY -> IO (Repository p wR wY wT)
- patchSetToPatches :: RepoPatch p => PatchSet p wX wY -> FL (Named p) wX wY
- createPristineDirectoryTree :: RepoPatch p => Repository p wR wU wT -> FilePath -> IO ()
- createPartialsPristineDirectoryTree :: (FilePathLike fp, RepoPatch p) => Repository p wR wU wT -> [fp] -> FilePath -> IO ()
- reorderInventory :: (RepoPatch p, ApplyState p ~ Tree) => [DarcsFlag] -> Repository p wR wU wR -> IO ()
- cleanRepository :: RepoPatch p => Repository p wR wU wT -> IO ()
- makeScriptsExecutable :: Patchy p => [DarcsFlag] -> p wX wY -> IO ()
- setScriptsExecutable :: IO ()
- setScriptsExecutablePatches :: Patchy p => p wX wY -> IO ()
- data UpdatePristine
- data MakeChanges
- applyToTentativePristine :: (ApplyState q ~ Tree, Effect q, Patchy q, PrimPatchBase q) => Repository p wR wU wT -> q wT wY -> IO ()
- makeNewPending :: forall p wR wU wT wY. (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> FL (PrimOf p) wT wY -> IO ()
- seekRepo :: IO (Maybe (Either String ()))
Documentation
data Repository p wRecordedstate wUnrecordedstate wTentativestate
Constructors
| Repo !String ![DarcsFlag] !RepoFormat !(RepoType p) |
Instances
| Show (Repository p wRecordedstate wUnrecordedstate wTentativestate) |
data RepoJob a
Constructors
| RepoJob (forall p wR wU. (RepoPatch p, ApplyState p ~ Tree, ApplyState (PrimOf p) ~ Tree) => Repository p wR wU wR -> IO a) | |
| V1Job (forall wR wU. Repository (Patch Prim) wR wU wR -> IO a) | |
| V2Job (forall wR wU. Repository (RealPatch Prim) wR wU wR -> IO a) |
maybeIdentifyRepository :: [DarcsFlag] -> String -> IO (IdentifyRepo p wR wU wT)
Tries to identify the repository in a given directory
identifyDarcsRepository :: forall p wR wU wT. [DarcsFlag] -> String -> IO (Repository p wR wU wT)
identifyDarcsRepository identifies the repo at url. Warning:
you have to know what kind of patches are found in that repo.
identifyRepositoryFor :: forall p wR wU wT. RepoPatch p => Repository p wR wU wT -> String -> IO (Repository p wR wU wT)
identifyRepositoryFor repo url identifies (and returns) the repo at url,
but fails if it is not compatible for reading from and writing to.
data IdentifyRepo p wR wU wT
The status of a given directory: is it a darcs repository?
Constructors
| BadRepository String | looks like a repository with some error |
| NonRepository String | safest guess |
| GoodRepository (Repository p wR wU wT) |
findRepository :: [DarcsFlag] -> IO (Either String ())
amInRepository :: [DarcsFlag] -> IO (Either String ())
amNotInRepository :: [DarcsFlag] -> IO (Either String ())
amInHashedRepository :: [DarcsFlag] -> IO (Either String ())
revertRepositoryChanges :: RepoPatch p => Repository p wR wU wT -> IO ()
announceMergeConflicts :: (PrimPatch p, PatchInspect p) => String -> [DarcsFlag] -> FL p wX wY -> IO Bool
setTentativePending :: forall p wR wU wT wX wY. RepoPatch p => Repository p wR wU wT -> FL (PrimOf p) wX wY -> IO ()
setTentativePending is basically unsafe. It overwrites the pending state with a new one, not related to the repository state.
checkUnrecordedConflicts :: forall p wT wY. RepoPatch p => [DarcsFlag] -> FL (Named p) wT wY -> IO Bool
readRepo :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> IO (PatchSet p Origin wR)
readTentativeRepo :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> IO (PatchSet p Origin wT)
readRepoUsingSpecificInventory :: (RepoPatch p, ApplyState p ~ Tree) => String -> Repository p wR wU wT -> IO (PatchSet p Origin wT)
prefsUrl :: Repository p wR wU wT -> String
makePatchLazy :: RepoPatch p => Repository p wR wU wT -> PatchInfoAnd p wX wY -> IO (PatchInfoAnd p wX wY)
withRecorded :: RepoPatch p => Repository p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
withTentative :: forall p a wR wU wT. (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> ((AbsolutePath -> IO a) -> IO a) -> (AbsolutePath -> IO a) -> IO a
withRepoLock :: [DarcsFlag] -> RepoJob a -> IO a
apply a given RepoJob to a repository in the current working directory, taking a lock
withRepoReadLock :: [DarcsFlag] -> RepoJob a -> IO a
apply a given RepoJob to a repository in the current working directory, taking a lock only if the repository is old-fashioned
withRepository :: [DarcsFlag] -> RepoJob a -> IO a
apply a given RepoJob to a repository in the current working directory
withRepositoryDirectory :: [DarcsFlag] -> String -> RepoJob a -> IO a
apply a given RepoJob to a repository in a given url
withGutsOf :: Repository p wR wU wT -> IO a -> IO a
withGutsOf makes darcs more interrumptable with hashed repositories
tentativelyAddPatch :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> Compression -> PatchInfoAnd p wT wY -> IO (Repository p wR wU wY)
tentativelyRemovePatches :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> Compression -> FL (PatchInfoAnd p) wX wT -> IO (Repository p wR wU wX)
tentativelyAddToPending :: forall p wR wU wT wX wY. RepoPatch p => Repository p wR wU wT -> [DarcsFlag] -> FL (PrimOf p) wX wY -> IO ()
This fuction is unsafe because it accepts a patch that works on the tentative pending and we don't currently track the state of the tentative pending.
tentativelyAddPatch_ :: (RepoPatch p, ApplyState p ~ Tree) => UpdatePristine -> Repository p wR wU wT -> Compression -> PatchInfoAnd p wT wY -> IO (Repository p wR wU wY)
tentativelyReplacePatches :: forall p wR wU wT wX. (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> Compression -> FL (PatchInfoAnd p) wX wT -> IO ()
finalizeRepositoryChanges :: (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> IO ()
unrevertUrl :: Repository p wR wU wT -> String
applyToWorking :: (ApplyState (PrimOf p) ~ Tree, RepoPatch p) => Repository p wR wU wT -> [DarcsFlag] -> FL (PrimOf p) wU wY -> IO (Repository p wR wY wT)
patchSetToPatches :: RepoPatch p => PatchSet p wX wY -> FL (Named p) wX wY
createPristineDirectoryTree :: RepoPatch p => Repository p wR wU wT -> FilePath -> IO ()
createPartialsPristineDirectoryTree :: (FilePathLike fp, RepoPatch p) => Repository p wR wU wT -> [fp] -> FilePath -> IO ()
Used by the commands dist and diff
reorderInventory :: (RepoPatch p, ApplyState p ~ Tree) => [DarcsFlag] -> Repository p wR wU wR -> IO ()
Writes out a fresh copy of the inventory that minimizes the amount of inventory that need be downloaded when people pull from the repository.
Specifically, it breaks up the inventory on the most recent tag. This speeds up most commands when run remotely, both because a smaller file needs to be transfered (only the most recent inventory). It also gives a guarantee that all the patches prior to a given tag are included in that tag, so less commutation and history traversal is needed. This latter issue can become very important in large repositories.
cleanRepository :: RepoPatch p => Repository p wR wU wT -> IO ()
makeScriptsExecutable :: Patchy p => [DarcsFlag] -> p wX wY -> IO ()
setScriptsExecutable :: IO ()
setScriptsExecutablePatches :: Patchy p => p wX wY -> IO ()
applyToTentativePristine :: (ApplyState q ~ Tree, Effect q, Patchy q, PrimPatchBase q) => Repository p wR wU wT -> q wT wY -> IO ()
makeNewPending :: forall p wR wU wT wY. (RepoPatch p, ApplyState p ~ Tree) => Repository p wR wU wT -> FL (PrimOf p) wT wY -> IO ()
seekRepo :: IO (Maybe (Either String ()))
hunt upwards for the darcs repository This keeps changing up one parent directory, testing at each step if the current directory is a repository or not. $ The result is: Nothing, if no repository found Just (Left errorMessage), if bad repository found Just (Right ()), if good repository found. WARNING this changes the current directory for good if matchFn succeeds