darcs

Darcs.PopulationData

Synopsis

- data Population = Pop {
  - popState :: PatchInfo
  - popTree :: PopTree
  }
- data PopTree
  - = PopDir !Info ![PopTree]
  - | PopFile !Info
- data Info = Info {
  - nameI :: !ByteString
  - modifiedByI :: !PatchInfo
  - modifiedHowI :: !DirMark
  - createdByI :: !(Maybe PatchInfo)
  - creationNameI :: !(Maybe ByteString)
  }
- setPopState :: PatchInfo -> Population -> Population
- notModified :: Info -> Bool
- setState :: Info -> PatchInfo -> Info
- data DirMark
  - = AddedFile
  - | RemovedFile
  - | MovedFile String
  - | ModifiedFile
  - | DullFile
  - | AddedDir
  - | RemovedDir
  - | MovedDir !String
  - | DullDir
- getPopFrom :: FilePath -> PatchInfo -> IO Population

# Documentation

data Population

the population of a darcs repository (simpler Slurpy)

Constructors

Pop |

Fields

popState :: PatchInfo

  the state when last modified

popTree :: PopTree

  the directory listing

Instances

Eq Population |
Show Population |

data PopTree

directory listing

Constructors

PopDir !Info ![PopTree] |
PopFile !Info |

Instances

Eq PopTree |
Ord PopTree |
Show PopTree |

data Info

Constructors

Info |

Fields

nameI :: !ByteString

  name of the element

modifiedByI :: !PatchInfo

  last patch modifying this element

modifiedHowI :: !DirMark

  how was it modified

createdByI :: !(Maybe PatchInfo)

  this can be unknown when restored backwards!

creationNameI :: !(Maybe ByteString)

  the original name of the element

Instances

Eq Info |
Ord Info |
Show Info |

setPopState :: PatchInfo -> Population -> Population

notModified :: Info -> Bool

was an Info record not modified?

setState :: Info -> PatchInfo -> Info

set the modifier for an Info record

data DirMark

info of a directory member

Constructors

AddedFile |
RemovedFile |
MovedFile String |
ModifiedFile |
DullFile |
AddedDir |
RemovedDir |
MovedDir !String |
DullDir |

Instances

Eq DirMark |
Ord DirMark |
Show DirMark |

getPopFrom :: FilePath -> PatchInfo -> IO Population

read the population from a given directory `dirname` all folders and documents get the given time `t`

This needs to be here in order to avoid a circular dependency between Population and Pristine.