on master help sign in
fix failure to jump to proper head after automergetohead
fc9e67aAgentM
src/lib/ProjectM36/TransactionGraph.hs+7−5
@@ -527,18 +527,20 @@ autoMergeToHead stamp (tempBranchTransId, tempCommitTransId, mergeTransId) disco
527
527
528 --commit to the new branch- possible future optimization: don't require fsync for this- create a temp commit type
528 --commit to the new branch- possible future optimization: don't require fsync for this- create a temp commit type
529 (discon'', graph'') <- evalGraphOp stamp tempCommitTransId discon' graph' Commit
529 (discon'', graph'') <- evalGraphOp stamp tempCommitTransId discon' graph' Commit
530+
531+ --jump to merge head
532+ (discon''', graph''') <- evalGraphOp stamp tempBranchTransId discon'' graph'' (JumpToHead mergeToHeadName)
530
533
531 --create the merge
534 --create the merge
532− (discon''', graph''') <- evalGraphOp stamp mergeTransId discon'' graph'' (MergeTransactions strat tempBranchName mergeToHeadName)
535+ (discon'''', graph'''') <- evalGraphOp stamp mergeTransId discon''' graph''' (MergeTransactions strat tempBranchName mergeToHeadName)
533−
536+
534 --delete the temp branch
537 --delete the temp branch
535− (discon'''', graph'''') <- evalGraphOp stamp tempBranchTransId discon''' graph''' (DeleteBranch tempBranchName)
538+ (discon''''', graph''''') <- evalGraphOp stamp tempBranchTransId discon'''' graph'''' (DeleteBranch tempBranchName)
536 {-
539 {-
537 let rel = runReader (evalRelationalExpr (RelationVariable "s" ())) (mkRelationalExprState $ D.concreteDatabaseContext discon'''')
540 let rel = runReader (evalRelationalExpr (RelationVariable "s" ())) (mkRelationalExprState $ D.concreteDatabaseContext discon'''')
538 traceShowM rel
541 traceShowM rel
539-}
542-}
540
543
541− pure (discon'''', graph'''')
544+ pure (discon''''', graph''''')
542−
543
545
544
546
test/TransactionGraph/Automerge.hs+3
@@ -52,6 +52,9 @@ testAutomergeSuccess = TestCase $ do
52
52
53 assertEqual "new S7" relationTrue result'
53 assertEqual "new S7" relationTrue result'
54
54
55+ eHeadName <- headName sessionPastId conn
56+ assertEqual "back on master" (Right "master") eHeadName
57+
55testAutomergeFailure :: Test
58testAutomergeFailure :: Test
56testAutomergeFailure = TestCase $ do
59testAutomergeFailure = TestCase $ do
57 --create two sessions, diverge from the head, but create a union merge strategy failure
60 --create two sessions, diverge from the head, but create a union merge strategy failure