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
Unknown Object (File)
Sat, Dec 14, 11:08 AM
Unknown Object (File)
Nov 21 2024, 1:40 PM
Unknown Object (File)
Nov 10 2024, 10:29 AM
Unknown Object (File)
Nov 6 2024, 3:58 AM
Unknown Object (File)
Oct 18 2024, 2:15 PM
Unknown Object (File)
Oct 18 2024, 5:06 AM
Unknown Object (File)
Oct 9 2024, 4:41 PM
Unknown Object (File)
Oct 9 2024, 12:32 PM
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
Branch
hg1
Lint
Lint Passed
Unit
Tests Passed
Build Status
Buildable 11281
Build 14022: Run Core Tests
Build 14021: arc lint + arc unit

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.