Page MenuHomePhabricator

D13503.id32658.diff
No OneTemporary

D13503.id32658.diff

Index: src/__phutil_library_map__.php
===================================================================
--- src/__phutil_library_map__.php
+++ src/__phutil_library_map__.php
@@ -714,6 +714,7 @@
'DrydockBlueprintCoreCustomField' => 'applications/drydock/customfield/DrydockBlueprintCoreCustomField.php',
'DrydockBlueprintCreateController' => 'applications/drydock/controller/DrydockBlueprintCreateController.php',
'DrydockBlueprintCustomField' => 'applications/drydock/customfield/DrydockBlueprintCustomField.php',
+ 'DrydockBlueprintCustomFieldBlueprints' => 'applications/drydock/customfield/DrydockBlueprintCustomFieldBlueprints.php',
'DrydockBlueprintDatasource' => 'applications/drydock/typeahead/DrydockBlueprintDatasource.php',
'DrydockBlueprintEditController' => 'applications/drydock/controller/DrydockBlueprintEditController.php',
'DrydockBlueprintEditor' => 'applications/drydock/editor/DrydockBlueprintEditor.php',
@@ -4161,6 +4162,7 @@
),
'DrydockBlueprintCreateController' => 'DrydockBlueprintController',
'DrydockBlueprintCustomField' => 'PhabricatorCustomField',
+ 'DrydockBlueprintCustomFieldBlueprints' => 'PhabricatorStandardCustomFieldPHIDs',
'DrydockBlueprintDatasource' => 'PhabricatorTypeaheadDatasource',
'DrydockBlueprintEditController' => 'DrydockBlueprintController',
'DrydockBlueprintEditor' => 'PhabricatorApplicationTransactionEditor',
Index: src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
===================================================================
--- src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
+++ src/applications/drydock/blueprint/DrydockBlueprintImplementation.php
@@ -10,6 +10,7 @@
private $activeResource;
private $activeLease;
private $instance;
+ private $scopes = array();
abstract public function getType();
abstract public function getInterface(
@@ -606,10 +607,11 @@
DrydockResource $resource = null,
DrydockLease $lease = null) {
- if (($this->activeResource !== null) ||
- ($this->activeLease !== null)) {
- throw new Exception(pht('There is already an active resource or lease!'));
- }
+ $scope = array(
+ 'resource' => $resource,
+ 'lease' => $lease,
+ );
+ array_push($this->scopes, $scope);
$this->activeResource = $resource;
$this->activeLease = $lease;
@@ -618,8 +620,20 @@
}
public function popActiveScope() {
- $this->activeResource = null;
- $this->activeLease = null;
+ if (count($this->scopes) === 0) {
+ throw new Exception('Unable to pop active scope; no scopes active');
+ }
+
+ array_pop($this->scopes);
+
+ if (count($this->scopes) === 0) {
+ $this->activeResource = null;
+ $this->activeLease = null;
+ } else {
+ $current = last($this->scopes);
+ $this->activeResource = $current['resource'];
+ $this->activeLease = $current['lease'];
+ }
}
}

File Metadata

Mime Type
text/plain
Expires
Wed, May 7, 5:23 AM (3 h, 48 m ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7723860
Default Alt Text
D13503.id32658.diff (2 KB)

Event Timeline