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

Safe Haskell | None
Language | Haskell2010

Darcs.Repository.Inventory.Format

Synopsis

- data Inventory = Inventory {
  - inventoryParent :: Maybe InventoryHash
  - inventoryPatches :: [InventoryEntry]
  }
- type HeadInventory = (PristineHash, Inventory)
- type InventoryEntry = (PatchInfo, PatchHash)
- class (Eq h, IsSizeHash h) => ValidHash h where
  - dirofValidHash :: h -> HashedDir
  - calcValidHash :: ByteString -> h
- decodeValidHash :: ValidHash h => String -> Maybe h
- encodeValidHash :: ValidHash h => h -> String
- data InventoryHash
- data PatchHash
- data PristineHash
- inventoryPatchNames :: Inventory -> [String]
- parseInventory :: ByteString -> Either String Inventory
- parseHeadInventory :: ByteString -> Either String HeadInventory
- showInventory :: Inventory -> Doc
- showInventoryPatches :: [InventoryEntry] -> Doc
- showInventoryEntry :: InventoryEntry -> Doc
- emptyInventory :: Inventory
- pokePristineHash :: PristineHash -> ByteString -> Doc
- peekPristineHash :: ByteString -> PristineHash
- skipPristineHash :: ByteString -> ByteString
- pristineName :: ByteString
- prop_inventoryParseShow :: Inventory -> Bool
- prop_peekPokePristineHash :: (PristineHash, ByteString) -> Bool
- prop_skipPokePristineHash :: (PristineHash, ByteString) -> Bool

# Documentation

data Inventory #

Constructors

Inventory |
Fields inventoryParent :: Maybe InventoryHash inventoryPatches :: [InventoryEntry]

#### Instances

Instances details

Show Inventory # |
Instance details Defined in Darcs.Repository.Inventory.Format Methods showsPrec :: Int -> Inventory -> ShowS # show :: Inventory -> String # showList :: [Inventory] -> ShowS #
Eq Inventory # |
Instance details Defined in Darcs.Repository.Inventory.Format Methods (==) :: Inventory -> Inventory -> Bool # (/=) :: Inventory -> Inventory -> Bool #

type HeadInventory = (PristineHash, Inventory) #

type InventoryEntry = (PatchInfo, PatchHash) #

class (Eq h, IsSizeHash h) => ValidHash h where #

External API for the various hash types.

Minimal complete definition

dirofValidHash

Methods

dirofValidHash :: h -> HashedDir #

The `HashedDir` belonging to this type of hash

calcValidHash :: ByteString -> h #

Compute hash from file content.

#### Instances

Instances details

ValidHash InventoryHash # |
Instance details Defined in Darcs.Util.ValidHash Methods dirofValidHash :: InventoryHash -> HashedDir # calcValidHash :: ByteString -> InventoryHash #
ValidHash PatchHash # |
Instance details Defined in Darcs.Util.ValidHash Methods dirofValidHash :: PatchHash -> HashedDir # calcValidHash :: ByteString -> PatchHash #
ValidHash PristineHash # |
Instance details Defined in Darcs.Util.ValidHash Methods dirofValidHash :: PristineHash -> HashedDir # calcValidHash :: ByteString -> PristineHash #

decodeValidHash :: ValidHash h => String -> Maybe h #

encodeValidHash :: ValidHash h => h -> String #

data InventoryHash #

#### Instances

Instances details

ValidHash InventoryHash # |
Instance details Defined in Darcs.Util.ValidHash Methods dirofValidHash :: InventoryHash -> HashedDir # calcValidHash :: ByteString -> InventoryHash #
Show InventoryHash # |
Instance details Defined in Darcs.Util.ValidHash Methods showsPrec :: Int -> InventoryHash -> ShowS # show :: InventoryHash -> String # showList :: [InventoryHash] -> ShowS #
Eq InventoryHash # |
Instance details Defined in Darcs.Util.ValidHash Methods (==) :: InventoryHash -> InventoryHash -> Bool # (/=) :: InventoryHash -> InventoryHash -> Bool #

data PatchHash #

#### Instances

Instances details

ValidHash PatchHash # |
Instance details Defined in Darcs.Util.ValidHash Methods dirofValidHash :: PatchHash -> HashedDir # calcValidHash :: ByteString -> PatchHash #
Show PatchHash # |
Instance details Defined in Darcs.Util.ValidHash Methods showsPrec :: Int -> PatchHash -> ShowS # show :: PatchHash -> String # showList :: [PatchHash] -> ShowS #
Eq PatchHash # |
Instance details Defined in Darcs.Util.ValidHash Methods (==) :: PatchHash -> PatchHash -> Bool # (/=) :: PatchHash -> PatchHash -> Bool #

data PristineHash #

#### Instances

Instances details

ValidHash PristineHash # |
Instance details Defined in Darcs.Util.ValidHash Methods dirofValidHash :: PristineHash -> HashedDir # calcValidHash :: ByteString -> PristineHash #
Show PristineHash # |
Instance details Defined in Darcs.Util.ValidHash Methods showsPrec :: Int -> PristineHash -> ShowS # show :: PristineHash -> String # showList :: [PristineHash] -> ShowS #
Eq PristineHash # |
Instance details Defined in Darcs.Util.ValidHash Methods (==) :: PristineHash -> PristineHash -> Bool # (/=) :: PristineHash -> PristineHash -> Bool #

inventoryPatchNames :: Inventory -> [String] #

parseInventory :: ByteString -> Either String Inventory #

parseHeadInventory :: ByteString -> Either String HeadInventory #

showInventory :: Inventory -> Doc #

showInventoryPatches :: [InventoryEntry] -> Doc #

showInventoryEntry :: InventoryEntry -> Doc #

emptyInventory :: Inventory #

pokePristineHash :: PristineHash -> ByteString -> Doc #

Replace the pristine hash at the start of a raw, unparsed `HeadInventory` or add it if none is present.

peekPristineHash :: ByteString -> PristineHash #

skipPristineHash :: ByteString -> ByteString #

skipPristineHash drops the 'pristine: HASH' prefix line, if present.

pristineName :: ByteString #

prop_inventoryParseShow :: Inventory -> Bool #

prop_peekPokePristineHash :: (PristineHash, ByteString) -> Bool #

prop_skipPokePristineHash :: (PristineHash, ByteString) -> Bool #