@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix a Mercurial issue where split heads would be detected incorrectly

Summary: Ref T5197. When searching for split branch heads, we incorrectly consider descendant heads of other branches. This can cause us to detect a split tip when one does not exist (the old tip is the branch tip, but other descendant heads exist). Instead, consider only heads on the same branch.

Test Plan:
Repro is something like this:

- `hg update default`
- `hg branch branch1; hg commit ...`
- `hg push`
- `hg update default; hg commit ...`
- `hg push` - Previously, we would find the head of `branch1` and incorrectly account for it as a head of `default`.

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T5197

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

+6 -1
+6 -1
src/applications/diffusion/engine/DiffusionCommitHookEngine.php
··· 760 760 // repository that's already full of garbage (strongly discouraged but 761 761 // not as inherently dangerous). These cases should be very uncommon. 762 762 763 + // NOTE: We're only looking for heads on the same branch. The old 764 + // tip of the branch may be the branchpoint for other branches, but that 765 + // is OK. 766 + 763 767 $dfutures = array(); 764 768 foreach ($old_heads as $old_head) { 765 769 $dfutures[$old_head] = $repository->getLocalCommandFuture( 766 - 'log --rev %s --template %s', 770 + 'log --branch %s --rev %s --template %s', 771 + $ref, 767 772 hgsprintf('(descendants(%s) and head())', $old_head), 768 773 '{node}\1'); 769 774 }