Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14745438
D18816.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D18816.diff
View Options
diff --git a/src/applications/diffusion/controller/DiffusionCommitController.php b/src/applications/diffusion/controller/DiffusionCommitController.php
--- a/src/applications/diffusion/controller/DiffusionCommitController.php
+++ b/src/applications/diffusion/controller/DiffusionCommitController.php
@@ -39,20 +39,23 @@
return $this->buildRawDiffResponse($drequest);
}
- $commit = id(new DiffusionCommitQuery())
+ $commits = id(new DiffusionCommitQuery())
->setViewer($viewer)
->withRepository($repository)
->withIdentifiers(array($commit_identifier))
->needCommitData(true)
->needAuditRequests(true)
- ->executeOne();
+ ->setLimit(100)
+ ->execute();
+
+ $multiple_results = count($commits) > 1;
$crumbs = $this->buildCrumbs(array(
- 'commit' => true,
+ 'commit' => !$multiple_results,
));
$crumbs->setBorder(true);
- if (!$commit) {
+ if (!$commits) {
if (!$this->getCommitExists()) {
return new Aphront404Response();
}
@@ -70,7 +73,40 @@
->setTitle($title)
->setCrumbs($crumbs)
->appendChild($error);
+ } else if ($multiple_results) {
+
+ $warning_message =
+ pht(
+ 'The identifier %s is ambiguous and matches more than one commit.',
+ phutil_tag(
+ 'strong',
+ array(),
+ $commit_identifier));
+
+ $error = id(new PHUIInfoView())
+ ->setTitle(pht('Ambiguous Commit'))
+ ->setSeverity(PHUIInfoView::SEVERITY_WARNING)
+ ->appendChild($warning_message);
+
+ $list = id(new DiffusionCommitListView())
+ ->setViewer($viewer)
+ ->setCommits($commits)
+ ->setNoDataString(pht('No recent commits.'));
+
+ $crumbs->addTextCrumb(pht('Ambiguous Commit'));
+
+ $matched_commits = id(new PHUITwoColumnView())
+ ->setFooter(array(
+ $error,
+ $list,
+ ));
+ return $this->newPage()
+ ->setTitle(pht('Ambiguous Commit'))
+ ->setCrumbs($crumbs)
+ ->appendChild($matched_commits);
+ } else {
+ $commit = head($commits);
}
$audit_requests = $commit->getAudits();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Jan 22, 9:25 AM (4 h, 18 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7028034
Default Alt Text
D18816.diff (2 KB)
Attached To
Mode
D18816: Fix error for URL's that could mean several commits
Attached
Detach File
Event Timeline
Log In to Comment