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

Safe HaskellNone
LanguageHaskell2010

Darcs.Repository.Hashed

Synopsis

Documentation

revertTentativeChanges :: IO () Source #

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

revertRepositoryChanges :: RepoPatch p => Repository rt p wR wU wT -> UpdatePending -> IO (Repository rt p wR wU wR) Source #

Slightly confusingly named: as well as throwing away any tentative changes, revertRepositoryChanges also re-initialises the tentative state. It's therefore used before makign any changes to the repo.

finalizeTentativeChanges :: (IsRepoType rt, RepoPatch p) => Repository rt p wR wU wT -> Compression -> IO () Source #

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.

addToTentativeInventory :: RepoPatch p => Cache -> Compression -> PatchInfoAnd rt p wX wY -> IO () Source #

Add (append) a patch to the tentative inventory. | Warning: this allows to add any arbitrary patch! Used by convert import.

readRepo :: (IsRepoType rt, RepoPatch p) => Repository rt p wR wU wT -> IO (PatchSet rt p Origin wR) Source #

Read inventories and patches from a repository and return them as a PatchSet. Note that patches and inventories are read lazily.

readRepoHashed :: (IsRepoType rt, RepoPatch p) => Repository rt p wR wU wT -> String -> IO (PatchSet rt p Origin wR) Source #

readRepo returns the "current" repo patchset.

readTentativeRepo :: (IsRepoType rt, PatchListFormat p, ReadPatch p) => Repository rt p wR wU wT -> String -> IO (PatchSet rt p Origin wT) Source #

readRepo returns the tentative repo patchset.

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

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 () Source #

writeTentativeInventory writes patchSet as the tentative inventory.

copyHashedInventory :: Repository rt p wR wU wT -> RemoteDarcs -> String -> IO () Source #

Copy the hashed inventory from the given location to the given repository, possibly using the given remote darcs binary.

writePatchIfNecessary :: RepoPatch p => Cache -> Compression -> PatchInfoAnd rt p wX wY -> IO InventoryEntry Source #

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.

tentativelyAddPatch :: (RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wT -> Compression -> Verbosity -> UpdatePending -> PatchInfoAnd rt p wT wY -> IO (Repository rt p wR wU wY) Source #

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

tentativelyAddPatches_ :: (RepoPatch p, ApplyState p ~ Tree) => UpdatePristine -> Repository rt p wR wU wT -> Compression -> Verbosity -> UpdatePending -> FL (PatchInfoAnd rt p) wT wY -> IO (Repository rt p wR wU wY) Source #

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

Atomically copy the tentative state to the recorded state, thereby committing the tentative changes that were made so far. This includes inventories, pending, and the index.

reorderInventory :: (IsRepoType rt, RepoPatch p, ApplyState p ~ Tree) => Repository rt p wR wU wR -> Compression -> IO () Source #

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.

repoXor :: (IsRepoType rt, RepoPatch p) => Repository rt p wR wU wR -> IO SHA1 Source #

XOR of all hashes of the patches' metadata. It enables to quickly see whether two repositories have the same patches, independently of their order. It relies on the assumption that the same patch cannot be present twice in a repository. This checksum is not cryptographically secure, see http://robotics.stanford.edu/~xb/crypto06b/ .

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

Upgrade a possible old-style rebase in progress to the new style.