Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data PatchInfo = PatchInfo {
- _piDate :: !ByteString
- _piName :: !ByteString
- _piAuthor :: !ByteString
- _piLog :: ![ByteString]
- isInverted :: !Bool
- rawPatchInfo :: String -> String -> String -> [String] -> Bool -> PatchInfo
- patchinfo :: String -> String -> String -> [String] -> IO PatchInfo
- invertName :: PatchInfo -> PatchInfo
- addJunk :: PatchInfo -> IO PatchInfo
- makePatchname :: PatchInfo -> SHA1
- readPatchInfo :: ParserM m => m PatchInfo
- justName :: PatchInfo -> String
- justAuthor :: PatchInfo -> String
- justLog :: PatchInfo -> String
- displayPatchInfo :: PatchInfo -> Doc
- toXml :: PatchInfo -> Doc
- toXmlShort :: PatchInfo -> Doc
- piDate :: PatchInfo -> CalendarTime
- setPiDate :: String -> PatchInfo -> PatchInfo
- piDateString :: PatchInfo -> String
- piName :: PatchInfo -> String
- piRename :: PatchInfo -> String -> PatchInfo
- piAuthor :: PatchInfo -> String
- piTag :: PatchInfo -> Maybe String
- piLog :: PatchInfo -> [String]
- showPatchInfo :: ShowPatchFor -> PatchInfo -> Doc
- isTag :: PatchInfo -> Bool
- escapeXML :: String -> Doc
- validDate :: String -> Bool
- validLog :: String -> Bool
- validAuthor :: String -> Bool
- validDatePS :: ByteString -> Bool
- validLogPS :: ByteString -> Bool
- validAuthorPS :: ByteString -> Bool
Documentation
A PatchInfo value contains the metadata of a patch. The date, name, author and log fields are UTF-8 encoded text in darcs 2.4 and later, and just sequences of bytes (decoded with whatever is the locale when displayed) in earlier darcs.
The members with names that start with '_' are not supposed to be used directly in code that does not care how the patch info is stored.
PatchInfo | |
|
patchinfo :: String -> String -> String -> [String] -> IO PatchInfo Source #
patchinfo date name author log
constructs a new PatchInfo
value
with the given details, automatically assigning an Ignore-this header
to guarantee the patch is unique. The function does not verify
the date string's sanity.
invertName :: PatchInfo -> PatchInfo Source #
addJunk :: PatchInfo -> IO PatchInfo Source #
addJunk adds a line that contains a random number to make the patch unique.
makePatchname :: PatchInfo -> SHA1 Source #
Hash on patch metadata (patch name, author, date, log, and "inverted" flag. Robust against context changes but does not garantee patch contents. Usually used as matcher or patch identifier (see Darcs.Patch.Match).
readPatchInfo :: ParserM m => m PatchInfo Source #
Parser for PatchInfo
as stored in patch bundles and inventory files,
for example:
[Document the foo interface John Doe <john.doe@example.com>**20110615084241 Ignore-this: 85b94f67d377c4ab671101266ef9c229 Nobody knows what a 'foo' is, so describe it. ]
See showPatchInfo
for the inverse operation.
justName :: PatchInfo -> String Source #
Get the name, including an "UNDO: " prefix if the patch is inverted.
justAuthor :: PatchInfo -> String Source #
Returns the author of a patch.
displayPatchInfo :: PatchInfo -> Doc Source #
toXmlShort :: PatchInfo -> Doc Source #
piDate :: PatchInfo -> CalendarTime Source #
piDateString :: PatchInfo -> String Source #
piName :: PatchInfo -> String Source #
Returns the name of the patch. Unlike justName
, it does not preprend
"UNDO: " to the name if the patch is inverted.
showPatchInfo :: ShowPatchFor -> PatchInfo -> Doc Source #
validAuthor :: String -> Bool Source #
validDatePS :: ByteString -> Bool Source #
validLogPS :: ByteString -> Bool Source #
validAuthorPS :: ByteString -> Bool Source #