Page MenuHomePhabricator

Fix an issue with incorrect split head detection in Mercurial after pushing a medley of varied changes
ClosedPublic

Authored by epriestley on Mar 25 2016, 2:26 PM.
Tags
None
Referenced Files
F13221653: D15522.diff
Sun, May 19, 2:56 AM
F13204118: D15522.diff
Wed, May 15, 12:21 AM
F13186910: D15522.diff
Sat, May 11, 4:12 AM
Unknown Object (File)
Tue, May 7, 7:16 AM
Unknown Object (File)
Fri, May 3, 5:43 AM
Unknown Object (File)
Thu, Apr 25, 12:56 AM
Unknown Object (File)
Sun, Apr 21, 6:28 PM
Unknown Object (File)
Apr 11 2024, 8:42 AM
Subscribers
None

Details

Summary

Fixes T10665. See that task for discussion.

Because $head_map is not properly re-initialized for each ref we check, pushes which affect multiple branches (say, "A" and "B") can have information bleed from the first branch check to the second branch.

To trigger a problem behavior, you can push one commit which updates an existing branch, plus one commit which creates a new branch. If they process in the right order, the $head_map from the updated branch will bleed into the $head_map for the new branch and trigger an incorrect head split detection.

Test Plan
  • Pushed a set of changes which updated branch-a and created branch-b.
    • Before change: improper detection of split heads.
    • After change: clean push.
  • Pushed a set of changes which split the head of branch-d.
    • Correct detection of split heads.

Diff Detail

Repository
rP Phabricator
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

epriestley retitled this revision from to Fix an issue with incorrect split head detection in Mercurial after pushing a medley of varied changes.
epriestley updated this object.
epriestley edited the test plan for this revision. (Show Details)
epriestley added a reviewer: chad.
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
828

The second time through the loop we would hit this case, and not reset $head_map.

849

Then, this check would give the wrong result.

chad edited edge metadata.
This revision is now accepted and ready to land.Mar 25 2016, 2:29 PM
This revision was automatically updated to reflect the committed changes.