1
0
Fork 0
mirror of https://code.naskya.net/repos/ndqEd synced 2025-03-20 15:14:54 +09:00
vervis/src/Data/Revision/Local.hs
2016-05-18 07:00:19 +00:00

54 lines
1.5 KiB
Haskell

{- This file is part of Vervis.
-
- Written in 2016 by fr33domlover <fr33domlover@riseup.net>.
-
- ♡ Copying is an act of love. Please copy, reuse and share.
-
- The author(s) have dedicated all copyright and related and neighboring
- rights to this software to the public domain worldwide. This software is
- distributed without any warranty.
-
- You should have received a copy of the CC0 Public Domain Dedication along
- with this software. If not, see
- <http://creativecommons.org/publicdomain/zero/1.0/>.
-}
module Data.Revision.Local
( Change (..)
, Revision (..)
, Version (..)
)
where
import Prelude
import Data.Text (Text)
import Data.Time.Clock (UTCTime)
-- | A recorded patch or tag.
data Change = Change
{ -- | When it was recorded.
cgTime :: UTCTime
-- | Lowercase hex representation of its SHA1 info hash.
, cgHash :: Text
-- | Single-line title.
, cgTitle :: Text
}
-- | Given a non-empty repo, this refers to a point in its history.
data Revision
-- | The last change is a tag.
= RevTag Change
-- | The last change isn't a tag, but a tag exists earlier in the history.
-- Specifies details of the last tag, the number of patches after that tag,
-- and details of the last patch.
| RevTagPlus Change Int Change
-- | There are no recorded tags. Specifies the last patch.
| RevPatch Change
data Version = Version
{ verSharer :: Text
, verRepo :: Text
, verChanges :: Int
, verRevision :: Revision
}