diff --git a/src/lint/linter/ArcanistComposerLinter.php b/src/lint/linter/ArcanistComposerLinter.php index 02b7c673..a9eded3e 100644 --- a/src/lint/linter/ArcanistComposerLinter.php +++ b/src/lint/linter/ArcanistComposerLinter.php @@ -5,7 +5,7 @@ final class ArcanistComposerLinter extends ArcanistLinter { const LINT_OUT_OF_DATE = 1; public function getInfoName() { - return pht('Composer'); + return pht('Composer Dependency Manager'); } public function getInfoDescription() { diff --git a/src/lint/linter/ArcanistCppcheckLinter.php b/src/lint/linter/ArcanistCppcheckLinter.php index fe9b578f..7c063956 100644 --- a/src/lint/linter/ArcanistCppcheckLinter.php +++ b/src/lint/linter/ArcanistCppcheckLinter.php @@ -6,7 +6,7 @@ final class ArcanistCppcheckLinter extends ArcanistExternalLinter { public function getInfoName() { - return 'Cppcheck'; + return 'C++ linter'; } public function getInfoURI() { diff --git a/src/lint/linter/ArcanistCpplintLinter.php b/src/lint/linter/ArcanistCpplintLinter.php index 0680d474..07200af1 100644 --- a/src/lint/linter/ArcanistCpplintLinter.php +++ b/src/lint/linter/ArcanistCpplintLinter.php @@ -6,7 +6,7 @@ final class ArcanistCpplintLinter extends ArcanistExternalLinter { public function getLinterName() { - return 'CPPLINT'; + return 'C++ Google\'s Styleguide'; } public function getLinterConfigurationName() { diff --git a/src/lint/linter/ArcanistFlake8Linter.php b/src/lint/linter/ArcanistFlake8Linter.php index db8e9177..bd45082d 100644 --- a/src/lint/linter/ArcanistFlake8Linter.php +++ b/src/lint/linter/ArcanistFlake8Linter.php @@ -7,7 +7,7 @@ final class ArcanistFlake8Linter extends ArcanistExternalLinter { public function getInfoName() { - return 'Flake8'; + return 'Python Flake8 multi-linter'; } public function getInfoURI() { diff --git a/src/lint/linter/ArcanistHLintLinter.php b/src/lint/linter/ArcanistHLintLinter.php index 5a197ce4..f8c1df89 100644 --- a/src/lint/linter/ArcanistHLintLinter.php +++ b/src/lint/linter/ArcanistHLintLinter.php @@ -6,7 +6,7 @@ final class ArcanistHLintLinter extends ArcanistExternalLinter { public function getInfoName() { - return 'HLint'; + return 'Haskell Linter'; } public function getInfoURI() { diff --git a/src/lint/linter/ArcanistJSHintLinter.php b/src/lint/linter/ArcanistJSHintLinter.php index 1f9a766d..9d485bad 100644 --- a/src/lint/linter/ArcanistJSHintLinter.php +++ b/src/lint/linter/ArcanistJSHintLinter.php @@ -9,7 +9,7 @@ final class ArcanistJSHintLinter extends ArcanistExternalLinter { private $jshintrc; public function getInfoName() { - return 'JSHint'; + return 'JavaScript error checking'; } public function getInfoURI() { diff --git a/src/lint/linter/ArcanistJscsLinter.php b/src/lint/linter/ArcanistJscsLinter.php index d1c0b3c4..338e08d3 100644 --- a/src/lint/linter/ArcanistJscsLinter.php +++ b/src/lint/linter/ArcanistJscsLinter.php @@ -6,7 +6,7 @@ final class ArcanistJscsLinter extends ArcanistExternalLinter { private $preset; public function getInfoName() { - return 'JSCS'; + return 'JavaScript Code Style'; } public function getInfoURI() { diff --git a/src/lint/linter/ArcanistPyFlakesLinter.php b/src/lint/linter/ArcanistPyFlakesLinter.php index 3a79e02e..c312487c 100644 --- a/src/lint/linter/ArcanistPyFlakesLinter.php +++ b/src/lint/linter/ArcanistPyFlakesLinter.php @@ -10,7 +10,7 @@ final class ArcanistPyFlakesLinter extends ArcanistExternalLinter { } public function getInfoName() { - return pht('PyFlakes'); + return pht('Python PyFlakes'); } public function getInfoDescription() { diff --git a/src/lint/linter/ArcanistRuboCopLinter.php b/src/lint/linter/ArcanistRuboCopLinter.php index c7585ca6..812a0159 100644 --- a/src/lint/linter/ArcanistRuboCopLinter.php +++ b/src/lint/linter/ArcanistRuboCopLinter.php @@ -5,7 +5,7 @@ final class ArcanistRuboCopLinter extends ArcanistExternalLinter { private $config; public function getInfoName() { - return 'RuboCop'; + return 'Ruby static code analyzer'; } public function getInfoURI() { diff --git a/src/upload/ArcanistFileDataRef.php b/src/upload/ArcanistFileDataRef.php index 795fbd67..318418ec 100644 --- a/src/upload/ArcanistFileDataRef.php +++ b/src/upload/ArcanistFileDataRef.php @@ -27,6 +27,8 @@ final class ArcanistFileDataRef extends Phobject { private $errors = array(); private $phid; private $fileHandle; + private $deleteAfterEpoch; + private $viewPolicy; /* -( Configuring File References )---------------------------------------- */ @@ -107,6 +109,48 @@ final class ArcanistFileDataRef extends Phobject { } + /** + * @task config + */ + public function setViewPolicy($view_policy) { + $this->viewPolicy = $view_policy; + return $this; + } + + + /** + * @task config + */ + public function getViewPolicy() { + return $this->viewPolicy; + } + + + /** + * Configure a file to be temporary instead of permanent. + * + * By default, files are retained indefinitely until explicitly deleted. If + * you want to upload a temporary file instead, you can specify an epoch + * timestamp. The file will be deleted after this time. + * + * @param int Epoch timestamp to retain the file until. + * @return this + * @task config + */ + public function setDeleteAfterEpoch($epoch) { + $this->deleteAfterEpoch = $epoch; + return $this; + } + + + /** + * @task config + */ + public function getDeleteAfterEpoch() { + return $this->deleteAfterEpoch; + } + + /* -( Handling Upload Results )-------------------------------------------- */ diff --git a/src/upload/ArcanistFileUploader.php b/src/upload/ArcanistFileUploader.php index ba960775..27ec8d34 100644 --- a/src/upload/ArcanistFileUploader.php +++ b/src/upload/ArcanistFileUploader.php @@ -27,7 +27,6 @@ final class ArcanistFileUploader extends Phobject { private $conduit; private $files; - private $config = array(); /* -( Configuring the Uploader )------------------------------------------- */ @@ -79,33 +78,6 @@ final class ArcanistFileUploader extends Phobject { } - /** - * Configure a file to be temporary instead of permanent. - * - * By default, files are retained indefinitely until explicitly deleted. If - * you want to upload a temporary file instead, you can specify an epoch - * timestamp. The file will be deleted after this time. - * - * @param string Key identifying the file you want to make temporary, as - * passed to @{method:addFile}. - * @param int Epoch timestamp to retain the file until. - * @return this - * @task add - */ - public function setDeleteFileAfterEpoch($file_key, $epoch) { - if (empty($this->files[$file_key])) { - throw new Exception( - pht( - 'No file with given key ("%s") has been added to this uploader.', - $file_key)); - } - - $this->config[$file_key]['deleteAfterEpoch'] = $epoch; - - return $this; - } - - /* -( Uploading Files )---------------------------------------------------- */ @@ -144,19 +116,22 @@ final class ArcanistFileUploader extends Phobject { $conduit = $this->conduit; $futures = array(); foreach ($files as $key => $file) { - $config = idx($this->config, $key, array()); - $params = array( 'name' => $file->getName(), 'contentLength' => $file->getByteSize(), 'contentHash' => $file->getContentHash(), ); - $delete_after = idx($config, 'deleteAfterEpoch'); + $delete_after = $file->getDeleteAfterEpoch(); if ($delete_after !== null) { $params['deleteAfterEpoch'] = $delete_after; } + $view_policy = $file->getViewPolicy(); + if ($view_policy !== null) { + $params['viewPolicy'] = $view_policy; + } + $futures[$key] = $conduit->callMethod('file.allocate', $params); } diff --git a/src/workflow/ArcanistLintersWorkflow.php b/src/workflow/ArcanistLintersWorkflow.php index a521a586..3c7d5606 100644 --- a/src/workflow/ArcanistLintersWorkflow.php +++ b/src/workflow/ArcanistLintersWorkflow.php @@ -104,8 +104,8 @@ EOTEXT $console->writeOut( "** %s ** **%s** (%s)\n", $text, - nonempty($linter['short'], '-'), - $linter['name']); + nonempty($linter['name'], '-'), + $linter['short']); if ($linter['exception']) { $console->writeOut( @@ -241,11 +241,11 @@ EOTEXT } $linter_info[$key] = array( - 'short' => $linter->getLinterConfigurationName(), + 'name' => $linter->getLinterConfigurationName(), 'class' => get_class($linter), 'status' => $status, 'version' => $version, - 'name' => $linter->getInfoName(), + 'short' => $linter->getInfoName(), 'uri' => $linter->getInfoURI(), 'description' => $linter->getInfoDescription(), 'exception' => $exception, diff --git a/src/workflow/ArcanistUpgradeWorkflow.php b/src/workflow/ArcanistUpgradeWorkflow.php index ed30593f..c9e0e858 100644 --- a/src/workflow/ArcanistUpgradeWorkflow.php +++ b/src/workflow/ArcanistUpgradeWorkflow.php @@ -53,18 +53,18 @@ EOTEXT $this->setRepositoryAPI($repository); - // Require no local changes. $this->requireCleanWorkingCopy(); - // Require the library be on master. $branch_name = $repository->getBranchName(); - if ($branch_name != 'master') { + if ($branch_name != 'master' && $branch_name != 'stable') { throw new ArcanistUsageException( pht( - "%s must be on branch '%s' to be automatically upgraded. ". + "%s must be on either branch '%s' or '%s' to be automatically ". + "upgraded. ". "This copy of %s (in '%s') is on branch '%s'.", $lib, 'master', + 'stable', $lib, $root, $branch_name)); diff --git a/src/workflow/ArcanistUploadWorkflow.php b/src/workflow/ArcanistUploadWorkflow.php index b4414a39..a31ce0f0 100644 --- a/src/workflow/ArcanistUploadWorkflow.php +++ b/src/workflow/ArcanistUploadWorkflow.php @@ -69,13 +69,12 @@ EOTEXT ->setName(basename($path)) ->setPath($path); - $uploader->addFile($file, $key); - if ($is_temporary) { - $uploader->setDeleteFileAfterEpoch( - $key, - time() + phutil_units('24 hours in seconds')); + $expires_at = time() + phutil_units('24 hours in seconds'); + $file->setDeleteAfterEpoch($expires_at); } + + $uploader->addFile($file); } $files = $uploader->uploadFiles();