]> khamidou — GitHub mirrors - arcanist.git/commitdiff
Remove chooseRevision() and DifferentialRevisionRef
authorepriestley <git@epriestley.com>
Fri, 9 Mar 2012 16:57:24 +0000 (08:57 -0800)
committerepriestley <git@epriestley.com>
Fri, 9 Mar 2012 16:57:24 +0000 (08:57 -0800)
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

scripts/phutil_analyzer.php
src/__phutil_library_map__.php
src/differential/revision/ArcanistDifferentialRevisionRef.php [deleted file]
src/differential/revision/__init__.php [deleted file]
src/workflow/base/ArcanistBaseWorkflow.php
src/workflow/base/__init__.php

index 48c59a3268a00cec4fc64c2d51a7c42df10d0d33..b43ff30903a6016fc11d9a450e1e49a448ba9a8e 100755 (executable)
@@ -34,7 +34,11 @@ $builtin = array(
       'print' => true,
       'exit'  => true,
       'die'   => true,
+
+      // These are provided by libphutil but not visible in the map.
+
       'phutil_is_windows'   => true,
+      'phutil_load_library' => true,
 
       // 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
index c6f3b428748dfcfea7fc8addb10ca1424f68879e..b695ff7ef7ccd64752b0e2e001ed190adabfec5b 100644 (file)
@@ -36,7 +36,6 @@ phutil_register_library_map(array(
     'ArcanistDifferentialCommitMessage' => 'differential/commitmessage',
     'ArcanistDifferentialCommitMessageParserException' => 'differential/commitmessage',
     'ArcanistDifferentialRevisionHash' => 'differential/constants/revisionhash',
-    'ArcanistDifferentialRevisionRef' => 'differential/revision',
     'ArcanistDifferentialRevisionStatus' => 'differential/constants/revisionstatus',
     'ArcanistDownloadWorkflow' => 'workflow/download',
     'ArcanistEventType' => 'events/constant/type',
diff --git a/src/differential/revision/ArcanistDifferentialRevisionRef.php b/src/differential/revision/ArcanistDifferentialRevisionRef.php
deleted file mode 100644 (file)
index be8ab60..0000000
+++ /dev/null
@@ -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;
-  }
-
-}
diff --git a/src/differential/revision/__init__.php b/src/differential/revision/__init__.php
deleted file mode 100644 (file)
index 1d454f9..0000000
+++ /dev/null
@@ -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');
index 41bfa6d311f4d4cee2654d22ec0e80b19d4ca1b6..3d1b1e1fe89acb91980315553284ba2feeece15d 100644 (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(
     ConduitClient $conduit,
index 49420f4d2fca53ff0634ba685323ed1606b620d3..f409b1b0506dda1d92e0be6f3c6c7406e3fcd3f6 100644 (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/userabort');
 phutil_require_module('arcanist', 'parser/bundle');