HomePhabricator

Fix an issue with incorrect split head detection in Mercurial after pushing a…

Description

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

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.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10665

Differential Revision: https://secure.phabricator.com/D15522

Details