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

Safe HaskellNone

Darcs.Repository.HashedRepo

Synopsis

Documentation

revertTentativeChanges :: IO ()

revertTentativeChanges swaps the tentative and real hashed inventory files, and then updates the tentative pristine with the real inventory hash.

finalizeTentativeChanges :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> Compression -> IO ()

finalizeTentativeChanges trys to atomically swap the tentative inventory/pristine pointers with the real pointers; it first re-reads the inventory to optimize it, presumably to take account of any new tags, and then writes out the new tentative inventory, and finally does the atomic swap. In general, we can't clean the pristine cache at the same time, since a simultaneous get might be in progress.

cleanPristine :: Repository rt p wR wU wT -> IO ()

cleanPristine removes any obsolete (unreferenced) entries in the pristine cache.

filterDirContents :: FilePath -> (FilePath -> Bool) -> IO [FilePath]

filterDirContents returns the contents of the directory d except files whose names begin with . (directories . and .., hidden files) and files whose names are filtered by the function f, if dir is empty, no paths are returned.

cleanInventories :: Repository rt p wR wU wT -> IO ()

cleanInventories removes any obsolete (unreferenced) files in the inventories directory.

cleanPatches :: Repository rt p wR wU wT -> IO ()

cleanPatches removes any obsolete (unreferenced) files in the patches directory.

copyPristine :: Cache -> String -> String -> WithWorkingDir -> IO ()

copyPristine copies a pristine tree into the current pristine dir, and possibly copies a clean working copy. The target is read from the passed-in dir/inventory name combination.

copyPartialsPristine :: FilePathLike fp => Cache -> String -> String -> [fp] -> IO ()

copyPartialsPristine copies the pristine entries for a given list of filepaths.

applyToTentativePristine :: (ApplyState p ~ Tree, Patchy p) => p wX wY -> IO ()

applyToTentativePristine applies a patch p to the tentative pristine tree, and updates the tentative pristine hash

addToSpecificInventory :: RepoPatch p => String -> Cache -> Compression -> PatchInfoAnd rt p wX wY -> IO FilePath

addToSpecificInventory adds a patch to a specific inventory file, and returns the FilePath whichs corresponds to the written-out patch.

removeFromTentativeInventory :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> Compression -> FL (PatchInfoAnd rt p) wX wT -> IO ()

Attempt to remove an FL of patches from the tentative inventory. This is used for commands that wish to modify already-recorded patches.

Precondition: it must be possible to remove the patches, i.e.

  • the patches are in the repository
  • any necessary commutations will succeed

readRepo :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> String -> IO (PatchSet rt p Origin wR)

readRepo returns the current repo patchset.

readTentativeRepo :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> String -> IO (PatchSet rt p Origin wT)

readRepo returns the tentative repo patchset.

readRepoUsingSpecificInventory :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => String -> Repository rt p wR wU wT -> String -> IO (PatchSet rt p Origin wS)

readRepoUsingSpecificInventory uses the inventory at invPath to read the repository repo.

writeAndReadPatch :: (IsRepoType rt, RepoPatch p) => Cache -> Compression -> PatchInfoAnd rt p wX wY -> IO (PatchInfoAnd rt p wX wY)

writeAndReadPatch makes a patch lazy, by writing it out to disk (thus forcing it), and then re-reads the patch lazily.

writeTentativeInventory :: RepoPatch p => Cache -> Compression -> PatchSet rt p Origin wX -> IO ()

writeTentativeInventory writes patchSet as the tentative inventory.

copyHashedInventory :: RepoPatch p => Repository rt p wR wU wT -> RemoteDarcs -> String -> IO ()

copyRepo copies the hashed inventory of repo to the repository located at remote.

readHashedPristineRoot :: Repository rt p wR wU wT -> IO (Maybe String)

readHashedPristineRoot attempts to read the pristine hash from the current inventory, returning Nothing if it cannot do so.

pris2inv :: String -> ByteString -> Doc

pris2inv takes an updated pristine hash and an inventory, and outputs the new pristine hash followed by the original inventory (having skipped the old inventory hash).

inv2pris :: ByteString -> String

inv2pris takes the content of an inventory, and extracts the corresponding pristine hash from the inventory (the hash is prefixed by pristine:).

listInventories :: IO [String]

listInventories returns a list of the inventories hashes. This function attempts to retrieve missing inventory files.

listInventoriesLocal :: IO [String]

listInventoriesLocal returns a list of the inventories hashes. This function does not attempt to retrieve missing inventory files.

listInventoriesRepoDir :: String -> IO [String]

listInventoriesRepoDir returns a list of the inventories hashes. The argument repoDir is the directory of the repository from which we are going to read the hashed_inventory file. The rest of hashed files are read from the global cache.

listPatchesLocalBucketed :: String -> String -> IO [String]

listPatchesLocalBucketed is similar to listPatchesLocal, but it read the inventory directory under darcsDir in bucketed format.

writePatchIfNecessary :: RepoPatch p => Cache -> Compression -> PatchInfoAnd rt p wX wY -> IO (PatchInfo, String)

writeHashIfNecessary writes the patch and returns the resulting info/hash, if it has not already been written. If it has been written, we have the hash in the PatchInfoAnd, so we extract and return the info/hash.

readRepoFromInventoryList :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => Cache -> (Maybe String, [(PatchInfo, String)]) -> IO (SealedPatchSet rt p Origin)

readRepoFromInventoryList allows the caller to provide an optional from inventory hash, and a list of info/hash pairs that identify a list of patches, returning a patchset of the resulting repo.

readPatchIds :: ByteString -> [(PatchInfo, String)]

'readPatchIds inventory' parses the content of a hashed_inventory file after the pristine: and Starting with inventory: header lines have been removed. The second value in the resulting tuples is the file hash of the associated patch (the hash: line).

set :: [String] -> Set ByteString

set converts a list of strings into a set of Char8 ByteStrings for faster Set operations.

unset :: Set ByteString -> [String]

unset is the inverse of set.