File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -291,11 +291,7 @@ updateContribution callerUserId contributionId newTitle newDescription newStatus
291291 -- messes with the diffs.
292292 -- But we do want to update them if the source or target branch has changed.
293293 when
294- ( updatedStatus == InReview
295- || updatedStatus == Draft
296- || newSourceBranchId /= (Just sourceBranchId)
297- || newTargetBranchId /= (Just targetBranchId)
298- )
294+ (updatedStatus == InReview || updatedStatus == Draft )
299295 do
300296 lift $
301297 PG. execute_
@@ -543,7 +539,11 @@ rebaseContributionsFromMergedBranches mergedContributions = do
543539 )
544540 UPDATE contributions contr
545541 SET target_branch = merged_contribution.target_branch,
546- target_causal_id = new_target_branch.causal_id
542+ target_causal_id = new_target_branch.causal_id,
543+ best_common_ancestor_causal_id = best_common_causal_ancestor(
544+ contr.source_causal_id,
545+ new_target_branch.causal_id
546+ )
547547 -- Update all open contributions which are merging into a branch that was just merged
548548 FROM merged_contribution_ids
549549 JOIN contributions merged_contribution ON merged_contribution.id = merged_contribution_ids.contribution_id
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ import Share.Postgres.Contributions.Queries qualified as ContributionQ
1414updateContributionsFromBranchUpdate :: UserId -> BranchId -> PG. Transaction e ()
1515updateContributionsFromBranchUpdate callerUserId branchId = do
1616 contributionsWithUpdatedBCAs <- ContributionQ. performMergesAndBCAUpdatesFromBranchPush callerUserId branchId
17- _rebasedContributions <- ContributionQ. rebaseContributionsFromMergedBranches contributionsWithUpdatedBCAs
17+ rebasedContributions <- ContributionQ. rebaseContributionsFromMergedBranches contributionsWithUpdatedBCAs
1818 affectedContributions <- ContributionQ. contributionsRelatedToBranches (Set. singleton branchId)
19- DiffsQ. submitContributionsToBeDiffed (Set. fromList affectedContributions)
19+ DiffsQ. submitContributionsToBeDiffed (Set. fromList affectedContributions <> rebasedContributions )
2020 pure ()
You can’t perform that action at this time.
0 commit comments