Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13994482
D8142.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
D8142.diff
View Options
Index: src/applications/differential/editor/DifferentialRevisionEditor.php
===================================================================
--- src/applications/differential/editor/DifferentialRevisionEditor.php
+++ src/applications/differential/editor/DifferentialRevisionEditor.php
@@ -256,6 +256,7 @@
$adapter->setExplicitCCs($new['ccs']);
$adapter->setExplicitReviewers($new['rev']);
$adapter->setForbiddenCCs($revision->loadUnsubscribedPHIDs());
+ $adapter->setIsNewObject($is_new);
$xscript = HeraldEngine::loadAndApplyRules($adapter);
$xscript_uri = '/herald/transcript/'.$xscript->getID().'/';
Index: src/applications/herald/adapter/HeraldAdapter.php
===================================================================
--- src/applications/herald/adapter/HeraldAdapter.php
+++ src/applications/herald/adapter/HeraldAdapter.php
@@ -38,6 +38,7 @@
const FIELD_BRANCHES = 'branches';
const FIELD_AUTHOR_RAW = 'author-raw';
const FIELD_COMMITTER_RAW = 'committer-raw';
+ const FIELD_IS_NEW_OBJECT = 'new-object';
const CONDITION_CONTAINS = 'contains';
const CONDITION_NOT_CONTAINS = '!contains';
@@ -90,6 +91,7 @@
const VALUE_BUILD_PLAN = 'buildplan';
private $contentSource;
+ private $isNewObject;
public function setContentSource(PhabricatorContentSource $content_source) {
$this->contentSource = $content_source;
@@ -99,6 +101,18 @@
return $this->contentSource;
}
+ public function getIsNewObject() {
+ if (is_bool($this->isNewObject)) {
+ return $this->isNewObject;
+ }
+
+ throw new Exception(pht('You must setIsNewObject to a boolean first!'));
+ }
+ public function setIsNewObject($new) {
+ $this->isNewObject = (bool) $new;
+ return $this;
+ }
+
abstract public function getPHID();
abstract public function getHeraldName();
@@ -110,6 +124,8 @@
return $this->getContentSource()->getSource();
case self::FIELD_ALWAYS:
return true;
+ case self::FIELD_IS_NEW_OBJECT:
+ return $this->getIsNewObject();
default:
throw new Exception(
"Unknown field '{$field_name}'!");
@@ -216,6 +232,7 @@
self::FIELD_BRANCHES => pht('Commit\'s branches'),
self::FIELD_AUTHOR_RAW => pht('Raw author name'),
self::FIELD_COMMITTER_RAW => pht('Raw committer name'),
+ self::FIELD_IS_NEW_OBJECT => pht('Is newly created?'),
);
}
@@ -345,6 +362,7 @@
);
case self::FIELD_IS_MERGE_COMMIT:
case self::FIELD_DIFF_ENORMOUS:
+ case self::FIELD_IS_NEW_OBJECT:
return array(
self::CONDITION_IS_TRUE,
self::CONDITION_IS_FALSE,
Index: src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
===================================================================
--- src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
+++ src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
@@ -72,6 +72,7 @@
self::FIELD_RULE,
self::FIELD_AFFECTED_PACKAGE,
self::FIELD_AFFECTED_PACKAGE_OWNER,
+ self::FIELD_OBJECT_IS_NEW,
),
parent::getFields());
}
Index: src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
===================================================================
--- src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
+++ src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
@@ -80,6 +80,7 @@
self::FIELD_CC,
self::FIELD_CONTENT_SOURCE,
self::FIELD_PROJECTS,
+ self::FIELD_IS_NEW_OBJECT,
),
parent::getFields());
}
Index: src/applications/herald/adapter/HeraldPholioMockAdapter.php
===================================================================
--- src/applications/herald/adapter/HeraldPholioMockAdapter.php
+++ src/applications/herald/adapter/HeraldPholioMockAdapter.php
@@ -59,6 +59,7 @@
self::FIELD_BODY,
self::FIELD_AUTHOR,
self::FIELD_CC,
+ self::FIELD_OBJECT_IS_NEW,
),
parent::getFields());
}
Index: src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
===================================================================
--- src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -1554,6 +1554,7 @@
$adapter = $this->buildHeraldAdapter($object, $xactions);
$adapter->setContentSource($this->getContentSource());
+ $adapter->setIsNewObject($this->getIsNewObject());
$xscript = HeraldEngine::loadAndApplyRules($adapter);
$this->setHeraldAdapter($adapter);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Oct 24, 6:28 AM (2 w, 5 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6722078
Default Alt Text
D8142.diff (4 KB)
Attached To
Mode
D8142: Herald - Add "new" field to herald
Attached
Detach File
Event Timeline
Log In to Comment