forked from unisonweb/unison
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge trunk and resolve basic conflicts
- Loading branch information
Showing
111 changed files
with
3,901 additions
and
4,126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
codebase2/codebase-sqlite/U/Codebase/Sqlite/ProjectReflog.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{-# LANGUAGE RecordWildCards #-} | ||
{-# LANGUAGE ViewPatterns #-} | ||
|
||
module U.Codebase.Sqlite.ProjectReflog where | ||
|
||
import Data.Text (Text) | ||
import Data.Time (UTCTime) | ||
import U.Codebase.Sqlite.DbId (CausalHashId, ProjectBranchId, ProjectId) | ||
import Unison.Sqlite (FromRow (..), ToRow (..), field) | ||
|
||
data Entry causal = Entry | ||
{ project :: ProjectId, | ||
branch :: ProjectBranchId, | ||
time :: UTCTime, | ||
fromRootCausalHash :: Maybe causal, | ||
toRootCausalHash :: causal, | ||
reason :: Text | ||
} | ||
deriving stock (Show, Functor, Foldable, Traversable) | ||
|
||
instance ToRow (Entry CausalHashId) where | ||
toRow (Entry proj branch time fromRootCausalHash toRootCausalHash reason) = | ||
toRow (proj, branch, time, fromRootCausalHash, toRootCausalHash, reason) | ||
|
||
instance FromRow (Entry CausalHashId) where | ||
fromRow = do | ||
project <- field | ||
branch <- field | ||
time <- field | ||
fromRootCausalHash <- field | ||
toRootCausalHash <- field | ||
reason <- field | ||
pure $ Entry {..} |
Oops, something went wrong.