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
F17671133: D15522.id37418.diff
Sun, Jul 13, 2:18 AM
F17667484: D15522.id.diff
Sat, Jul 12, 10:23 PM
F17659432: D15522.diff
Sat, Jul 12, 2:27 PM
Unknown Object (File)
Jun 26 2025, 10:36 AM
Unknown Object (File)
Jun 18 2025, 3:36 AM
Unknown Object (File)
Jun 17 2025, 10:04 PM
Unknown Object (File)
May 30 2025, 10:49 PM
Unknown Object (File)
May 29 2025, 8:12 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
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.