1module ProjectM36.Sessions where
2import Control.Concurrent.STM
3import qualified STMContainers.Map as STMMap
5import ProjectM36.Attribute
7import ProjectM36.Session
8import ProjectM36.Relation
10import qualified Data.UUID as U
12type Sessions = STMMap.Map SessionId Session
14stmMapToList :: STMMap.Map k v -> STM [(k, v)]
15stmMapToList = ListT.fold (\l -> return . (:l)) [] . STMMap.stream
17uuidAtom :: U.UUID -> Atom
18uuidAtom = TextAtom . U.toText
20sessionsAsRelation :: Sessions -> STM (Either RelationalError Relation)
21sessionsAsRelation sessions = do
22 sessionAssocs <- stmMapToList sessions
23 let atomMatrix = map (\(sessionId, session) -> [uuidAtom sessionId, uuidAtom (parentId session)]) sessionAssocs
24 pure $ mkRelationFromList (attributesFromList [Attribute "sessionid" TextAtomType,
25 Attribute "parentCommit" TextAtomType]) atomMatrix
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