Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data TransactionIdLookup
- data TransactionIdHeadBacktrack
- data TransactionGraphOperator
- isCommit :: TransactionGraphOperator -> Bool
- data ROTransactionGraphOperator = ShowGraph
- bootstrapTransactionGraph :: UTCTime -> TransactionId -> DatabaseContext -> TransactionGraph
- emptyTransactionGraph :: TransactionGraph
- transactionForHead :: HeadName -> TransactionGraph -> Maybe Transaction
- headList :: TransactionGraph -> [(HeadName, TransactionId)]
- headNameForTransaction :: Transaction -> TransactionGraph -> Maybe HeadName
- transactionForId :: TransactionId -> TransactionGraph -> Either RelationalError Transaction
- transactionsForIds :: Set TransactionId -> TransactionGraph -> Either RelationalError (Set Transaction)
- isRootTransaction :: Transaction -> TransactionGraph -> Bool
- parentTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction)
- childTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction)
- addBranch :: UTCTime -> TransactionId -> HeadName -> TransactionId -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph)
- addDisconnectedTransaction :: UTCTime -> TransactionId -> HeadName -> DisconnectedTransaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph)
- addTransactionToGraph :: HeadName -> Transaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph)
- validateGraph :: TransactionGraph -> Maybe [RelationalError]
- walkParentTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError
- walkChildTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError
- evalGraphOp :: UTCTime -> TransactionId -> DisconnectedTransaction -> TransactionGraph -> TransactionGraphOperator -> Either RelationalError (DisconnectedTransaction, TransactionGraph)
- graphAsRelation :: DisconnectedTransaction -> TransactionGraph -> Either RelationalError Relation
- transactionParentsRelation :: Transaction -> TransactionGraph -> Either RelationalError Relation
- createMergeTransaction :: UTCTime -> TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction
- validateHeadName :: HeadName -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction
- subGraphOfFirstCommonAncestor :: TransactionGraph -> TransactionHeads -> Transaction -> Transaction -> Set Transaction -> Either RelationalError TransactionGraph
- pathToTransaction :: TransactionGraph -> Transaction -> Transaction -> Set Transaction -> Either RelationalError (Set Transaction)
- mergeTransactions :: UTCTime -> TransactionId -> TransactionId -> MergeStrategy -> (HeadName, HeadName) -> TransactionGraph -> Either RelationalError (DisconnectedTransaction, TransactionGraph)
- showTransactionStructureX :: Transaction -> TransactionGraph -> String
- showGraphStructureX :: TransactionGraph -> String
- filterSubGraph :: TransactionGraph -> TransactionHeads -> Either RelationalError TransactionGraph
- createUnionMergeTransaction :: UTCTime -> TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction
- lookupTransaction :: TransactionGraph -> TransactionIdLookup -> Either RelationalError Transaction
- traverseGraph :: TransactionGraph -> TransactionId -> [TransactionIdHeadBacktrack] -> Either RelationalError TransactionId
- backtrackGraph :: TransactionGraph -> TransactionId -> TransactionIdHeadBacktrack -> Either RelationalError TransactionId
- autoMergeToHead :: UTCTime -> (TransactionId, TransactionId, TransactionId) -> DisconnectedTransaction -> HeadName -> MergeStrategy -> TransactionGraph -> Either RelationalError (DisconnectedTransaction, TransactionGraph)
Documentation
data TransactionIdLookup Source #
Record a lookup for a specific transaction in the graph.
Instances
data TransactionIdHeadBacktrack Source #
Used for git-style head backtracking such as topic~3^2.
TransactionIdHeadParentBacktrack Int | git equivalent of ~: walk back n parents, arbitrarily choosing a parent when a choice must be made |
TransactionIdHeadBranchBacktrack Int | git equivalent of ^: walk back one parent level to the nth arbitrarily-chosen parent |
TransactionStampHeadBacktrack UTCTime | git equivalent of 'git-rev-list -n 1 --before X' find the first transaction which was created before the timestamp |
Instances
data TransactionGraphOperator Source #
Operators which manipulate a transaction graph and which transaction the current Session
is based upon.
JumpToHead HeadName | |
JumpToTransaction TransactionId | |
WalkBackToTime UTCTime | |
Branch HeadName | |
DeleteBranch HeadName | |
MergeTransactions MergeStrategy HeadName HeadName | |
Commit | |
Rollback |
Instances
data ROTransactionGraphOperator Source #
Instances
Show ROTransactionGraphOperator Source # | |
Defined in ProjectM36.TransactionGraph showsPrec :: Int -> ROTransactionGraphOperator -> ShowS # show :: ROTransactionGraphOperator -> String # showList :: [ROTransactionGraphOperator] -> ShowS # |
bootstrapTransactionGraph :: UTCTime -> TransactionId -> DatabaseContext -> TransactionGraph Source #
headList :: TransactionGraph -> [(HeadName, TransactionId)] Source #
transactionForId :: TransactionId -> TransactionGraph -> Either RelationalError Transaction Source #
transactionsForIds :: Set TransactionId -> TransactionGraph -> Either RelationalError (Set Transaction) Source #
isRootTransaction :: Transaction -> TransactionGraph -> Bool Source #
parentTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction) Source #
childTransactions :: Transaction -> TransactionGraph -> Either RelationalError (Set Transaction) Source #
addBranch :: UTCTime -> TransactionId -> HeadName -> TransactionId -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph) Source #
addDisconnectedTransaction :: UTCTime -> TransactionId -> HeadName -> DisconnectedTransaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph) Source #
addTransactionToGraph :: HeadName -> Transaction -> TransactionGraph -> Either RelationalError (Transaction, TransactionGraph) Source #
walkParentTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError Source #
walkChildTransactions :: Set TransactionId -> TransactionGraph -> Transaction -> Maybe RelationalError Source #
evalGraphOp :: UTCTime -> TransactionId -> DisconnectedTransaction -> TransactionGraph -> TransactionGraphOperator -> Either RelationalError (DisconnectedTransaction, TransactionGraph) Source #
graphAsRelation :: DisconnectedTransaction -> TransactionGraph -> Either RelationalError Relation Source #
transactionParentsRelation :: Transaction -> TransactionGraph -> Either RelationalError Relation Source #
createMergeTransaction :: UTCTime -> TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction Source #
Execute the merge strategy against the transactions, returning a new transaction which can be then added to the transaction graph
validateHeadName :: HeadName -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction Source #
Returns the correct Transaction for the branch name in the graph and ensures that it is one of the two transaction arguments in the tuple.
subGraphOfFirstCommonAncestor :: TransactionGraph -> TransactionHeads -> Transaction -> Transaction -> Set Transaction -> Either RelationalError TransactionGraph Source #
pathToTransaction :: TransactionGraph -> Transaction -> Transaction -> Set Transaction -> Either RelationalError (Set Transaction) Source #
Search from a past graph point to all following heads for a specific transaction. If found, return the transaction path, otherwise a RelationalError.
mergeTransactions :: UTCTime -> TransactionId -> TransactionId -> MergeStrategy -> (HeadName, HeadName) -> TransactionGraph -> Either RelationalError (DisconnectedTransaction, TransactionGraph) Source #
filterSubGraph :: TransactionGraph -> TransactionHeads -> Either RelationalError TransactionGraph Source #
After splicing out a subgraph, run it through this function to remove references to transactions which are not in the subgraph.
createUnionMergeTransaction :: UTCTime -> TransactionId -> MergeStrategy -> TransactionGraph -> (Transaction, Transaction) -> Either MergeError Transaction Source #
lookupTransaction :: TransactionGraph -> TransactionIdLookup -> Either RelationalError Transaction Source #
traverseGraph :: TransactionGraph -> TransactionId -> [TransactionIdHeadBacktrack] -> Either RelationalError TransactionId Source #
backtrackGraph :: TransactionGraph -> TransactionId -> TransactionIdHeadBacktrack -> Either RelationalError TransactionId Source #
autoMergeToHead :: UTCTime -> (TransactionId, TransactionId, TransactionId) -> DisconnectedTransaction -> HeadName -> MergeStrategy -> TransactionGraph -> Either RelationalError (DisconnectedTransaction, TransactionGraph) Source #
Create a temporary branch for commit, merge the result to head, delete the temporary branch. This is useful to atomically commit a transaction, avoiding a TransactionIsNotHeadError but trading it for a potential MergeError. this is not a GraphOp because it combines multiple graph operations