Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15419766
D8086.id18291.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D8086.id18291.diff
View Options
diff --git a/src/applications/diffusion/conduit/ConduitAPI_diffusion_branchquery_Method.php b/src/applications/diffusion/conduit/ConduitAPI_diffusion_branchquery_Method.php
--- a/src/applications/diffusion/conduit/ConduitAPI_diffusion_branchquery_Method.php
+++ b/src/applications/diffusion/conduit/ConduitAPI_diffusion_branchquery_Method.php
@@ -100,6 +100,12 @@
return $this->processBranchRefs($request, $refs);
}
+ protected function getSVNResult() {
+ // Since SVN doesn't have meaningful branches, just return nothing for all
+ // queries.
+ return array();
+ }
+
private function processBranchRefs(ConduitAPIRequest $request, array $refs) {
$drequest = $this->getDiffusionRequest();
$repository = $drequest->getRepository();
@@ -125,4 +131,5 @@
return mpull($refs, 'toDictionary');
}
+
}
diff --git a/src/applications/herald/adapter/HeraldCommitAdapter.php b/src/applications/herald/adapter/HeraldCommitAdapter.php
--- a/src/applications/herald/adapter/HeraldCommitAdapter.php
+++ b/src/applications/herald/adapter/HeraldCommitAdapter.php
@@ -88,7 +88,8 @@
return array(
self::FIELD_NEED_AUDIT_FOR_PACKAGE =>
pht('Affected packages that need audit'),
- self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH => pht('On autoclose branch'),
+ self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH
+ => pht('Commit is on closing branch'),
) + parent::getFieldNameMap();
}
@@ -114,6 +115,7 @@
self::FIELD_DIFFERENTIAL_ACCEPTED,
self::FIELD_DIFFERENTIAL_REVIEWERS,
self::FIELD_DIFFERENTIAL_CCS,
+ self::FIELD_BRANCHES,
self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH,
),
parent::getFields());
@@ -461,6 +463,18 @@
return array();
}
return $revision->getCCPHIDs();
+ case self::FIELD_BRANCHES:
+ $params = array(
+ 'callsign' => $this->repository->getCallsign(),
+ 'contains' => $this->commit->getCommitIdentifier(),
+ );
+
+ $result = id(new ConduitCall('diffusion.branchquery', $params))
+ ->setUser(PhabricatorUser::getOmnipotentUser())
+ ->execute();
+
+ $refs = DiffusionRepositoryRef::loadAllFromDictionaries($result);
+ return mpull($refs, 'getShortName');
case self::FIELD_REPOSITORY_AUTOCLOSE_BRANCH:
return $this->repository->shouldAutocloseCommit(
$this->commit,
diff --git a/src/applications/herald/controller/HeraldTestConsoleController.php b/src/applications/herald/controller/HeraldTestConsoleController.php
--- a/src/applications/herald/controller/HeraldTestConsoleController.php
+++ b/src/applications/herald/controller/HeraldTestConsoleController.php
@@ -74,15 +74,13 @@
}
}
- $text = pht(
- 'Enter an object to test rules for, like a Diffusion commit (e.g., '.
- 'rX123) or a Differential revision (e.g., D123). You will be shown '.
- 'the results of a dry run on the object.');
-
$form = id(new AphrontFormView())
->setUser($user)
- ->appendChild(
- phutil_tag('p', array('class' => 'aphront-form-instructions'), $text))
+ ->appendRemarkupInstructions(
+ pht(
+ 'Enter an object to test rules for, like a Diffusion commit (e.g., '.
+ '`rX123`) or a Differential revision (e.g., `D123`). You will be '.
+ 'shown the results of a dry run on the object.'))
->appendChild(
id(new AphrontFormTextControl())
->setLabel(pht('Object Name'))
diff --git a/src/applications/herald/storage/HeraldRule.php b/src/applications/herald/storage/HeraldRule.php
--- a/src/applications/herald/storage/HeraldRule.php
+++ b/src/applications/herald/storage/HeraldRule.php
@@ -17,7 +17,7 @@
protected $isDisabled = 0;
protected $triggerObjectPHID;
- protected $configVersion = 27;
+ protected $configVersion = 28;
// phids for which this rule has been applied
private $ruleApplied = self::ATTACHABLE;
@@ -134,8 +134,7 @@
$child->setRuleID($this->getID());
}
-// TODO:
-// $this->openTransaction();
+ $this->openTransaction();
queryfx(
$this->establishConnection('w'),
'DELETE FROM %T WHERE ruleID = %d',
@@ -144,7 +143,7 @@
foreach ($children as $child) {
$child->save();
}
-// $this->saveTransaction();
+ $this->saveTransaction();
}
public function delete() {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Mar 22, 8:44 AM (1 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7716793
Default Alt Text
D8086.id18291.diff (4 KB)
Attached To
Mode
D8086: Add a "branches" rule for commits
Attached
Detach File
Event Timeline
Log In to Comment