Add a "refs" table to Diffusion

Summary:
Ref T7100. When a user navigates to a branch like "default" which is ambiguous:

  - don't fatal;
  - choose one alternative to resolve it to (currently more or less at random);
  - sometimes show what we did in the UI.

Also, add a new table to show the alternatives.

This will get refined in followup changes.

Test Plan:
{F384335}

{F384336}

Reviewers: btrahan

Reviewed By: btrahan

Subscribers: epriestley

Maniphest Tasks: T7100

Differential Revision: https://secure.phabricator.com/D12547
This commit is contained in:
epriestley
2015-04-27 03:49:57 -07:00
parent 55ff197f2a
commit 7f43cde82d
6 changed files with 196 additions and 4 deletions

View File

@@ -303,10 +303,40 @@ final class DiffusionRepositoryController extends DiffusionController {
$view->setActionList($actions);
return id(new PHUIObjectBoxView())
$box = id(new PHUIObjectBoxView())
->setHeader($header)
->addPropertyList($view);
$info = null;
$drequest = $this->getDiffusionRequest();
if ($drequest->getRefAlternatives()) {
$message = array(
pht(
'The ref "%s" is ambiguous in this repository.',
$drequest->getBranch()),
' ',
phutil_tag(
'a',
array(
'href' => $drequest->generateURI(
array(
'action' => 'refs',
)),
),
pht('View Alternatives')),
);
$messages = array($message);
$info = id(new PHUIInfoView())
->setSeverity(PHUIInfoView::SEVERITY_WARNING)
->setErrors(array($message));
$box->setInfoView($info);
}
return $box;
}
private function buildBranchListTable(DiffusionRequest $drequest) {