mirror of
https://we.phorge.it/source/phorge.git
synced 2025-04-02 07:28:17 +02: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:
parent
a4ceba9101
commit
2a29a51080
47 changed files with 175 additions and 228 deletions
|
@ -226,14 +226,12 @@ phutil_register_library_map(array(
|
||||||
'DifferentialRevisionDetailView' => 'applications/differential/view/revisiondetail',
|
'DifferentialRevisionDetailView' => 'applications/differential/view/revisiondetail',
|
||||||
'DifferentialRevisionEditController' => 'applications/differential/controller/revisionedit',
|
'DifferentialRevisionEditController' => 'applications/differential/controller/revisionedit',
|
||||||
'DifferentialRevisionEditor' => 'applications/differential/editor/revision',
|
'DifferentialRevisionEditor' => 'applications/differential/editor/revision',
|
||||||
'DifferentialRevisionHash' => 'applications/differential/constants/revisionhash',
|
|
||||||
'DifferentialRevisionIDFieldParserTestCase' => 'applications/differential/field/specification/revisionid/__tests__',
|
'DifferentialRevisionIDFieldParserTestCase' => 'applications/differential/field/specification/revisionid/__tests__',
|
||||||
'DifferentialRevisionIDFieldSpecification' => 'applications/differential/field/specification/revisionid',
|
'DifferentialRevisionIDFieldSpecification' => 'applications/differential/field/specification/revisionid',
|
||||||
'DifferentialRevisionListController' => 'applications/differential/controller/revisionlist',
|
'DifferentialRevisionListController' => 'applications/differential/controller/revisionlist',
|
||||||
'DifferentialRevisionListData' => 'applications/differential/data/revisionlist',
|
'DifferentialRevisionListData' => 'applications/differential/data/revisionlist',
|
||||||
'DifferentialRevisionListView' => 'applications/differential/view/revisionlist',
|
'DifferentialRevisionListView' => 'applications/differential/view/revisionlist',
|
||||||
'DifferentialRevisionQuery' => 'applications/differential/query/revision',
|
'DifferentialRevisionQuery' => 'applications/differential/query/revision',
|
||||||
'DifferentialRevisionStatus' => 'applications/differential/constants/revisionstatus',
|
|
||||||
'DifferentialRevisionStatusFieldSpecification' => 'applications/differential/field/specification/revisionstatus',
|
'DifferentialRevisionStatusFieldSpecification' => 'applications/differential/field/specification/revisionstatus',
|
||||||
'DifferentialRevisionUpdateHistoryView' => 'applications/differential/view/revisionupdatehistory',
|
'DifferentialRevisionUpdateHistoryView' => 'applications/differential/view/revisionupdatehistory',
|
||||||
'DifferentialRevisionViewController' => 'applications/differential/controller/revisionview',
|
'DifferentialRevisionViewController' => 'applications/differential/controller/revisionview',
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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) {
|
if ($parent_id) {
|
||||||
$parent_rev = id(new DifferentialRevision())->load($parent_id);
|
$parent_rev = id(new DifferentialRevision())->load($parent_id);
|
||||||
if ($parent_rev) {
|
if ($parent_rev) {
|
||||||
if ($parent_rev->getStatus() != DifferentialRevisionStatus::COMMITTED) {
|
if ($parent_rev->getStatus() !=
|
||||||
|
ArcanistDifferentialRevisionStatus::COMMITTED) {
|
||||||
$diff->setParentRevisionID($parent_id);
|
$diff->setParentRevisionID($parent_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,11 +6,11 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
|
||||||
phutil_require_module('arcanist', 'parser/diff/change');
|
phutil_require_module('arcanist', 'parser/diff/change');
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'applications/conduit/method/base');
|
phutil_require_module('phabricator', 'applications/conduit/method/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/lintstatus');
|
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/constants/unitstatus');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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),
|
'uri' => PhabricatorEnv::getProductionURI('/D'.$id),
|
||||||
'dateCreated' => $revision->getDateCreated(),
|
'dateCreated' => $revision->getDateCreated(),
|
||||||
'authorPHID' => $revision->getAuthorPHID(),
|
'authorPHID' => $revision->getAuthorPHID(),
|
||||||
'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus(
|
'statusName' =>
|
||||||
$revision->getStatus()),
|
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
|
||||||
|
$revision->getStatus()),
|
||||||
'sourcePath' => $diff->getSourcePath(),
|
'sourcePath' => $diff->getSourcePath(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'applications/conduit/method/base');
|
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', 'applications/differential/data/revisionlist');
|
||||||
phutil_require_module('phabricator', 'infrastructure/env');
|
phutil_require_module('phabricator', 'infrastructure/env');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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()),
|
'uri' => PhabricatorEnv::getURI('/D'.$revision->getID()),
|
||||||
'title' => $revision->getTitle(),
|
'title' => $revision->getTitle(),
|
||||||
'status' => $revision->getStatus(),
|
'status' => $revision->getStatus(),
|
||||||
'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus(
|
'statusName' =>
|
||||||
$revision->getStatus()),
|
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
|
||||||
|
$revision->getStatus()),
|
||||||
'summary' => $revision->getSummary(),
|
'summary' => $revision->getSummary(),
|
||||||
'testPlan' => $revision->getTestPlan(),
|
'testPlan' => $revision->getTestPlan(),
|
||||||
'lineCount' => $revision->getLineCount(),
|
'lineCount' => $revision->getLineCount(),
|
||||||
|
|
|
@ -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/method/base');
|
||||||
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
|
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/field/selector/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/auxiliaryfield');
|
phutil_require_module('phabricator', 'applications/differential/storage/auxiliaryfield');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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');
|
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
|
// This can occur if someone runs 'mark-committed' and hits a race, or
|
||||||
// they have a remote hook installed but don't have the
|
// they have a remote hook installed but don't have the
|
||||||
// 'remote_hook_installed' flag set, or similar. In any case, just treat
|
// '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);
|
DifferentialAction::ACTION_COMMIT);
|
||||||
$editor->save();
|
$editor->save();
|
||||||
|
|
||||||
$revision->setStatus(DifferentialRevisionStatus::COMMITTED);
|
$revision->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED);
|
||||||
$revision->setDateCommitted(time());
|
$revision->setDateCommitted(time());
|
||||||
$revision->save();
|
$revision->save();
|
||||||
|
|
||||||
|
|
|
@ -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/method/base');
|
||||||
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
|
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
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/editor/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function defineParamTypes() {
|
public function defineParamTypes() {
|
||||||
$hash_types = DifferentialRevisionHash::getTypes();
|
$hash_types = ArcanistDifferentialRevisionHash::getTypes();
|
||||||
$hash_types = implode(', ', $hash_types);
|
$hash_types = implode(', ', $hash_types);
|
||||||
|
|
||||||
$status_types = array(
|
$status_types = array(
|
||||||
|
@ -107,7 +107,7 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
if ($commit_hashes) {
|
if ($commit_hashes) {
|
||||||
$hash_types = DifferentialRevisionHash::getTypes();
|
$hash_types = ArcanistDifferentialRevisionHash::getTypes();
|
||||||
foreach ($commit_hashes as $info) {
|
foreach ($commit_hashes as $info) {
|
||||||
list($type, $hash) = $info;
|
list($type, $hash) = $info;
|
||||||
if (empty($type) ||
|
if (empty($type) ||
|
||||||
|
@ -168,8 +168,9 @@ class ConduitAPI_differential_query_Method extends ConduitAPIMethod {
|
||||||
'dateModified' => $revision->getDateModified(),
|
'dateModified' => $revision->getDateModified(),
|
||||||
'authorPHID' => $revision->getAuthorPHID(),
|
'authorPHID' => $revision->getAuthorPHID(),
|
||||||
'status' => $revision->getStatus(),
|
'status' => $revision->getStatus(),
|
||||||
'statusName' => DifferentialRevisionStatus::getNameForRevisionStatus(
|
'statusName' =>
|
||||||
$revision->getStatus()),
|
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus(
|
||||||
|
$revision->getStatus()),
|
||||||
'sourcePath' => $diff->getSourcePath(),
|
'sourcePath' => $diff->getSourcePath(),
|
||||||
'summary' => $revision->getSummary(),
|
'summary' => $revision->getSummary(),
|
||||||
'testPlan' => $revision->getTestPlan(),
|
'testPlan' => $revision->getTestPlan(),
|
||||||
|
|
|
@ -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/method/base');
|
||||||
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
|
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', 'applications/differential/query/revision');
|
||||||
phutil_require_module('phabricator', 'infrastructure/env');
|
phutil_require_module('phabricator', 'infrastructure/env');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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');
|
throw new ConduitException('ERR_WRONG_USER');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
|
if ($revision->getStatus() ==
|
||||||
|
ArcanistDifferentialRevisionStatus::COMMITTED) {
|
||||||
throw new ConduitException('ERR_COMMITTED');
|
throw new ConduitException('ERR_COMMITTED');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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/method/base');
|
||||||
phutil_require_module('phabricator', 'applications/conduit/protocol/exception');
|
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/editor/revision');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
|
@ -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,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,10 +0,0 @@
|
||||||
<?php
|
|
||||||
/**
|
|
||||||
* This file is automatically generated. Lint this module to rebuild it.
|
|
||||||
* @generated
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
phutil_require_source('DifferentialRevisionHash.php');
|
|
|
@ -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');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -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');
|
|
|
@ -373,7 +373,7 @@ class DifferentialRevisionListController extends DifferentialController {
|
||||||
// about) and $waiting (revisions you're waiting on someone else to do
|
// about) and $waiting (revisions you're waiting on someone else to do
|
||||||
// something about).
|
// something about).
|
||||||
foreach ($revisions as $revision) {
|
foreach ($revisions as $revision) {
|
||||||
$status_review = DifferentialRevisionStatus::NEEDS_REVIEW;
|
$status_review = ArcanistDifferentialRevisionStatus::NEEDS_REVIEW;
|
||||||
$needs_review = ($revision->getStatus() == $status_review);
|
$needs_review = ($revision->getStatus() == $status_review);
|
||||||
$filter_is_author = ($revision->getAuthorPHID() == $user_phid);
|
$filter_is_author = ($revision->getAuthorPHID() == $user_phid);
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'aphront/response/redirect');
|
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/controller/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/query/revision');
|
phutil_require_module('phabricator', 'applications/differential/query/revision');
|
||||||
phutil_require_module('phabricator', 'applications/differential/view/revisionlist');
|
phutil_require_module('phabricator', 'applications/differential/view/revisionlist');
|
||||||
|
|
|
@ -403,46 +403,46 @@ class DifferentialRevisionViewController extends DifferentialController {
|
||||||
|
|
||||||
if ($viewer_is_owner) {
|
if ($viewer_is_owner) {
|
||||||
switch ($revision->getStatus()) {
|
switch ($revision->getStatus()) {
|
||||||
case DifferentialRevisionStatus::NEEDS_REVIEW:
|
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
|
||||||
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
||||||
$actions[DifferentialAction::ACTION_RETHINK] = true;
|
$actions[DifferentialAction::ACTION_RETHINK] = true;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::NEEDS_REVISION:
|
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
|
||||||
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
||||||
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::ACCEPTED:
|
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
||||||
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
$actions[DifferentialAction::ACTION_ABANDON] = true;
|
||||||
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
$actions[DifferentialAction::ACTION_REQUEST] = true;
|
||||||
$actions[DifferentialAction::ACTION_RETHINK] = true;
|
$actions[DifferentialAction::ACTION_RETHINK] = true;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::COMMITTED:
|
case ArcanistDifferentialRevisionStatus::COMMITTED:
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::ABANDONED:
|
case ArcanistDifferentialRevisionStatus::ABANDONED:
|
||||||
$actions[DifferentialAction::ACTION_RECLAIM] = true;
|
$actions[DifferentialAction::ACTION_RECLAIM] = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
switch ($revision->getStatus()) {
|
switch ($revision->getStatus()) {
|
||||||
case DifferentialRevisionStatus::NEEDS_REVIEW:
|
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
|
||||||
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
|
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
|
||||||
$actions[DifferentialAction::ACTION_ACCEPT] = true;
|
$actions[DifferentialAction::ACTION_ACCEPT] = true;
|
||||||
$actions[DifferentialAction::ACTION_REJECT] = true;
|
$actions[DifferentialAction::ACTION_REJECT] = true;
|
||||||
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
|
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::NEEDS_REVISION:
|
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
|
||||||
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
|
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
|
||||||
$actions[DifferentialAction::ACTION_ACCEPT] = true;
|
$actions[DifferentialAction::ACTION_ACCEPT] = true;
|
||||||
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
|
$actions[DifferentialAction::ACTION_RESIGN] = $viewer_is_reviewer;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::ACCEPTED:
|
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
||||||
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
|
$admin_actions[DifferentialAction::ACTION_ABANDON] = $viewer_is_admin;
|
||||||
$actions[DifferentialAction::ACTION_REJECT] = true;
|
$actions[DifferentialAction::ACTION_REJECT] = true;
|
||||||
$actions[DifferentialAction::ACTION_RESIGN] =
|
$actions[DifferentialAction::ACTION_RESIGN] =
|
||||||
$viewer_is_reviewer && !$viewer_did_accept;
|
$viewer_is_reviewer && !$viewer_did_accept;
|
||||||
break;
|
break;
|
||||||
case DifferentialRevisionStatus::COMMITTED:
|
case ArcanistDifferentialRevisionStatus::COMMITTED:
|
||||||
case DifferentialRevisionStatus::ABANDONED:
|
case ArcanistDifferentialRevisionStatus::ABANDONED:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,10 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'aphront/response/404');
|
phutil_require_module('phabricator', 'aphront/response/404');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/action');
|
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/controller/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/field/selector/base');
|
phutil_require_module('phabricator', 'applications/differential/field/selector/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/parser/changeset');
|
phutil_require_module('phabricator', 'applications/differential/parser/changeset');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -68,7 +68,7 @@ class DifferentialRevisionListData {
|
||||||
$this->revisions = $this->loadAllWhere(
|
$this->revisions = $this->loadAllWhere(
|
||||||
'revision.status in (%Ld) AND revision.authorPHID in (%Ls)',
|
'revision.status in (%Ld) AND revision.authorPHID in (%Ls)',
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
),
|
),
|
||||||
$this->ids);
|
$this->ids);
|
||||||
break;
|
break;
|
||||||
|
@ -137,15 +137,15 @@ class DifferentialRevisionListData {
|
||||||
$rev->getTableName(),
|
$rev->getTableName(),
|
||||||
$this->ids,
|
$this->ids,
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVISION,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
),
|
),
|
||||||
$rev->getTableName(),
|
$rev->getTableName(),
|
||||||
DifferentialRevision::RELATIONSHIP_TABLE,
|
DifferentialRevision::RELATIONSHIP_TABLE,
|
||||||
DifferentialRevision::RELATION_REVIEWER,
|
DifferentialRevision::RELATION_REVIEWER,
|
||||||
$this->ids,
|
$this->ids,
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVIEW,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
|
||||||
),
|
),
|
||||||
$this->getOrderClause());
|
$this->getOrderClause());
|
||||||
|
|
||||||
|
@ -172,15 +172,15 @@ class DifferentialRevisionListData {
|
||||||
$rev->getTableName(),
|
$rev->getTableName(),
|
||||||
$this->ids,
|
$this->ids,
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVIEW,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
|
||||||
),
|
),
|
||||||
$rev->getTableName(),
|
$rev->getTableName(),
|
||||||
DifferentialRevision::RELATIONSHIP_TABLE,
|
DifferentialRevision::RELATIONSHIP_TABLE,
|
||||||
DifferentialRevision::RELATION_REVIEWER,
|
DifferentialRevision::RELATION_REVIEWER,
|
||||||
$this->ids,
|
$this->ids,
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVISION,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
),
|
),
|
||||||
$this->getOrderClause());
|
$this->getOrderClause());
|
||||||
|
|
||||||
|
@ -200,9 +200,9 @@ class DifferentialRevisionListData {
|
||||||
|
|
||||||
private function getOpenStatuses() {
|
private function getOpenStatuses() {
|
||||||
return array(
|
return array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVIEW,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
|
||||||
DifferentialRevisionStatus::NEEDS_REVISION,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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', 'applications/differential/storage/revision');
|
||||||
phutil_require_module('phabricator', 'storage/queryfx');
|
phutil_require_module('phabricator', 'storage/queryfx');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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)) {
|
if (!($actor_is_author || $actor_is_admin)) {
|
||||||
throw new Exception('You can only abandon your revisions.');
|
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.');
|
throw new Exception('You can not abandon a committed revision.');
|
||||||
}
|
}
|
||||||
if ($revision_status == DifferentialRevisionStatus::ABANDONED) {
|
if ($revision_status ==
|
||||||
|
ArcanistDifferentialRevisionStatus::ABANDONED) {
|
||||||
$action = DifferentialAction::ACTION_COMMENT;
|
$action = DifferentialAction::ACTION_COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::ABANDONED)
|
->setStatus(ArcanistDifferentialRevisionStatus::ABANDONED)
|
||||||
->save();
|
->save();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -150,14 +152,16 @@ class DifferentialCommentEditor {
|
||||||
if ($actor_is_author) {
|
if ($actor_is_author) {
|
||||||
throw new Exception('You can not accept your own revision.');
|
throw new Exception('You can not accept your own revision.');
|
||||||
}
|
}
|
||||||
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) &&
|
if (($revision_status !=
|
||||||
($revision_status != DifferentialRevisionStatus::NEEDS_REVISION)) {
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) &&
|
||||||
|
($revision_status !=
|
||||||
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION)) {
|
||||||
$action = DifferentialAction::ACTION_COMMENT;
|
$action = DifferentialAction::ACTION_COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::ACCEPTED)
|
->setStatus(ArcanistDifferentialRevisionStatus::ACCEPTED)
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
if (!isset($reviewer_phids[$actor_phid])) {
|
if (!isset($reviewer_phids[$actor_phid])) {
|
||||||
|
@ -174,14 +178,16 @@ class DifferentialCommentEditor {
|
||||||
if (!$actor_is_author) {
|
if (!$actor_is_author) {
|
||||||
throw new Exception('You must own a revision to request review.');
|
throw new Exception('You must own a revision to request review.');
|
||||||
}
|
}
|
||||||
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVISION) &&
|
if (($revision_status !=
|
||||||
($revision_status != DifferentialRevisionStatus::ACCEPTED)) {
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION) &&
|
||||||
|
($revision_status !=
|
||||||
|
ArcanistDifferentialRevisionStatus::ACCEPTED)) {
|
||||||
$action = DifferentialAction::ACTION_COMMENT;
|
$action = DifferentialAction::ACTION_COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW)
|
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW)
|
||||||
->save();
|
->save();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -190,8 +196,10 @@ class DifferentialCommentEditor {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
'You can not request changes to your own revision.');
|
'You can not request changes to your own revision.');
|
||||||
}
|
}
|
||||||
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) &&
|
if (($revision_status !=
|
||||||
($revision_status != DifferentialRevisionStatus::ACCEPTED)) {
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) &&
|
||||||
|
($revision_status !=
|
||||||
|
ArcanistDifferentialRevisionStatus::ACCEPTED)) {
|
||||||
$action = DifferentialAction::ACTION_COMMENT;
|
$action = DifferentialAction::ACTION_COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -206,7 +214,7 @@ class DifferentialCommentEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::NEEDS_REVISION)
|
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION)
|
||||||
->save();
|
->save();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -215,14 +223,16 @@ class DifferentialCommentEditor {
|
||||||
throw new Exception(
|
throw new Exception(
|
||||||
"You can not plan changes to somebody else's revision");
|
"You can not plan changes to somebody else's revision");
|
||||||
}
|
}
|
||||||
if (($revision_status != DifferentialRevisionStatus::NEEDS_REVIEW) &&
|
if (($revision_status !=
|
||||||
($revision_status != DifferentialRevisionStatus::ACCEPTED)) {
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW) &&
|
||||||
|
($revision_status !=
|
||||||
|
ArcanistDifferentialRevisionStatus::ACCEPTED)) {
|
||||||
$action = DifferentialAction::ACTION_COMMENT;
|
$action = DifferentialAction::ACTION_COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::NEEDS_REVISION)
|
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVISION)
|
||||||
->save();
|
->save();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -230,18 +240,19 @@ class DifferentialCommentEditor {
|
||||||
if (!$actor_is_author) {
|
if (!$actor_is_author) {
|
||||||
throw new Exception('You can not reclaim a revision you do not own.');
|
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;
|
$action = DifferentialAction::ACTION_COMMENT;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW)
|
->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW)
|
||||||
->save();
|
->save();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DifferentialAction::ACTION_COMMIT:
|
case DifferentialAction::ACTION_COMMIT:
|
||||||
$revision
|
$revision
|
||||||
->setStatus(DifferentialRevisionStatus::COMMITTED)
|
->setStatus(ArcanistDifferentialRevisionStatus::COMMITTED)
|
||||||
->save();
|
->save();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -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/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/editor/revision');
|
phutil_require_module('phabricator', 'applications/differential/editor/revision');
|
||||||
phutil_require_module('phabricator', 'applications/differential/mail/comment');
|
phutil_require_module('phabricator', 'applications/differential/mail/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/changeset');
|
phutil_require_module('phabricator', 'applications/differential/storage/changeset');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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->setPHID($revision->generatePHID());
|
||||||
|
|
||||||
$revision->setAuthorPHID($user_phid);
|
$revision->setAuthorPHID($user_phid);
|
||||||
$revision->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW);
|
$revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
|
||||||
|
|
||||||
$editor = new DifferentialRevisionEditor($revision, $user_phid);
|
$editor = new DifferentialRevisionEditor($revision, $user_phid);
|
||||||
|
|
||||||
|
@ -176,7 +176,7 @@ class DifferentialRevisionEditor {
|
||||||
// ID for the revision if we don't have one already.
|
// ID for the revision if we don't have one already.
|
||||||
$revision->setLineCount(0);
|
$revision->setLineCount(0);
|
||||||
if ($revision->getStatus() === null) {
|
if ($revision->getStatus() === null) {
|
||||||
$revision->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW);
|
$revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
|
||||||
}
|
}
|
||||||
if ($revision->getTitle() === null) {
|
if ($revision->getTitle() === null) {
|
||||||
$revision->setTitle('Untitled Revision');
|
$revision->setTitle('Untitled Revision');
|
||||||
|
@ -381,9 +381,9 @@ class DifferentialRevisionEditor {
|
||||||
// re-diffs after someone accepts with minor changes/suggestions.
|
// re-diffs after someone accepts with minor changes/suggestions.
|
||||||
|
|
||||||
$status = $revision->getStatus();
|
$status = $revision->getStatus();
|
||||||
if ($status != DifferentialRevisionStatus::COMMITTED &&
|
if ($status != ArcanistDifferentialRevisionStatus::COMMITTED &&
|
||||||
$status != DifferentialRevisionStatus::ACCEPTED) {
|
$status != ArcanistDifferentialRevisionStatus::ACCEPTED) {
|
||||||
$revision->setStatus(DifferentialRevisionStatus::NEEDS_REVIEW);
|
$revision->setStatus(ArcanistDifferentialRevisionStatus::NEEDS_REVIEW);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -861,11 +861,11 @@ class DifferentialRevisionEditor {
|
||||||
case DifferentialRevisionControlSystem::GIT:
|
case DifferentialRevisionControlSystem::GIT:
|
||||||
foreach ($data as $commit) {
|
foreach ($data as $commit) {
|
||||||
$hashes[] = array(
|
$hashes[] = array(
|
||||||
DifferentialRevisionHash::HASH_GIT_COMMIT,
|
ArcanistDifferentialRevisionHash::HASH_GIT_COMMIT,
|
||||||
$commit['commit'],
|
$commit['commit'],
|
||||||
);
|
);
|
||||||
$hashes[] = array(
|
$hashes[] = array(
|
||||||
DifferentialRevisionHash::HASH_GIT_TREE,
|
ArcanistDifferentialRevisionHash::HASH_GIT_TREE,
|
||||||
$commit['tree'],
|
$commit['tree'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -873,7 +873,7 @@ class DifferentialRevisionEditor {
|
||||||
case DifferentialRevisionControlSystem::MERCURIAL:
|
case DifferentialRevisionControlSystem::MERCURIAL:
|
||||||
foreach ($data as $commit) {
|
foreach ($data as $commit) {
|
||||||
$hashes[] = array(
|
$hashes[] = array(
|
||||||
DifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
|
ArcanistDifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
|
||||||
$commit['rev'],
|
$commit['rev'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -896,14 +896,14 @@ class DifferentialRevisionEditor {
|
||||||
queryfx(
|
queryfx(
|
||||||
$conn_w,
|
$conn_w,
|
||||||
'DELETE FROM %T WHERE revisionID = %d',
|
'DELETE FROM %T WHERE revisionID = %d',
|
||||||
DifferentialRevisionHash::TABLE_NAME,
|
ArcanistDifferentialRevisionHash::TABLE_NAME,
|
||||||
$revision->getID());
|
$revision->getID());
|
||||||
|
|
||||||
if ($sql) {
|
if ($sql) {
|
||||||
queryfx(
|
queryfx(
|
||||||
$conn_w,
|
$conn_w,
|
||||||
'INSERT INTO %T (revisionID, type, hash) VALUES %Q',
|
'INSERT INTO %T (revisionID, type, hash) VALUES %Q',
|
||||||
DifferentialRevisionHash::TABLE_NAME,
|
ArcanistDifferentialRevisionHash::TABLE_NAME,
|
||||||
implode(', ', $sql));
|
implode(', ', $sql));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisioncontrolsystem');
|
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/field/selector/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/mail/ccwelcome');
|
phutil_require_module('phabricator', 'applications/differential/mail/ccwelcome');
|
||||||
phutil_require_module('phabricator', 'applications/differential/mail/newdiff');
|
phutil_require_module('phabricator', 'applications/differential/mail/newdiff');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -33,7 +33,7 @@ final class DifferentialRevisionStatusFieldSpecification
|
||||||
|
|
||||||
$status = $revision->getStatus();
|
$status = $revision->getStatus();
|
||||||
$next_step = null;
|
$next_step = null;
|
||||||
if ($status == DifferentialRevisionStatus::ACCEPTED) {
|
if ($status == ArcanistDifferentialRevisionStatus::ACCEPTED) {
|
||||||
switch ($diff->getSourceControlSystem()) {
|
switch ($diff->getSourceControlSystem()) {
|
||||||
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:
|
||||||
$next_step = 'arc amend --revision '.$revision->getID();
|
$next_step = 'arc amend --revision '.$revision->getID();
|
||||||
|
@ -48,7 +48,8 @@ final class DifferentialRevisionStatusFieldSpecification
|
||||||
'Next step: <tt>'.phutil_escape_html($next_step).'</tt>';
|
'Next step: <tt>'.phutil_escape_html($next_step).'</tt>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
|
$status =
|
||||||
|
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status);
|
||||||
return '<strong>'.$status.'</strong>'.$next_step;
|
return '<strong>'.$status.'</strong>'.$next_step;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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/differential/field/specification/base');
|
||||||
phutil_require_module('phabricator', 'applications/repository/constants/repositorytype');
|
phutil_require_module('phabricator', 'applications/repository/constants/repositorytype');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -138,7 +138,8 @@ class DifferentialCommentMail extends DifferentialMail {
|
||||||
$body[] = null;
|
$body[] = null;
|
||||||
|
|
||||||
$revision = $this->getRevision();
|
$revision = $this->getRevision();
|
||||||
if ($revision->getStatus() == DifferentialRevisionStatus::COMMITTED) {
|
if ($revision->getStatus() ==
|
||||||
|
ArcanistDifferentialRevisionStatus::COMMITTED) {
|
||||||
$phids = $revision->loadCommitPHIDs();
|
$phids = $revision->loadCommitPHIDs();
|
||||||
if ($phids) {
|
if ($phids) {
|
||||||
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
$handles = id(new PhabricatorObjectHandleData($phids))->loadHandles();
|
||||||
|
|
|
@ -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/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/mail/base');
|
phutil_require_module('phabricator', 'applications/differential/mail/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/comment');
|
phutil_require_module('phabricator', 'applications/differential/storage/comment');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||||
|
|
|
@ -135,8 +135,9 @@ final class DifferentialRevisionQuery {
|
||||||
* Calling this function will clear anything set by previous calls to
|
* Calling this function will clear anything set by previous calls to
|
||||||
* @{method:withCommitHashes}.
|
* @{method:withCommitHashes}.
|
||||||
*
|
*
|
||||||
* @param array List of pairs <Class DifferentialRevisionHash::HASH_$type
|
* @param array List of pairs <Class
|
||||||
* constant, hash>
|
* ArcanistDifferentialRevisionHash::HASH_$type constant,
|
||||||
|
* hash>
|
||||||
* @return this
|
* @return this
|
||||||
* @task config
|
* @task config
|
||||||
*/
|
*/
|
||||||
|
@ -381,9 +382,9 @@ final class DifferentialRevisionQuery {
|
||||||
|
|
||||||
$responsible_phid = reset($this->responsibles);
|
$responsible_phid = reset($this->responsibles);
|
||||||
$open_statuses = array(
|
$open_statuses = array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVIEW,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
|
||||||
DifferentialRevisionStatus::NEEDS_REVISION,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
);
|
);
|
||||||
|
|
||||||
return queryfx_all(
|
return queryfx_all(
|
||||||
|
@ -461,7 +462,7 @@ final class DifferentialRevisionQuery {
|
||||||
$joins[] = qsprintf(
|
$joins[] = qsprintf(
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'JOIN %T hash_rel ON hash_rel.revisionID = r.id',
|
'JOIN %T hash_rel ON hash_rel.revisionID = r.id',
|
||||||
DifferentialRevisionHash::TABLE_NAME);
|
ArcanistDifferentialRevisionHash::TABLE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->ccs) {
|
if ($this->ccs) {
|
||||||
|
@ -587,9 +588,9 @@ final class DifferentialRevisionQuery {
|
||||||
$conn_r,
|
$conn_r,
|
||||||
'status IN (%Ld)',
|
'status IN (%Ld)',
|
||||||
array(
|
array(
|
||||||
DifferentialRevisionStatus::NEEDS_REVIEW,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVIEW,
|
||||||
DifferentialRevisionStatus::NEEDS_REVISION,
|
ArcanistDifferentialRevisionStatus::NEEDS_REVISION,
|
||||||
DifferentialRevisionStatus::ACCEPTED,
|
ArcanistDifferentialRevisionStatus::ACCEPTED,
|
||||||
));
|
));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -6,8 +6,9 @@
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionhash');
|
phutil_require_module('arcanist', 'differential/constants/revisionhash');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
phutil_require_module('arcanist', 'differential/constants/revisionstatus');
|
||||||
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/affectedpath');
|
phutil_require_module('phabricator', 'applications/differential/storage/affectedpath');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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() {
|
public function loadReviewedBy() {
|
||||||
$reviewer = null;
|
$reviewer = null;
|
||||||
|
|
||||||
if ($this->status == DifferentialRevisionStatus::ACCEPTED ||
|
if ($this->status == ArcanistDifferentialRevisionStatus::ACCEPTED ||
|
||||||
$this->status == DifferentialRevisionStatus::COMMITTED) {
|
$this->status == ArcanistDifferentialRevisionStatus::COMMITTED) {
|
||||||
$comments = $this->loadComments();
|
$comments = $this->loadComments();
|
||||||
foreach ($comments as $comment) {
|
foreach ($comments as $comment) {
|
||||||
$action = $comment->getAction();
|
$action = $comment->getAction();
|
||||||
|
|
|
@ -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/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/base');
|
phutil_require_module('phabricator', 'applications/differential/storage/base');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/comment');
|
phutil_require_module('phabricator', 'applications/differential/storage/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
phutil_require_module('phabricator', 'applications/differential/storage/diff');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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();
|
$rows = array();
|
||||||
foreach ($this->revisions as $revision) {
|
foreach ($this->revisions as $revision) {
|
||||||
$status = $revision->getStatus();
|
$status = $revision->getStatus();
|
||||||
$status = DifferentialRevisionStatus::getNameForRevisionStatus($status);
|
$status =
|
||||||
|
ArcanistDifferentialRevisionStatus::getNameForRevisionStatus($status);
|
||||||
|
|
||||||
$reviewer_phids = $revision->getReviewers();
|
$reviewer_phids = $revision->getReviewers();
|
||||||
if ($reviewer_phids) {
|
if ($reviewer_phids) {
|
||||||
|
|
|
@ -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/base');
|
||||||
phutil_require_module('phabricator', 'view/control/table');
|
phutil_require_module('phabricator', 'view/control/table');
|
||||||
phutil_require_module('phabricator', 'view/utils');
|
phutil_require_module('phabricator', 'view/utils');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -216,8 +216,8 @@ class PhabricatorObjectHandleData {
|
||||||
$handle->setComplete(true);
|
$handle->setComplete(true);
|
||||||
|
|
||||||
$status = $rev->getStatus();
|
$status = $rev->getStatus();
|
||||||
if (($status == DifferentialRevisionStatus::COMMITTED) ||
|
if (($status == ArcanistDifferentialRevisionStatus::COMMITTED) ||
|
||||||
($status == DifferentialRevisionStatus::ABANDONED)) {
|
($status == ArcanistDifferentialRevisionStatus::ABANDONED)) {
|
||||||
$closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
|
$closed = PhabricatorObjectHandleStatus::STATUS_CLOSED;
|
||||||
$handle->setStatus($closed);
|
$handle->setStatus($closed);
|
||||||
}
|
}
|
||||||
|
|
|
@ -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/files/storage/file');
|
||||||
phutil_require_module('phabricator', 'applications/maniphest/constants/owner');
|
phutil_require_module('phabricator', 'applications/maniphest/constants/owner');
|
||||||
phutil_require_module('phabricator', 'applications/maniphest/constants/status');
|
phutil_require_module('phabricator', 'applications/maniphest/constants/status');
|
||||||
|
|
|
@ -87,7 +87,8 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
||||||
$revision->getID(),
|
$revision->getID(),
|
||||||
$commit->getPHID());
|
$commit->getPHID());
|
||||||
|
|
||||||
if ($revision->getStatus() != DifferentialRevisionStatus::COMMITTED) {
|
if ($revision->getStatus() !=
|
||||||
|
ArcanistDifferentialRevisionStatus::COMMITTED) {
|
||||||
$message = null;
|
$message = null;
|
||||||
$committer = $data->getCommitDetail('authorPHID');
|
$committer = $data->getCommitDetail('authorPHID');
|
||||||
if (!$committer) {
|
if (!$committer) {
|
||||||
|
@ -123,18 +124,18 @@ abstract class PhabricatorRepositoryCommitMessageParserWorker
|
||||||
foreach ($revisions as $revision) {
|
foreach ($revisions as $revision) {
|
||||||
switch ($revision->getStatus()) {
|
switch ($revision->getStatus()) {
|
||||||
// "Accepted" revisions -- ostensibly what we're looking for!
|
// "Accepted" revisions -- ostensibly what we're looking for!
|
||||||
case DifferentialRevisionStatus::ACCEPTED:
|
case ArcanistDifferentialRevisionStatus::ACCEPTED:
|
||||||
$first_choice[] = $revision;
|
$first_choice[] = $revision;
|
||||||
break;
|
break;
|
||||||
// "Open" revisions
|
// "Open" revisions
|
||||||
case DifferentialRevisionStatus::NEEDS_REVIEW:
|
case ArcanistDifferentialRevisionStatus::NEEDS_REVIEW:
|
||||||
case DifferentialRevisionStatus::NEEDS_REVISION:
|
case ArcanistDifferentialRevisionStatus::NEEDS_REVISION:
|
||||||
$second_choice[] = $revision;
|
$second_choice[] = $revision;
|
||||||
break;
|
break;
|
||||||
// default is a wtf? here
|
// default is a wtf? here
|
||||||
default:
|
default:
|
||||||
case DifferentialRevisionStatus::ABANDONED:
|
case ArcanistDifferentialRevisionStatus::ABANDONED:
|
||||||
case DifferentialRevisionStatus::COMMITTED:
|
case ArcanistDifferentialRevisionStatus::COMMITTED:
|
||||||
$third_choice[] = $revision;
|
$third_choice[] = $revision;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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/action');
|
||||||
phutil_require_module('phabricator', 'applications/differential/constants/revisionstatus');
|
|
||||||
phutil_require_module('phabricator', 'applications/differential/editor/comment');
|
phutil_require_module('phabricator', 'applications/differential/editor/comment');
|
||||||
phutil_require_module('phabricator', 'applications/differential/query/revision');
|
phutil_require_module('phabricator', 'applications/differential/query/revision');
|
||||||
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
phutil_require_module('phabricator', 'applications/differential/storage/revision');
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -62,8 +62,10 @@ class PhabricatorRepositoryGitCommitMessageParserWorker
|
||||||
$tree_hash = trim($stdout);
|
$tree_hash = trim($stdout);
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
array(DifferentialRevisionHash::HASH_GIT_COMMIT, $commit_hash),
|
array(ArcanistDifferentialRevisionHash::HASH_GIT_COMMIT,
|
||||||
array(DifferentialRevisionHash::HASH_GIT_TREE, $tree_hash),
|
$commit_hash),
|
||||||
|
array(ArcanistDifferentialRevisionHash::HASH_GIT_TREE,
|
||||||
|
$tree_hash),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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', 'applications/repository/worker/commitmessageparser/base');
|
||||||
phutil_require_module('phabricator', 'infrastructure/daemon/workers/storage/task');
|
phutil_require_module('phabricator', 'infrastructure/daemon/workers/storage/task');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -55,7 +55,8 @@ class PhabricatorRepositoryMercurialCommitMessageParserWorker
|
||||||
$commit_hash = $commit->getCommitIdentifier();
|
$commit_hash = $commit->getCommitIdentifier();
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
array(DifferentialRevisionHash::HASH_MERCURIAL_COMMIT, $commit_hash),
|
array(ArcanistDifferentialRevisionHash::HASH_MERCURIAL_COMMIT,
|
||||||
|
$commit_hash),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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', 'applications/repository/worker/commitmessageparser/base');
|
||||||
phutil_require_module('phabricator', 'infrastructure/daemon/workers/storage/task');
|
phutil_require_module('phabricator', 'infrastructure/daemon/workers/storage/task');
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Facebook, Inc.
|
* Copyright 2012 Facebook, Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -43,8 +43,8 @@ class PhabricatorSearchDifferentialIndexer
|
||||||
PhabricatorPHIDConstants::PHID_TYPE_USER,
|
PhabricatorPHIDConstants::PHID_TYPE_USER,
|
||||||
$rev->getDateCreated());
|
$rev->getDateCreated());
|
||||||
|
|
||||||
if ($rev->getStatus() != DifferentialRevisionStatus::COMMITTED &&
|
if ($rev->getStatus() != ArcanistDifferentialRevisionStatus::COMMITTED &&
|
||||||
$rev->getStatus() != DifferentialRevisionStatus::ABANDONED) {
|
$rev->getStatus() != ArcanistDifferentialRevisionStatus::ABANDONED) {
|
||||||
$doc->addRelationship(
|
$doc->addRelationship(
|
||||||
PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
|
PhabricatorSearchRelationship::RELATIONSHIP_OPEN,
|
||||||
$rev->getPHID(),
|
$rev->getPHID(),
|
||||||
|
@ -82,7 +82,7 @@ class PhabricatorSearchDifferentialIndexer
|
||||||
|
|
||||||
// If a revision needs review, the owners are the reviewers. Otherwise, the
|
// If a revision needs review, the owners are the reviewers. Otherwise, the
|
||||||
// owner is the author (e.g., accepted, rejected, committed).
|
// 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) {
|
foreach ($rev->getReviewers() as $phid) {
|
||||||
$doc->addRelationship(
|
$doc->addRelationship(
|
||||||
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
|
PhabricatorSearchRelationship::RELATIONSHIP_OWNER,
|
||||||
|
|
|
@ -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/differential/storage/inlinecomment');
|
||||||
phutil_require_module('phabricator', 'applications/phid/constants');
|
phutil_require_module('phabricator', 'applications/phid/constants');
|
||||||
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
phutil_require_module('phabricator', 'applications/phid/handle/data');
|
||||||
|
|
Loading…
Add table
Reference in a new issue