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

Safe Haskell | None
Language | Haskell2010

Darcs.Repository.Format

Synopsis

- newtype RepoFormat = RF [[RepoProperty]]
- data RepoProperty
  - = Darcs1
  - | Darcs2
  - | HashedInventory
  - | NoWorkingDir
  - | RebaseInProgress
  - | UnknownFormat String
- identifyRepoFormat :: String -> IO RepoFormat
- tryIdentifyRepoFormat :: String -> IO (Either String RepoFormat)
- createRepoFormat :: PatchFormat -> WithWorkingDir -> RepoFormat
- writeRepoFormat :: RepoFormat -> FilePath -> IO ()
- writeProblem :: RepoFormat -> Maybe String
- readProblem :: RepoFormat -> Maybe String
- transferProblem :: RepoFormat -> RepoFormat -> Maybe String
- formatHas :: RepoProperty -> RepoFormat -> Bool
- addToFormat :: RepoProperty -> RepoFormat -> RepoFormat
- removeFromFormat :: RepoProperty -> RepoFormat -> RepoFormat

# Documentation

newtype RepoFormat #

Representation of the format of a repository. Each sublist corresponds to a line in the format file. Currently all lines are expected to be singleton words.

Constructors

RF [[RepoProperty]] |

Instances

Show RepoFormat # |
Methods showsPrec :: Int -> RepoFormat -> ShowS # show :: RepoFormat -> String # showList :: [RepoFormat] -> ShowS #

data RepoProperty #

Constructors

Darcs1 |
Darcs2 |
HashedInventory |
NoWorkingDir |
RebaseInProgress |
UnknownFormat String |

Instances

Eq RepoProperty # |
Methods (==) :: RepoProperty -> RepoProperty -> Bool # (/=) :: RepoProperty -> RepoProperty -> Bool #
Show RepoProperty # |
Methods showsPrec :: Int -> RepoProperty -> ShowS # show :: RepoProperty -> String # showList :: [RepoProperty] -> ShowS #

identifyRepoFormat :: String -> IO RepoFormat #

Identify the format of the repository at the given location (directory, URL, or SSH path). Fails if we weren't able to identify the format.

tryIdentifyRepoFormat :: String -> IO (Either String RepoFormat) #

Identify the format of the repository at the given location (directory, URL, or SSH path). Return ``Left` reason` if it fails, where `reason` explains why we weren't able to identify the format. Note that we do no verification of the format, which is handled by `readProblem` or `writeProblem` on the resulting `RepoFormat`.

createRepoFormat :: PatchFormat -> WithWorkingDir -> RepoFormat #

Create a repo format. The first argument is whether to use the old (darcs-1) format; the second says whether the repo has a working tree.

writeRepoFormat :: RepoFormat -> FilePath -> IO () #

Write the repo format to the given file.

writeProblem :: RepoFormat -> Maybe String #

``writeProblem` source` returns `Just` an error message if we cannot write to a repo in format `source`, or `Nothing` if there's no such problem.

readProblem :: RepoFormat -> Maybe String #

``readProblem` source` returns `Just` an error message if we cannot read from a repo in format `source`, or `Nothing` if there's no such problem.

transferProblem :: RepoFormat -> RepoFormat -> Maybe String #

``transferProblem` source target` returns `Just` an error message if we cannot transfer patches from a repo in format `source` to a repo in format `target`, or `Nothing` if there are no such problem.

formatHas :: RepoProperty -> RepoFormat -> Bool #

Is a given property contained within a given format?

addToFormat :: RepoProperty -> RepoFormat -> RepoFormat #

Add a single property to an existing format.

removeFromFormat :: RepoProperty -> RepoFormat -> RepoFormat #

Remove a single property from an existing format.