@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.

Work around workflow blocking error with duplicate "master" refs in "Land Revision"

Summary:
Ref T11823. See PHI68. T11823 has a full description of this issue and a plan to fix it, but the full plan is relatively complicated.

Until that can happen, provide a workaround for the biggest immediate issue, where multiple copies of a ref cursor can cause `executeOne()` to throw, since it expects a single result. In practice, these copies are always identical so we can just pick the first one.

This will get cleaned up once T11823 is fixed properly.

Test Plan:
Forced the table into a duplicate/ambiguous state, reproduced a similar-looking error:

{F5180999}

Applied the patch, got the "Land" to work as expected:

{F5181000}

Reviewers: amckinley

Reviewed By: amckinley

Maniphest Tasks: T11823

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

+12 -2
+12 -2
src/applications/differential/controller/DifferentialRevisionOperationController.php
··· 137 137 return null; 138 138 } 139 139 140 - return $this->newRefQuery($repository) 140 + // NOTE: See PHI68. This is a workaround to make "Land Revision" work 141 + // until T11823 is fixed properly. If we find multiple refs with the same 142 + // name (normally, duplicate "master" refs), just pick the first one. 143 + 144 + $refs = $this->newRefQuery($repository) 141 145 ->withRefNames(array($default_name)) 142 - ->executeOne(); 146 + ->execute(); 147 + 148 + if ($refs) { 149 + return head($refs); 150 + } 151 + 152 + return null; 143 153 } 144 154 145 155 private function getDefaultRefName(