on master help sign in
fix failure to jump to proper head after automergetohead

resolves #131

commitfc9e67a8cae0c290ff6d5d25408e50465c68b9a0 authorAgentM <agentm@themactionfaction.com> dateThu 10 Aug 2017, 18:14 (9 years ago) parent977e1bc
2 files changed+10−5
src/lib/ProjectM36/TransactionGraph.hs+7−5 test/TransactionGraph/Automerge.hs+3
src/lib/ProjectM36/TransactionGraph.hs+7−5
@@ -527,18 +527,20 @@ autoMergeToHead stamp (tempBranchTransId, tempCommitTransId, mergeTransId) disco
527527
528528 --commit to the new branch- possible future optimization: don't require fsync for this- create a temp commit type
529529 (discon'', graph'') <- evalGraphOp stamp tempCommitTransId discon' graph' Commit
530+
531+ --jump to merge head
532+ (discon''', graph''') <- evalGraphOp stamp tempBranchTransId discon'' graph'' (JumpToHead mergeToHeadName)
530533
531534 --create the merge
532− (discon''', graph''') <- evalGraphOp stamp mergeTransId discon'' graph'' (MergeTransactions strat tempBranchName mergeToHeadName)
533−
535+ (discon'''', graph'''') <- evalGraphOp stamp mergeTransId discon''' graph''' (MergeTransactions strat tempBranchName mergeToHeadName)
536+
534537 --delete the temp branch
535− (discon'''', graph'''') <- evalGraphOp stamp tempBranchTransId discon''' graph''' (DeleteBranch tempBranchName)
538+ (discon''''', graph''''') <- evalGraphOp stamp tempBranchTransId discon'''' graph'''' (DeleteBranch tempBranchName)
536539 {-
537540 let rel = runReader (evalRelationalExpr (RelationVariable "s" ())) (mkRelationalExprState $ D.concreteDatabaseContext discon'''')
538541 traceShowM rel
539542-}
540543
541− pure (discon'''', graph'''')
542−
544+ pure (discon''''', graph''''')
543545
544546
test/TransactionGraph/Automerge.hs+3
@@ -52,6 +52,9 @@ testAutomergeSuccess = TestCase $ do
5252
5353 assertEqual "new S7" relationTrue result'
5454
55+ eHeadName <- headName sessionPastId conn
56+ assertEqual "back on master" (Right "master") eHeadName
57+
5558testAutomergeFailure :: Test
5659testAutomergeFailure = TestCase $ do
5760 --create two sessions, diverge from the head, but create a union merge strategy failure