1module ProjectM36.TransactionGraph.Show where
3import ProjectM36.TransactionGraph
4import ProjectM36.Transaction
5import qualified Data.Set as S
7showTransactionStructure :: Transaction -> TransactionGraph -> String
8showTransactionStructure trans graph = headInfo ++ " " ++ show (transactionId trans) ++ " p" ++ parentTransactionsInfo ++ " c" ++ childTransactionsInfo
10 headInfo = maybe "" show (headNameForTransaction trans graph)
11 parentTransactionsInfo = if isRootTransaction trans graph then "root" else case parentTransactions trans graph of
13 Right parentTransSet -> concat $ S.toList $ S.map (show . transactionId) parentTransSet
14 childTransactionsInfo = show (S.toList (transactionChildIds trans))
16showGraphStructure :: TransactionGraph -> String
17showGraphStructure graph@(TransactionGraph _ transSet) = S.foldr folder "" transSet
19 folder trans acc = acc ++ showTransactionStructure trans graph ++ "\n"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list