project-m36-0.3: Relational Algebra Engine

Safe HaskellNone
LanguageHaskell2010

ProjectM36.TransactionGraph

Synopsis

Documentation

data TransactionIdLookup Source #

Record a lookup for a specific transaction in the graph.

data TransactionIdHeadBacktrack Source #

Used for git-style head backtracking such as topic~3^2.

Constructors

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

Eq TransactionIdHeadBacktrack Source # 
Show TransactionIdHeadBacktrack Source # 
Generic TransactionIdHeadBacktrack Source # 
Binary TransactionIdHeadBacktrack Source # 
type Rep TransactionIdHeadBacktrack Source # 
type Rep TransactionIdHeadBacktrack = D1 (MetaData "TransactionIdHeadBacktrack" "ProjectM36.TransactionGraph" "project-m36-0.3-6ISpcBZwnv1Gd5svoztbSh" False) ((:+:) (C1 (MetaCons "TransactionIdHeadParentBacktrack" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) ((:+:) (C1 (MetaCons "TransactionIdHeadBranchBacktrack" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 Int))) (C1 (MetaCons "TransactionStampHeadBacktrack" PrefixI False) (S1 (MetaSel (Nothing Symbol) NoSourceUnpackedness NoSourceStrictness DecidedLazy) (Rec0 UTCTime)))))

data TransactionGraphOperator Source #

Operators which manipulate a transaction graph and which transaction the current Session is based upon.

Instances

Eq TransactionGraphOperator Source # 
Show TransactionGraphOperator Source # 
Generic TransactionGraphOperator Source # 
Binary TransactionGraphOperator Source # 
type Rep TransactionGraphOperator 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.

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.

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.

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