Page MenuHomePhabricator

D9094.id21604.diff
No OneTemporary

D9094.id21604.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -530,6 +530,7 @@
'DiffusionPushLogListController' => 'applications/diffusion/controller/DiffusionPushLogListController.php',
'DiffusionQuery' => 'applications/diffusion/query/DiffusionQuery.php',
'DiffusionRawDiffQuery' => 'applications/diffusion/query/rawdiff/DiffusionRawDiffQuery.php',
+ 'DiffusionRefNotFoundException' => 'applications/diffusion/exception/DiffusionRefNotFoundException.php',
'DiffusionRenameHistoryQuery' => 'applications/diffusion/query/DiffusionRenameHistoryQuery.php',
'DiffusionRepositoryController' => 'applications/diffusion/controller/DiffusionRepositoryController.php',
'DiffusionRepositoryCreateController' => 'applications/diffusion/controller/DiffusionRepositoryCreateController.php',
@@ -3169,6 +3170,7 @@
),
'DiffusionQuery' => 'PhabricatorQuery',
'DiffusionRawDiffQuery' => 'DiffusionQuery',
+ 'DiffusionRefNotFoundException' => 'Exception',
'DiffusionRepositoryController' => 'DiffusionController',
'DiffusionRepositoryCreateController' => 'DiffusionRepositoryEditController',
'DiffusionRepositoryDefaultController' => 'DiffusionController',
diff --git a/src/applications/diffusion/exception/DiffusionRefNotFoundException.php b/src/applications/diffusion/exception/DiffusionRefNotFoundException.php
new file mode 100644
--- /dev/null
+++ b/src/applications/diffusion/exception/DiffusionRefNotFoundException.php
@@ -0,0 +1,12 @@
+<?php
+
+final class DiffusionRefNotFoundException extends Exception {
+
+ private $ref;
+
+ public function __construct($ref, $message) {
+ $this->ref = $ref;
+ parent::__construct($message);
+ }
+
+}
diff --git a/src/applications/diffusion/request/DiffusionRequest.php b/src/applications/diffusion/request/DiffusionRequest.php
--- a/src/applications/diffusion/request/DiffusionRequest.php
+++ b/src/applications/diffusion/request/DiffusionRequest.php
@@ -4,11 +4,8 @@
* Contains logic to parse Diffusion requests, which have a complicated URI
* structure.
*
- *
* @task new Creating Requests
* @task uri Managing Diffusion URIs
- *
- * @group diffusion
*/
abstract class DiffusionRequest {
@@ -644,17 +641,18 @@
}
if ($this->getSupportsBranches()) {
- $branch = $this->getResolvableBranchName($this->getBranch());
+ $ref = $this->getResolvableBranchName($this->getBranch());
} else {
- $branch = 'HEAD';
+ $ref = 'HEAD';
}
- $results = $this->resolveRefs(array($branch));
+ $results = $this->resolveRefs(array($ref));
- $matches = idx($results, $branch, array());
+ $matches = idx($results, $ref, array());
if (count($matches) !== 1) {
- throw new Exception(
- pht('Ref "%s" is ambiguous or does not exist.', $branch));
+ throw new DiffusionRefNotFoundException(
+ $ref,
+ pht('Ref "%s" is ambiguous or does not exist.', $ref));
}
$this->stableCommit = idx(head($matches), 'identifier');

File Metadata

Mime Type
text/plain
Expires
Thu, Mar 20, 12:33 AM (2 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7712231
Default Alt Text
D9094.id21604.diff (3 KB)

Event Timeline