1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-20 04:20:55 +01:00

Deploy new ArcanistManyWordsAboutDifferentialConstants class from D1328 into

Phabricator

Summary: ...this breaks without D1328.   Used good ole "codemod" to do this
work, with lots of manual edits around 80 chars.

Test Plan: clicked around phabricator tool suite, particular differential, a
bunch

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1351
This commit is contained in:
Bob Trahan 2012-01-10 11:39:11 -08:00
parent a4ceba9101
commit 2a29a51080
47 changed files with 175 additions and 228 deletions

View file

@ -226,14 +226,12 @@ phutil_register_library_map(array(
'DifferentialRevisionDetailView' => 'applications/differential/view/revisiondetail',
'DifferentialRevisionEditController' => 'applications/differential/controller/revisionedit',
'DifferentialRevisionEditor' => 'applications/differential/editor/revision',
'DifferentialRevisionHash' => 'applications/differential/constants/revisionhash',
'DifferentialRevisionIDFieldParserTestCase' => 'applications/differential/field/specification/revisionid/__tests__',
'DifferentialRevisionIDFieldSpecification' => 'applications/differential/field/specification/revisionid',
'DifferentialRevisionListController' => 'applications/differential/controller/revisionlist',
'DifferentialRevisionListData' => 'applications/differential/data/revisionlist',
'DifferentialRevisionListView' => 'applications/differential/view/revisionlist',
'DifferentialRevisionQuery' => 'applications/differential/query/revision',
'DifferentialRevisionStatus' => 'applications/differential/constants/revisionstatus',
'DifferentialRevisionStatusFieldSpecification' => 'applications/differential/field/specification/revisionstatus',
'DifferentialRevisionUpdateHistoryView' => 'applications/differential/view/revisionupdatehistory',
'DifferentialRevisionViewController' => 'applications/differential/controller/revisionview',

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -75,7 +75,8 @@ class ConduitAPI_differential_creatediff_Method extends ConduitAPIMethod {
if ($parent_id) {
$parent_rev = id(new DifferentialRevision())->load($parent_id);
if ($parent_rev) {
if ($parent_rev->getStatus() != DifferentialRevisionStatus::COMMITTED) {
if ($parent_rev->getStatus() !=
ArcanistDifferentialRevisionStatus::COMMITTED) {
$diff->setParentRevisionID($parent_id);
}
}

View file

@ -6,11 +6,11 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('arcanist', 'parser/diff/change');
phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/differential/constants/lintstatus');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/constants/unitstatus');
phutil_require_module('phabricator', 'applications/differential/storage/diff');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -77,8 +77,9 @@ class ConduitAPI_differential_find_Method extends ConduitAPIMethod {
'uri' => PhabricatorEnv::getProductionURI('/D'.$id),
'dateCreated' => $revision->getDateCreated(),
'authorPHID' => $revision->getAuthorPHID(),
'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus(
$revision->getStatus()),
'statusName' =>
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
$revision->getStatus()),
'sourcePath' => $diff->getSourcePath(),
);
}

View file

@ -6,8 +6,9 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/data/revisionlist');
phutil_require_module('phabricator', 'infrastructure/env');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -86,8 +86,9 @@ class ConduitAPI_differential_getrevision_Method extends ConduitAPIMethod {
'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()),
'title' => $revision->getTitle(),
'status' => $revision->getStatus(),
'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus(
$revision->getStatus()),
'statusName' =>
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
$revision->getStatus()),
'summary' => $revision->getSummary(),
'testPlan' => $revision->getTestPlan(),
'lineCount' => $revision->getLineCount(),

View file

@ -6,9 +6,10 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/field/selector/base');
phutil_require_module('phabricator', 'applications/differential/storage/auxiliaryfield');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -49,7 +49,8 @@ class ConduitAPI_differential_markcommitted_Method extends ConduitAPIMethod {
throw new ConduitException('ERR_NOT_FOUND');
}
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
if ($revision->getStatus() ==
ArcanistDifferentialRevisionStatus::COMMITTED) {
// This can occur if someone runs 'mark-committed' and hits a race, or
// they have a remote hook installed but don't have the
// 'remote_hook_installed' flag set, or similar. In any case, just treat
@ -66,7 +67,7 @@ class ConduitAPI_differential_markcommitted_Method extends ConduitAPIMethod {
DifferentialAction::ACTION_COMMIT);
$editor->save();
$revision->setStatus(DifferentialRevisionStatus::COMMITTED);
$revision->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED);
$revision->setDateCommitted(time());
$revision->save();

View file

@ -6,10 +6,11 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/editor/comment');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -26,7 +26,7 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
}
public function defineParamTypes() {
$hash_types = DifferentialRevisionHash::getTypes();
$hash_types = ArcanistDifferentialRevisionHash::getTypes();
$hash_types = implode(', ', $hash_types);
$status_types = array(
@ -107,7 +107,7 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
}
*/
if ($commit_hashes) {
$hash_types = DifferentialRevisionHash::getTypes();
$hash_types = ArcanistDifferentialRevisionHash::getTypes();
foreach ($commit_hashes as $info) {
list($type, $hash) = $info;
if (empty($type) ||
@ -168,8 +168,9 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
'dateModified' => $revision->getDateModified(),
'authorPHID' => $revision->getAuthorPHID(),
'status' => $revision->getStatus(),
'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus(
$revision->getStatus()),
'statusName' =>
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
$revision->getStatus()),
'sourcePath' => $diff->getSourcePath(),
'summary' => $revision->getSummary(),
'testPlan' => $revision->getTestPlan(),

View file

@ -6,10 +6,11 @@
phutil_require_module('arcanist', 'differential/constants/revisionhash');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
phutil_require_module('phabricator', 'applications/differential/constants/revisionhash');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/query/revision');
phutil_require_module('phabricator', 'infrastructure/env');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -62,7 +62,8 @@ class ConduitAPI_differential_updaterevision_Method extends ConduitAPIMethod {
throw new ConduitException('ERR_WRONG_USER');
}
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
if ($revision->getStatus() ==
ArcanistDifferentialRevisionStatus::COMMITTED) {
throw new ConduitException('ERR_COMMITTED');
}

View file

@ -6,9 +6,10 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/conduit/method/base');
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/editor/revision');
phutil_require_module('phabricator', 'applications/differential/storage/diff');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -1,35 +0,0 @@
<?php
/*
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class DifferentialRevisionHash {
const TABLE_NAME = 'differential_revisionhash';
const HASH_GIT_COMMIT = 'gtcm';
const HASH_GIT_TREE = 'gttr';
const HASH_MERCURIAL_COMMIT = 'hgcm';
public static function getTypes() {
return array(
DifferentialRevisionHash::HASH_GIT_COMMIT,
DifferentialRevisionHash::HASH_GIT_TREE,
DifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
);
}
}

View file

@ -1,10 +0,0 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_source('DifferentialRevisionHash.php');

View file

@ -1,39 +0,0 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
final class DifferentialRevisionStatus {
const NEEDS_REVIEW = 0;
const NEEDS_REVISION = 1;
const ACCEPTED = 2;
const COMMITTED = 3;
const ABANDONED = 4;
public static function getNameForRevisionStatus($status) {
static $map = array(
self::NEEDS_REVIEW => 'Needs Review',
self::NEEDS_REVISION => 'Needs Revision',
self::ACCEPTED => 'Accepted',
self::COMMITTED => 'Committed',
self::ABANDONED => 'Abandoned',
);
return idx($map, coalesce($status, '?'), 'Unknown');
}
}

View file

@ -1,12 +0,0 @@
<?php
/**
* This file is automatically generated. Lint this module to rebuild it.
* @generated
*/
phutil_require_module('phutil', 'utils');
phutil_require_source('DifferentialRevisionStatus.php');

View file

@ -373,7 +373,7 @@ class DifferentialRevisionListController extends DifferentialController {
// about) and $waiting (revisions you're waiting on someone else to do
// something about).
foreach ($revisions as $revision) {
$status_review = DifferentialRevisionStatus::NEEDS_REVIEW;
$status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW;
$needs_review = ($revision->getStatus() == $status_review);
$filter_is_author = ($revision->getAuthorPHID() == $user_phid);

View file

@ -6,8 +6,9 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'aphront/response/redirect');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/controller/base');
phutil_require_module('phabricator', 'applications/differential/query/revision');
phutil_require_module('phabricator', 'applications/differential/view/revisionlist');

View file

@ -403,46 +403,46 @@ class DifferentialRevisionViewController extends DifferentialController {
if ($viewer_is_owner) {
switch ($revision->getStatus()) {
case DifferentialRevisionStatus::NEEDS_REVIEW:
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
$actions[DifferentialAction::ACTION_ABANDON] = true;
$actions[DifferentialAction::ACTION_RETHINK] = true;
break;
case DifferentialRevisionStatus::NEEDS_REVISION:
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
$actions[DifferentialAction::ACTION_ABANDON] = true;
$actions[DifferentialAction::ACTION_REQUEST] = true;
break;
case DifferentialRevisionStatus::ACCEPTED:
case ArcanistDifferentialRevisionStatus::ACCEPTED:
$actions[DifferentialAction::ACTION_ABANDON] = true;
$actions[DifferentialAction::ACTION_REQUEST] = true;
$actions[DifferentialAction::ACTION_RETHINK] = true;
break;
case DifferentialRevisionStatus::COMMITTED:
case ArcanistDifferentialRevisionStatus::COMMITTED:
break;
case DifferentialRevisionStatus::ABANDONED:
case ArcanistDifferentialRevisionStatus::ABANDONED:
$actions[DifferentialAction::ACTION_RECLAIM] = true;
break;
}
} else {
switch ($revision->getStatus()) {
case DifferentialRevisionStatus::NEEDS_REVIEW:
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
$actions[DifferentialAction::ACTION_ACCEPT] = true;
$actions[DifferentialAction::ACTION_REJECT] = true;
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
break;
case DifferentialRevisionStatus::NEEDS_REVISION:
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
$actions[DifferentialAction::ACTION_ACCEPT] = true;
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
break;
case DifferentialRevisionStatus::ACCEPTED:
case ArcanistDifferentialRevisionStatus::ACCEPTED:
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
$actions[DifferentialAction::ACTION_REJECT] = true;
$actions[DifferentialAction::ACTION_RESIGN] =
$viewer_is_reviewer && !$viewer_did_accept;
break;
case DifferentialRevisionStatus::COMMITTED:
case DifferentialRevisionStatus::ABANDONED:
case ArcanistDifferentialRevisionStatus::COMMITTED:
case ArcanistDifferentialRevisionStatus::ABANDONED:
break;
}
}

View file

@ -6,9 +6,10 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'aphront/response/404');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/controller/base');
phutil_require_module('phabricator', 'applications/differential/field/selector/base');
phutil_require_module('phabricator', 'applications/differential/parser/changeset');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -68,7 +68,7 @@ class DifferentialRevisionListData {
$this->revisions = $this->loadAllWhere(
'revision.status in (%Ld) AND revision.authorPHID in (%Ls)',
array(
DifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::ACCEPTED,
),
$this->ids);
break;
@ -137,15 +137,15 @@ class DifferentialRevisionListData {
$rev->getTableName(),
$this->ids,
array(
DifferentialRevisionStatus::NEEDS_REVISION,
DifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
ArcanistDifferentialRevisionStatus::ACCEPTED,
),
$rev->getTableName(),
DifferentialRevision::RELATIONSHIP_TABLE,
DifferentialRevision::RELATION_REVIEWER,
$this->ids,
array(
DifferentialRevisionStatus::NEEDS_REVIEW,
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
),
$this->getOrderClause());
@ -172,15 +172,15 @@ class DifferentialRevisionListData {
$rev->getTableName(),
$this->ids,
array(
DifferentialRevisionStatus::NEEDS_REVIEW,
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
),
$rev->getTableName(),
DifferentialRevision::RELATIONSHIP_TABLE,
DifferentialRevision::RELATION_REVIEWER,
$this->ids,
array(
DifferentialRevisionStatus::NEEDS_REVISION,
DifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
ArcanistDifferentialRevisionStatus::ACCEPTED,
),
$this->getOrderClause());
@ -200,9 +200,9 @@ class DifferentialRevisionListData {
private function getOpenStatuses() {
return array(
DifferentialRevisionStatus::NEEDS_REVIEW,
DifferentialRevisionStatus::NEEDS_REVISION,
DifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
ArcanistDifferentialRevisionStatus::ACCEPTED,
);
}

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/storage/revision');
phutil_require_module('phabricator', 'storage/queryfx');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -133,16 +133,18 @@ class DifferentialCommentEditor {
if (!($actor_is_author || $actor_is_admin)) {
throw new Exception('You can only abandon your revisions.');
}
if ($revision_status == DifferentialRevisionStatus::COMMITTED) {
if ($revision_status ==
ArcanistDifferentialRevisionStatus::COMMITTED) {
throw new Exception('You can not abandon a committed revision.');
}
if ($revision_status == DifferentialRevisionStatus::ABANDONED) {
if ($revision_status ==
ArcanistDifferentialRevisionStatus::ABANDONED) {
$action = DifferentialAction::ACTION_COMMENT;
break;
}
$revision
->setStatus(DifferentialRevisionStatus::ABANDONED)
->setStatus(ArcanistDifferentialRevisionStatus::ABANDONED)
->save();
break;
@ -150,14 +152,16 @@ class DifferentialCommentEditor {
if ($actor_is_author) {
throw new Exception('You can not accept your own revision.');
}
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) &&
($revision_status != DifferentialRevisionStatus::NEEDS_REVISION)) {
if (($revision_status !=
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) &&
($revision_status !=
ArcanistDifferentialRevisionStatus::NEEDS_REVISION)) {
$action = DifferentialAction::ACTION_COMMENT;
break;
}
$revision
->setStatus(DifferentialRevisionStatus::ACCEPTED)
->setStatus(ArcanistDifferentialRevisionStatus::ACCEPTED)
->save();
if (!isset($reviewer_phids[$actor_phid])) {
@ -174,14 +178,16 @@ class DifferentialCommentEditor {
if (!$actor_is_author) {
throw new Exception('You must own a revision to request review.');
}
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVISION) &&
($revision_status != DifferentialRevisionStatus::ACCEPTED)) {
if (($revision_status !=
ArcanistDifferentialRevisionStatus::NEEDS_REVISION) &&
($revision_status !=
ArcanistDifferentialRevisionStatus::ACCEPTED)) {
$action = DifferentialAction::ACTION_COMMENT;
break;
}
$revision
->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW)
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW)
->save();
break;
@ -190,8 +196,10 @@ class DifferentialCommentEditor {
throw new Exception(
'You can not request changes to your own revision.');
}
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) &&
($revision_status != DifferentialRevisionStatus::ACCEPTED)) {
if (($revision_status !=
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) &&
($revision_status !=
ArcanistDifferentialRevisionStatus::ACCEPTED)) {
$action = DifferentialAction::ACTION_COMMENT;
break;
}
@ -206,7 +214,7 @@ class DifferentialCommentEditor {
}
$revision
->setStatus(DifferentialRevisionStatus::NEEDS_REVISION)
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION)
->save();
break;
@ -215,14 +223,16 @@ class DifferentialCommentEditor {
throw new Exception(
"You can not plan changes to somebody else's revision");
}
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) &&
($revision_status != DifferentialRevisionStatus::ACCEPTED)) {
if (($revision_status !=
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) &&
($revision_status !=
ArcanistDifferentialRevisionStatus::ACCEPTED)) {
$action = DifferentialAction::ACTION_COMMENT;
break;
}
$revision
->setStatus(DifferentialRevisionStatus::NEEDS_REVISION)
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION)
->save();
break;
@ -230,18 +240,19 @@ class DifferentialCommentEditor {
if (!$actor_is_author) {
throw new Exception('You can not reclaim a revision you do not own.');
}
if ($revision_status != DifferentialRevisionStatus::ABANDONED) {
if ($revision_status !=
ArcanistDifferentialRevisionStatus::ABANDONED) {
$action = DifferentialAction::ACTION_COMMENT;
break;
}
$revision
->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW)
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW)
->save();
break;
case DifferentialAction::ACTION_COMMIT:
$revision
->setStatus(DifferentialRevisionStatus::COMMITTED)
->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED)
->save();
break;

View file

@ -6,8 +6,9 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/editor/revision');
phutil_require_module('phabricator', 'applications/differential/mail/comment');
phutil_require_module('phabricator', 'applications/differential/storage/changeset');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -49,7 +49,7 @@ class DifferentialRevisionEditor {
$revision->setPHID($revision->generatePHID());
$revision->setAuthorPHID($user_phid);
$revision->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW);
$revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
$editor = new DifferentialRevisionEditor($revision, $user_phid);
@ -176,7 +176,7 @@ class DifferentialRevisionEditor {
// ID for the revision if we don't have one already.
$revision->setLineCount(0);
if ($revision->getStatus() === null) {
$revision->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW);
$revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
}
if ($revision->getTitle() === null) {
$revision->setTitle('Untitled Revision');
@ -381,9 +381,9 @@ class DifferentialRevisionEditor {
// re-diffs after someone accepts with minor changes/suggestions.
$status = $revision->getStatus();
if ($status != DifferentialRevisionStatus::COMMITTED &&
$status != DifferentialRevisionStatus::ACCEPTED) {
$revision->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW);
if ($status != ArcanistDifferentialRevisionStatus::COMMITTED &&
$status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
$revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
}
} else {
@ -861,11 +861,11 @@ class DifferentialRevisionEditor {
case DifferentialRevisionControlSystem::GIT:
foreach ($data as $commit) {
$hashes[] = array(
DifferentialRevisionHash::HASH_GIT_COMMIT,
ArcanistDifferentialRevisionHash::HASH_GIT_COMMIT,
$commit['commit'],
);
$hashes[] = array(
DifferentialRevisionHash::HASH_GIT_TREE,
ArcanistDifferentialRevisionHash::HASH_GIT_TREE,
$commit['tree'],
);
}
@ -873,7 +873,7 @@ class DifferentialRevisionEditor {
case DifferentialRevisionControlSystem::MERCURIAL:
foreach ($data as $commit) {
$hashes[] = array(
DifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
ArcanistDifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
$commit['rev'],
);
}
@ -896,14 +896,14 @@ class DifferentialRevisionEditor {
queryfx(
$conn_w,
'DELETE FROM %T WHERE revisionID = %d',
DifferentialRevisionHash::TABLE_NAME,
ArcanistDifferentialRevisionHash::TABLE_NAME,
$revision->getID());
if ($sql) {
queryfx(
$conn_w,
'INSERT INTO %T (revisionID, type, hash) VALUES %Q',
DifferentialRevisionHash::TABLE_NAME,
ArcanistDifferentialRevisionHash::TABLE_NAME,
implode(', ', $sql));
}
}

View file

@ -6,10 +6,11 @@
phutil_require_module('arcanist', 'differential/constants/revisionhash');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisioncontrolsystem');
phutil_require_module('phabricator', 'applications/differential/constants/revisionhash');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/field/selector/base');
phutil_require_module('phabricator', 'applications/differential/mail/ccwelcome');
phutil_require_module('phabricator', 'applications/differential/mail/newdiff');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,7 +33,7 @@ final class DifferentialRevisionStatusFieldSpecification
$status = $revision->getStatus();
$next_step = null;
if ($status == DifferentialRevisionStatus::ACCEPTED) {
if ($status == ArcanistDifferentialRevisionStatus::ACCEPTED) {
switch ($diff->getSourceControlSystem()) {
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
$next_step = 'arc amend --revision '.$revision->getID();
@ -48,7 +48,8 @@ final class DifferentialRevisionStatusFieldSpecification
'Next step: <tt>'.phutil_escape_html($next_step).'</tt>';
}
}
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
$status =
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status);
return '<strong>'.$status.'</strong>'.$next_step;
}

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/field/specification/base');
phutil_require_module('phabricator', 'applications/repository/constants/repositorytype');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -138,7 +138,8 @@ class DifferentialCommentMail extends DifferentialMail {
$body[] = null;
$revision = $this->getRevision();
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
if ($revision->getStatus() ==
ArcanistDifferentialRevisionStatus::COMMITTED) {
$phids = $revision->loadCommitPHIDs();
if ($phids) {
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();

View file

@ -6,8 +6,9 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/mail/base');
phutil_require_module('phabricator', 'applications/differential/storage/comment');
phutil_require_module('phabricator', 'applications/phid/handle/data');

View file

@ -135,8 +135,9 @@ final class DifferentialRevisionQuery {
* Calling this function will clear anything set by previous calls to
* @{method:withCommitHashes}.
*
* @param array List of pairs <Class DifferentialRevisionHash::HASH_$type
* constant, hash>
* @param array List of pairs <Class
* ArcanistDifferentialRevisionHash::HASH_$type constant,
* hash>
* @return this
* @task config
*/
@ -381,9 +382,9 @@ final class DifferentialRevisionQuery {
$responsible_phid = reset($this->responsibles);
$open_statuses = array(
DifferentialRevisionStatus::NEEDS_REVIEW,
DifferentialRevisionStatus::NEEDS_REVISION,
DifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
ArcanistDifferentialRevisionStatus::ACCEPTED,
);
return queryfx_all(
@ -461,7 +462,7 @@ final class DifferentialRevisionQuery {
$joins[] = qsprintf(
$conn_r,
'JOIN %T hash_rel ON hash_rel.revisionID = r.id',
DifferentialRevisionHash::TABLE_NAME);
ArcanistDifferentialRevisionHash::TABLE_NAME);
}
if ($this->ccs) {
@ -587,9 +588,9 @@ final class DifferentialRevisionQuery {
$conn_r,
'status IN (%Ld)',
array(
DifferentialRevisionStatus::NEEDS_REVIEW,
DifferentialRevisionStatus::NEEDS_REVISION,
DifferentialRevisionStatus::ACCEPTED,
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
ArcanistDifferentialRevisionStatus::ACCEPTED,
));
break;
default:

View file

@ -6,8 +6,9 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionhash');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('arcanist', 'differential/constants/revisionhash');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/storage/affectedpath');
phutil_require_module('phabricator', 'applications/differential/storage/diff');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -205,8 +205,8 @@ class DifferentialRevision extends DifferentialDAO {
public function loadReviewedBy() {
$reviewer = null;
if ($this->status == DifferentialRevisionStatus::ACCEPTED ||
$this->status == DifferentialRevisionStatus::COMMITTED) {
if ($this->status == ArcanistDifferentialRevisionStatus::ACCEPTED ||
$this->status == ArcanistDifferentialRevisionStatus::COMMITTED) {
$comments = $this->loadComments();
foreach ($comments as $comment) {
$action = $comment->getAction();

View file

@ -6,8 +6,9 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/storage/base');
phutil_require_module('phabricator', 'applications/differential/storage/comment');
phutil_require_module('phabricator', 'applications/differential/storage/diff');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -68,7 +68,8 @@ final class DifferentialRevisionListView extends AphrontView {
$rows = array();
foreach ($this->revisions as $revision) {
$status = $revision->getStatus();
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
$status =
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status);
$reviewer_phids = $revision->getReviewers();
if ($reviewer_phids) {

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'view/base');
phutil_require_module('phabricator', 'view/control/table');
phutil_require_module('phabricator', 'view/utils');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -216,8 +216,8 @@ class PhabricatorObjectHandleData {
$handle->setComplete(true);
$status = $rev->getStatus();
if (($status == DifferentialRevisionStatus::COMMITTED) ||
($status == DifferentialRevisionStatus::ABANDONED)) {
if (($status == ArcanistDifferentialRevisionStatus::COMMITTED) ||
($status == ArcanistDifferentialRevisionStatus::ABANDONED)) {
$closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
$handle->setStatus($closed);
}

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/files/storage/file');
phutil_require_module('phabricator', 'applications/maniphest/constants/owner');
phutil_require_module('phabricator', 'applications/maniphest/constants/status');

View file

@ -87,7 +87,8 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
$revision->getID(),
$commit->getPHID());
if ($revision->getStatus() != DifferentialRevisionStatus::COMMITTED) {
if ($revision->getStatus() !=
ArcanistDifferentialRevisionStatus::COMMITTED) {
$message = null;
$committer = $data->getCommitDetail('authorPHID');
if (!$committer) {
@ -123,18 +124,18 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
foreach ($revisions as $revision) {
switch ($revision->getStatus()) {
// "Accepted" revisions -- ostensibly what we're looking for!
case DifferentialRevisionStatus::ACCEPTED:
case ArcanistDifferentialRevisionStatus::ACCEPTED:
$first_choice[] = $revision;
break;
// "Open" revisions
case DifferentialRevisionStatus::NEEDS_REVIEW:
case DifferentialRevisionStatus::NEEDS_REVISION:
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
$second_choice[] = $revision;
break;
// default is a wtf? here
default:
case DifferentialRevisionStatus::ABANDONED:
case DifferentialRevisionStatus::COMMITTED:
case ArcanistDifferentialRevisionStatus::ABANDONED:
case ArcanistDifferentialRevisionStatus::COMMITTED:
$third_choice[] = $revision;
break;
}

View file

@ -6,8 +6,9 @@
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/constants/action');
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/editor/comment');
phutil_require_module('phabricator', 'applications/differential/query/revision');
phutil_require_module('phabricator', 'applications/differential/storage/revision');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -62,8 +62,10 @@ class PhabricatorRepositoryGitCommitMessageParserWorker
$tree_hash = trim($stdout);
return array(
array(DifferentialRevisionHash::HASH_GIT_COMMIT, $commit_hash),
array(DifferentialRevisionHash::HASH_GIT_TREE, $tree_hash),
array(ArcanistDifferentialRevisionHash::HASH_GIT_COMMIT,
$commit_hash),
array(ArcanistDifferentialRevisionHash::HASH_GIT_TREE,
$tree_hash),
);
}

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionhash');
phutil_require_module('arcanist', 'differential/constants/revisionhash');
phutil_require_module('phabricator', 'applications/repository/worker/commitmessageparser/base');
phutil_require_module('phabricator', 'infrastructure/daemon/workers/storage/task');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -55,7 +55,8 @@ class PhabricatorRepositoryMercurialCommitMessageParserWorker
$commit_hash = $commit->getCommitIdentifier();
return array(
array(DifferentialRevisionHash::HASH_MERCURIAL_COMMIT, $commit_hash),
array(ArcanistDifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
$commit_hash),
);
}

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionhash');
phutil_require_module('arcanist', 'differential/constants/revisionhash');
phutil_require_module('phabricator', 'applications/repository/worker/commitmessageparser/base');
phutil_require_module('phabricator', 'infrastructure/daemon/workers/storage/task');

View file

@ -1,7 +1,7 @@
<?php
/*
* Copyright 2011 Facebook, Inc.
* Copyright 2012 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -43,8 +43,8 @@ class PhabricatorSearchDifferentialIndexer
PhabricatorPHIDConstants::PHID_TYPE_USER,
$rev->getDateCreated());
if ($rev->getStatus() != DifferentialRevisionStatus::COMMITTED &&
$rev->getStatus() != DifferentialRevisionStatus::ABANDONED) {
if ($rev->getStatus() != ArcanistDifferentialRevisionStatus::COMMITTED &&
$rev->getStatus() != ArcanistDifferentialRevisionStatus::ABANDONED) {
$doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
$rev->getPHID(),
@ -82,7 +82,7 @@ class PhabricatorSearchDifferentialIndexer
// If a revision needs review, the owners are the reviewers. Otherwise, the
// owner is the author (e.g., accepted, rejected, committed).
if ($rev->getStatus() == DifferentialRevisionStatus::NEEDS_REVIEW) {
if ($rev->getStatus() == ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) {
foreach ($rev->getReviewers() as $phid) {
$doc->addRelationship(
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,

View file

@ -6,7 +6,8 @@
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
phutil_require_module('phabricator', 'applications/differential/storage/inlinecomment');
phutil_require_module('phabricator', 'applications/phid/constants');
phutil_require_module('phabricator', 'applications/phid/handle/data');