2014-03-08 02:05:00 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
final class DifferentialRevisionIDField
|
|
|
|
extends DifferentialCustomField {
|
|
|
|
|
|
|
|
public function getFieldKey() {
|
2014-03-08 18:13:51 +01:00
|
|
|
return 'differential:revision-id';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFieldKeyForConduit() {
|
2014-03-08 02:05:00 +01:00
|
|
|
return 'revisionID';
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFieldName() {
|
|
|
|
return pht('Differential Revision');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getFieldDescription() {
|
|
|
|
return pht(
|
|
|
|
'Ties commits to revisions and provides a permananent link between '.
|
|
|
|
'them.');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function canDisableField() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldAppearInCommitMessage() {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function shouldAllowEditInCommitMessage() {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function parseValueFromCommitMessage($value) {
|
|
|
|
return DifferentialRevisionIDFieldSpecification::parseRevisionIDFromURI(
|
|
|
|
$value);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderCommitMessageValue(array $handles) {
|
|
|
|
return PhabricatorEnv::getProductionURI('/D'.$this->getObject()->getID());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|