Page MenuHomePhabricator

D8142.id18419.diff
No OneTemporary

D8142.id18419.diff

diff --git a/src/applications/herald/adapter/HeraldAdapter.php b/src/applications/herald/adapter/HeraldAdapter.php
--- a/src/applications/herald/adapter/HeraldAdapter.php
+++ b/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,14 @@
return $this->contentSource;
}
+ public function getIsNewObject() {
+ return $this->isNewObject;
+ }
+ public function setIsNewObject($new) {
+ $this->isNewObject = $new;
+ return $this;
+ }
+
abstract public function getPHID();
abstract public function getHeraldName();
@@ -110,6 +120,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 +228,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('New object'),
);
}
@@ -345,6 +358,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,
diff --git a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php b/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
--- a/src/applications/herald/adapter/HeraldDifferentialRevisionAdapter.php
+++ b/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());
}
diff --git a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php b/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
--- a/src/applications/herald/adapter/HeraldManiphestTaskAdapter.php
+++ b/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());
}
diff --git a/src/applications/herald/adapter/HeraldPholioMockAdapter.php b/src/applications/herald/adapter/HeraldPholioMockAdapter.php
--- a/src/applications/herald/adapter/HeraldPholioMockAdapter.php
+++ b/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());
}
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/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

Mime Type
text/plain
Expires
Fri, Sep 20, 7:33 AM (10 h, 27 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6622872
Default Alt Text
D8142.id18419.diff (3 KB)

Event Timeline