Page MenuHomePhabricator

D12945.id31179.diff
No OneTemporary

D12945.id31179.diff

diff --git a/scripts/arcanist.php b/scripts/arcanist.php
--- a/scripts/arcanist.php
+++ b/scripts/arcanist.php
@@ -671,7 +671,8 @@
ArcanistWorkingCopyIdentity $working_copy,
array $original_argv) {
- $project_id = $working_copy->getProjectID();
+ // TODO
+ $project_id = $working_copy->getProjectConfig('project.name');
if ($project_id != 'arcanist' && $project_id != 'libphutil') {
// We're not in a copy of arcanist or libphutil.
return;
diff --git a/src/configuration/ArcanistSettings.php b/src/configuration/ArcanistSettings.php
--- a/src/configuration/ArcanistSettings.php
+++ b/src/configuration/ArcanistSettings.php
@@ -49,15 +49,6 @@
'Associates this working copy with a specific installation of '.
'Phabricator.'),
),
- 'project.name' => array(
- 'type' => 'string',
- 'legacy' => 'project_id',
- 'example' => '"arcanist"',
- 'help' => pht(
- 'Associates this working copy with a named Arcanist Project. '.
- 'This is primarily useful if you use SVN and have several different '.
- 'projects in the same repository.'),
- ),
'lint.engine' => array(
'type' => 'string',
'legacy' => 'lint_engine',
diff --git a/src/parser/ArcanistBundle.php b/src/parser/ArcanistBundle.php
--- a/src/parser/ArcanistBundle.php
+++ b/src/parser/ArcanistBundle.php
@@ -9,7 +9,6 @@
private $conduit;
private $blobs = array();
private $diskPath;
- private $projectID;
private $baseRevision;
private $revisionID;
private $encoding;
@@ -63,15 +62,6 @@
return $this;
}
- public function setProjectID($project_id) {
- $this->projectID = $project_id;
- return $this;
- }
-
- public function getProjectID() {
- return $this->projectID;
- }
-
public function setBaseRevision($base_revision) {
$this->baseRevision = $base_revision;
return $this;
@@ -143,7 +133,6 @@
$path);
$meta_info = $future->resolveJSON();
$version = idx($meta_info, 'version', 0);
- $project_name = idx($meta_info, 'projectName');
$base_revision = idx($meta_info, 'baseRevision');
$revision_id = idx($meta_info, 'revisionID');
$encoding = idx($meta_info, 'encoding');
@@ -152,7 +141,6 @@
} else {
// this arc bundle was probably made before we started storing meta info
$version = 0;
- $project_name = null;
$base_revision = null;
$revision_id = null;
$encoding = null;
@@ -178,7 +166,6 @@
$obj = new ArcanistBundle();
$obj->changes = $changes;
$obj->diskPath = $path;
- $obj->setProjectID($project_name);
$obj->setBaseRevision($base_revision);
$obj->setRevisionID($revision_id);
$obj->setEncoding($encoding);
@@ -228,7 +215,6 @@
$meta_info = array(
'version' => 5,
- 'projectName' => $this->getProjectID(),
'baseRevision' => $this->getBaseRevision(),
'revisionID' => $this->getRevisionID(),
'encoding' => $this->getEncoding(),
diff --git a/src/repository/api/ArcanistSubversionAPI.php b/src/repository/api/ArcanistSubversionAPI.php
--- a/src/repository/api/ArcanistSubversionAPI.php
+++ b/src/repository/api/ArcanistSubversionAPI.php
@@ -648,17 +648,7 @@
ConduitClient $conduit,
array $query) {
- // We don't have much to go on in SVN, look for revisions that came from
- // this directory and belong to the same project.
-
- $project = $this->getWorkingCopyIdentity()->getProjectID();
- if (!$project) {
- return array();
- }
-
- $results = $conduit->callMethodSynchronous(
- 'differential.query',
- $query);
+ $results = $conduit->callMethodSynchronous('differential.query', $query);
foreach ($results as $key => $result) {
if ($result['sourcePath'] != $this->getPath()) {
@@ -667,8 +657,7 @@
}
foreach ($results as $key => $result) {
- $results[$key]['why'] = pht(
- 'Matching arcanist project name and working copy directory path.');
+ $results[$key]['why'] = pht('Matching working copy directory path.');
}
return $results;
diff --git a/src/workflow/ArcanistDiffWorkflow.php b/src/workflow/ArcanistDiffWorkflow.php
--- a/src/workflow/ArcanistDiffWorkflow.php
+++ b/src/workflow/ArcanistDiffWorkflow.php
@@ -2240,11 +2240,6 @@
}
}
- $project_id = null;
- if ($this->requiresWorkingCopy()) {
- $project_id = $this->getWorkingCopy()->getProjectID();
- }
-
$data = array(
'sourceMachine' => php_uname('n'),
'sourcePath' => $source_path,
diff --git a/src/workflow/ArcanistExportWorkflow.php b/src/workflow/ArcanistExportWorkflow.php
--- a/src/workflow/ArcanistExportWorkflow.php
+++ b/src/workflow/ArcanistExportWorkflow.php
@@ -225,7 +225,6 @@
}
$bundle = ArcanistBundle::newFromChanges($changes);
- $bundle->setProjectID($this->getWorkingCopy()->getProjectID());
$bundle->setBaseRevision(
$repository_api->getSourceControlBaseRevision());
// NOTE: we can't get a revision ID for SOURCE_LOCAL
@@ -247,18 +246,6 @@
}
$try_encoding = nonempty($this->getArgument('encoding'), null);
- if (!$try_encoding) {
- try {
- $project_info = $this->getConduit()->callMethodSynchronous(
- 'arcanist.projectinfo',
- array(
- 'name' => $bundle->getProjectID(),
- ));
- $try_encoding = $project_info['encoding'];
- } catch (ConduitClientException $e) {
- $try_encoding = null;
- }
- }
if ($try_encoding) {
$bundle->setEncoding($try_encoding);
diff --git a/src/workflow/ArcanistPatchWorkflow.php b/src/workflow/ArcanistPatchWorkflow.php
--- a/src/workflow/ArcanistPatchWorkflow.php
+++ b/src/workflow/ArcanistPatchWorkflow.php
@@ -954,35 +954,6 @@
private function sanityCheck(ArcanistBundle $bundle) {
$repository_api = $this->getRepositoryAPI();
- // Check to see if the bundle's project id matches the working copy
- // project id
- $bundle_project_id = $bundle->getProjectID();
- $working_copy_project_id = $this->getWorkingCopy()->getProjectID();
- if (empty($bundle_project_id)) {
- // this means $source is SOURCE_PATCH || SOURCE_BUNDLE w/ $version = 0
- // they don't come with a project id so just do nothing
- } else if ($bundle_project_id != $working_copy_project_id) {
- if ($working_copy_project_id) {
- $issue = pht(
- "This patch is for the '%s' project, but the working copy ".
- "belongs to the '%s' project.",
- $bundle_project_id,
- $working_copy_project_id);
- } else {
- $issue = pht(
- "This patch is for the '%s' project, but the working copy does ".
- "not have an '%s' file to identify which project it belongs to.",
- $bundle_project_id,
- '.arcconfig');
- }
- $ok = phutil_console_confirm(
- pht('%s Still try to apply the patch?', $issue),
- $default_no = false);
- if (!$ok) {
- throw new ArcanistUserAbortException();
- }
- }
-
// Check to see if the bundle's base revision matches the working copy
// base revision
if ($repository_api->supportsLocalCommits()) {
diff --git a/src/workflow/ArcanistWorkflow.php b/src/workflow/ArcanistWorkflow.php
--- a/src/workflow/ArcanistWorkflow.php
+++ b/src/workflow/ArcanistWorkflow.php
@@ -1173,7 +1173,6 @@
$bundle->setConduit($conduit);
// since the conduit method has changes, assume that these fields
// could be unset
- $bundle->setProjectID(idx($diff, 'projectName'));
$bundle->setBaseRevision(idx($diff, 'sourceControlBaseRevision'));
$bundle->setRevisionID(idx($diff, 'revisionID'));
$bundle->setAuthorName(idx($diff, 'authorName'));
@@ -1520,58 +1519,7 @@
}
final protected function getRepositoryEncoding() {
- $default = 'UTF-8';
- return nonempty(idx($this->getProjectInfo(), 'encoding'), $default);
- }
-
- final protected function getProjectInfo() {
- if ($this->projectInfo === null) {
- $project_id = $this->getWorkingCopy()->getProjectID();
- if (!$project_id) {
- $this->projectInfo = array();
- } else {
- try {
- $this->projectInfo = $this->getConduit()->callMethodSynchronous(
- 'arcanist.projectinfo',
- array(
- 'name' => $project_id,
- ));
- } catch (ConduitClientException $ex) {
- if ($ex->getErrorCode() != 'ERR-BAD-ARCANIST-PROJECT') {
- throw $ex;
- }
-
- // TODO: Implement a proper query method that doesn't throw on
- // project not found. We just swallow this because some pathways,
- // like Git with uncommitted changes in a repository with a new
- // project ID, may attempt to access project information before
- // the project is created. See T2153.
- return array();
- }
- }
- }
-
- return $this->projectInfo;
- }
-
- final protected function loadProjectRepository() {
- $project = $this->getProjectInfo();
- if (isset($project['repository'])) {
- return $project['repository'];
- }
- // NOTE: The rest of the code is here for backwards compatibility.
-
- $repository_phid = idx($project, 'repositoryPHID');
- if (!$repository_phid) {
- return array();
- }
-
- $repositories = $this->getConduit()->callMethodSynchronous(
- 'repository.query',
- array());
- $repositories = ipull($repositories, null, 'phid');
-
- return idx($repositories, $repository_phid, array());
+ return 'UTF-8';
}
final protected function newInteractiveEditor($text) {
@@ -1802,40 +1750,6 @@
'repository.callsign');
}
- $project_info = $this->getProjectInfo();
- $project_name = $this->getWorkingCopy()->getProjectID();
- if ($this->getProjectInfo()) {
- if (!empty($project_info['repository']['callsign'])) {
- $callsign = $project_info['repository']['callsign'];
- $query = array(
- 'callsigns' => array($callsign),
- );
- $reasons[] = pht(
- 'Configuration value "%s" is set to "%s"; this project '.
- 'is associated with the "%s" repository.',
- 'project.name',
- $project_name,
- $callsign);
- return array($query, $reasons);
- } else {
- $reasons[] = pht(
- 'Configuration value "%s" is set to "%s", but this '.
- 'project is not associated with a repository.',
- 'project.name',
- $project_name);
- }
- } else if (strlen($project_name)) {
- $reasons[] = pht(
- 'Configuration value "%s" is set to "%s", but that '.
- 'project does not exist.',
- 'project.name',
- $project_name);
- } else {
- $reasons[] = pht(
- 'Configuration value "%s" is empty.',
- 'project.name');
- }
-
$uuid = $this->getRepositoryAPI()->getRepositoryUUID();
if ($uuid !== null) {
$query = array(
diff --git a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php
--- a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php
+++ b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php
@@ -216,16 +216,6 @@
$this->projectConfig = $config;
}
- public function getProjectID() {
- $project_id = $this->getProjectConfig('project.name');
- if ($project_id) {
- return $project_id;
- }
-
- // This is an older name for the setting.
- return $this->getProjectConfig('project_id');
- }
-
public function getProjectRoot() {
return $this->projectRoot;
}

File Metadata

Mime Type
text/plain
Expires
Mar 16 2025, 11:01 AM (5 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7706903
Default Alt Text
D12945.id31179.diff (11 KB)

Event Timeline