1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-25 16:22:42 +01:00

Remove chooseRevision() and DifferentialRevisionRef

Summary: `arc which` and related workflows have supplanted these now-unused mechanisms.

Test Plan: Grepped for chooseRevision() and DifferentialRevisionRef.

Reviewers: btrahan

Reviewed By: btrahan

CC: aran, epriestley

Differential Revision: https://secure.phabricator.com/D1841
This commit is contained in:
epriestley 2012-03-09 08:57:24 -08:00
parent a7866827a2
commit f57199268f
6 changed files with 4 additions and 131 deletions

View file

@ -34,7 +34,11 @@ $builtin = array(
'print' => true, 'print' => true,
'exit' => true, 'exit' => true,
'die' => true, 'die' => true,
// These are provided by libphutil but not visible in the map.
'phutil_is_windows' => true, 'phutil_is_windows' => true,
'phutil_load_library' => true,
// HPHP/i defines these functions as 'internal', but they are NOT // HPHP/i defines these functions as 'internal', but they are NOT
// builtins and do not exist in vanilla PHP. Make sure we don't mark them // builtins and do not exist in vanilla PHP. Make sure we don't mark them

View file

@ -36,7 +36,6 @@ phutil_register_library_map(array(
'ArcanistDifferentialCommitMessage' => 'differential/commitmessage', 'ArcanistDifferentialCommitMessage' => 'differential/commitmessage',
'ArcanistDifferentialCommitMessageParserException' => 'differential/commitmessage', 'ArcanistDifferentialCommitMessageParserException' => 'differential/commitmessage',
'ArcanistDifferentialRevisionHash' => 'differential/constants/revisionhash', 'ArcanistDifferentialRevisionHash' => 'differential/constants/revisionhash',
'ArcanistDifferentialRevisionRef' => 'differential/revision',
'ArcanistDifferentialRevisionStatus' => 'differential/constants/revisionstatus', 'ArcanistDifferentialRevisionStatus' => 'differential/constants/revisionstatus',
'ArcanistDownloadWorkflow' => 'workflow/download', 'ArcanistDownloadWorkflow' => 'workflow/download',
'ArcanistEventType' => 'events/constant/type', 'ArcanistEventType' => 'events/constant/type',

View file

@ -1,54 +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.
*/
/**
* Reference to a Differential revision.
*
* @group differential
*/
final class ArcanistDifferentialRevisionRef {
protected $id;
protected $name;
protected $statusName;
public static function newFromDictionary(array $dictionary) {
$ref = new ArcanistDifferentialRevisionRef();
$ref->id = $dictionary['id'];
$ref->name = $dictionary['name'];
$ref->statusName = $dictionary['statusName'];
return $ref;
}
protected function __construct() {
}
public function getID() {
return $this->id;
}
public function getName() {
return $this->name;
}
public function getStatusName() {
return $this->statusName;
}
}

View file

@ -1,19 +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.
*/
phutil_require_source('ArcanistDifferentialRevisionRef.php');

View file

@ -694,61 +694,6 @@ abstract class ArcanistBaseWorkflow {
} }
} }
protected function chooseRevision(
array $revision_data,
$revision_id,
$prompt = null) {
$revisions = array();
foreach ($revision_data as $data) {
$ref = ArcanistDifferentialRevisionRef::newFromDictionary($data);
$revisions[$ref->getID()] = $ref;
}
if ($revision_id) {
$revision_id = $this->normalizeRevisionID($revision_id);
if (empty($revisions[$revision_id])) {
throw new ArcanistChooseInvalidRevisionException();
}
return $revisions[$revision_id];
}
if (!count($revisions)) {
throw new ArcanistChooseNoRevisionsException();
}
$repository_api = $this->getRepositoryAPI();
$candidates = $revisions;
if (count($candidates) == 1) {
$candidate = reset($candidates);
$revision_id = $candidate->getID();
}
if ($revision_id) {
return $revisions[$revision_id];
}
$revision_indexes = array_keys($revisions);
echo "\n";
$ii = 1;
foreach ($revisions as $revision) {
echo ' ['.$ii++.'] D'.$revision->getID().' '.$revision->getName()."\n";
}
while (true) {
$id = phutil_console_prompt($prompt);
$id = trim(strtoupper($id), 'D');
if (isset($revisions[$id])) {
return $revisions[$id];
}
if (isset($revision_indexes[$id - 1])) {
return $revisions[$revision_indexes[$id - 1]];
}
}
}
protected function loadDiffBundleFromConduit( protected function loadDiffBundleFromConduit(
ConduitClient $conduit, ConduitClient $conduit,

View file

@ -6,8 +6,6 @@
phutil_require_module('arcanist', 'differential/revision');
phutil_require_module('arcanist', 'exception');
phutil_require_module('arcanist', 'exception/usage'); phutil_require_module('arcanist', 'exception/usage');
phutil_require_module('arcanist', 'exception/usage/userabort'); phutil_require_module('arcanist', 'exception/usage/userabort');
phutil_require_module('arcanist', 'parser/bundle'); phutil_require_module('arcanist', 'parser/bundle');