mirror of
https://we.phorge.it/source/arcanist.git
synced 2025-02-05 19:38:26 +01:00
(stable) Promote 2017 Week 7
This commit is contained in:
commit
a232e95a18
14 changed files with 46 additions and 28 deletions
|
@ -54,6 +54,7 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel {
|
|||
private $mode = self::MODE_CHANNEL;
|
||||
private $byteLengthOfNextChunk = 1;
|
||||
private $buf = '';
|
||||
private $outputChannel;
|
||||
|
||||
|
||||
/* -( Protocol Implementation )-------------------------------------------- */
|
||||
|
@ -137,7 +138,7 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel {
|
|||
// 'output', 'error', 'result' or 'debug' respectively. This is a
|
||||
// single byte long. Next, we'll expect a length.
|
||||
|
||||
$this->channel = $chunk;
|
||||
$this->outputChannel = $chunk;
|
||||
$this->byteLengthOfNextChunk = 4;
|
||||
$this->mode = self::MODE_LENGTH;
|
||||
break;
|
||||
|
@ -153,11 +154,11 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel {
|
|||
// given length. We produce a message from the channel and the data
|
||||
// and return it. Next, we expect another channel name.
|
||||
|
||||
$message = array($this->channel, $chunk);
|
||||
$message = array($this->outputChannel, $chunk);
|
||||
|
||||
$this->byteLengthOfNextChunk = 1;
|
||||
$this->mode = self::MODE_CHANNEL;
|
||||
$this->channel = null;
|
||||
$this->outputChannel = null;
|
||||
|
||||
$messages[] = $message;
|
||||
break;
|
||||
|
|
|
@ -59,7 +59,7 @@ final class ArcanistGitLandEngine
|
|||
|
||||
public function __destruct() {
|
||||
if ($this->restoreWhenDestroyed) {
|
||||
$this->writeWARN(
|
||||
$this->writeWarn(
|
||||
pht('INTERRUPTED!'),
|
||||
pht('Restoring working copy to its original state.'));
|
||||
|
||||
|
|
|
@ -189,7 +189,7 @@ abstract class ArcanistBaseXHPASTLinter extends ArcanistFutureLinter {
|
|||
* Get a path's parse exception from the responsible linter.
|
||||
*
|
||||
* @param string Path to retrieve exception for.
|
||||
* @return Exeption|null Parse exception, if available.
|
||||
* @return Exception|null Parse exception, if available.
|
||||
* @task sharing
|
||||
*/
|
||||
final protected function getXHPASTExceptionForPath($path) {
|
||||
|
|
|
@ -3,11 +3,14 @@
|
|||
final class ArcanistClosureLinterTestCase
|
||||
extends ArcanistExternalLinterTestCase {
|
||||
|
||||
public function testLinter() {
|
||||
protected function getLinter() {
|
||||
$linter = new ArcanistClosureLinter();
|
||||
$linter->setFlags(array('--additional_extensions=lint-test'));
|
||||
return $linter;
|
||||
}
|
||||
|
||||
$this->executeTestsInDirectory(dirname(__FILE__).'/gjslint/', $linter);
|
||||
public function testLinter() {
|
||||
$this->executeTestsInDirectory(dirname(__FILE__).'/gjslint/');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -446,6 +446,9 @@ final class ArcanistGitAPI extends ArcanistRepositoryAPI {
|
|||
// would ship up the binaries for 'arc patch' but display the textconv
|
||||
// output in the visual diff.
|
||||
'--no-textconv',
|
||||
// Provide a standard view of submodule changes; the 'log' and 'diff'
|
||||
// values do not parse by the diff parser.
|
||||
'--submodule=short',
|
||||
);
|
||||
return implode(' ', $options);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ final class XUnitTestResultParserTestCase extends PhutilTestCase {
|
|||
$parsed_results = id(new ArcanistXUnitTestResultParser())
|
||||
->parseTestResults('');
|
||||
|
||||
$this->failTest(pht('Should throw on empty input'));
|
||||
$this->assertFailure(pht('Should throw on empty input'));
|
||||
} catch (Exception $e) {
|
||||
// OK
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ final class XUnitTestResultParserTestCase extends PhutilTestCase {
|
|||
$parsed_results = id(new ArcanistXUnitTestResultParser())
|
||||
->parseTestResults($stubbed_results);
|
||||
|
||||
$this->failTest(pht('Should throw on non-xml input'));
|
||||
$this->assertFailure(pht('Should throw on non-xml input'));
|
||||
} catch (Exception $e) {
|
||||
// OK
|
||||
}
|
||||
|
|
|
@ -514,9 +514,7 @@ EOTEXT
|
|||
$this->branch = head($branch);
|
||||
$this->keepBranch = $this->getArgument('keep-branch');
|
||||
|
||||
$update_strategy = $this->getConfigFromAnySource(
|
||||
'arc.land.update.default',
|
||||
'merge');
|
||||
$update_strategy = $this->getConfigFromAnySource('arc.land.update.default');
|
||||
$this->shouldUpdateWithRebase = $update_strategy == 'rebase';
|
||||
if ($this->getArgument('update-with-rebase')) {
|
||||
$this->shouldUpdateWithRebase = true;
|
||||
|
|
|
@ -227,7 +227,7 @@ EOTEXT
|
|||
}
|
||||
|
||||
if ($everything) {
|
||||
$paths = iterator_to_array($this->getRepositoryApi()->getAllFiles());
|
||||
$paths = iterator_to_array($this->getRepositoryAPI()->getAllFiles());
|
||||
$this->shouldLintAll = true;
|
||||
} else {
|
||||
$paths = $this->selectPathsForWorkflow($paths, $rev);
|
||||
|
|
|
@ -69,6 +69,19 @@ EOTEXT
|
|||
|
||||
$settings = new ArcanistSettings();
|
||||
|
||||
$console = PhutilConsole::getConsole();
|
||||
|
||||
if (!$settings->getHelp($key)) {
|
||||
$warning = tsprintf(
|
||||
"**%s:** %s\n",
|
||||
pht('Warning'),
|
||||
pht(
|
||||
'The configuration key "%s" is not recognized by arc. It may '.
|
||||
'be misspelled or out of date.',
|
||||
$key));
|
||||
$console->writeErr('%s', $warning);
|
||||
}
|
||||
|
||||
$old = null;
|
||||
if (array_key_exists($key, $config)) {
|
||||
$old = $config[$key];
|
||||
|
@ -85,17 +98,18 @@ EOTEXT
|
|||
$old = $settings->formatConfigValueForDisplay($key, $old);
|
||||
|
||||
if ($old === null) {
|
||||
echo pht(
|
||||
"Deleted key '%s' from %s config.\n",
|
||||
$message = pht(
|
||||
'Deleted key "%s" from %s config.',
|
||||
$key,
|
||||
$which);
|
||||
} else {
|
||||
echo pht(
|
||||
"Deleted key '%s' from %s config (was %s).\n",
|
||||
$message = pht(
|
||||
'Deleted key "%s" from %s config (was %s).',
|
||||
$key,
|
||||
$which,
|
||||
$old);
|
||||
}
|
||||
$console->writeOut('%s', tsprintf("%s\n", $message));
|
||||
} else {
|
||||
$val = $settings->willWriteValue($key, $val);
|
||||
|
||||
|
@ -110,19 +124,20 @@ EOTEXT
|
|||
$old = $settings->formatConfigValueForDisplay($key, $old);
|
||||
|
||||
if ($old === null) {
|
||||
echo pht(
|
||||
"Set key '%s' = %s in %s config.\n",
|
||||
$message = pht(
|
||||
'Set key "%s" = %s in %s config.',
|
||||
$key,
|
||||
$val,
|
||||
$which);
|
||||
} else {
|
||||
echo pht(
|
||||
"Set key '%s' = %s in %s config (was %s).\n",
|
||||
$message = pht(
|
||||
'Set key "%s" = %s in %s config (was %s).',
|
||||
$key,
|
||||
$val,
|
||||
$which,
|
||||
$old);
|
||||
}
|
||||
$console->writeOut('%s', tsprintf("%s\n", $message));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -76,7 +76,7 @@ EOTEXT
|
|||
"%s: %s\n\n",
|
||||
pht('Started'),
|
||||
implode(', ', ipull($phid_query, 'fullName')));
|
||||
$this->printCurrentTracking(true);
|
||||
$this->printCurrentTracking();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ EOTEXT
|
|||
"%s %s\n\n",
|
||||
pht('Stopped:'),
|
||||
implode(', ', ipull($phid_query, 'fullName')));
|
||||
$this->printCurrentTracking(true);
|
||||
$this->printCurrentTracking();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ EOTEXT
|
|||
$unassigned = $this->getArgument('unassigned');
|
||||
|
||||
if ($owner) {
|
||||
$owner_phid = $this->findOwnerPhid($owner);
|
||||
$owner_phid = $this->findOwnerPHID($owner);
|
||||
} else if ($unassigned) {
|
||||
$owner_phid = null;
|
||||
} else {
|
||||
|
|
|
@ -140,7 +140,7 @@ EOTEXT
|
|||
}
|
||||
|
||||
if ($everything) {
|
||||
$paths = iterator_to_array($this->getRepositoryApi()->getAllFiles());
|
||||
$paths = iterator_to_array($this->getRepositoryAPI()->getAllFiles());
|
||||
} else {
|
||||
$paths = $this->selectPathsForWorkflow($paths, $rev);
|
||||
}
|
||||
|
|
|
@ -1008,9 +1008,7 @@ abstract class ArcanistWorkflow extends Phobject {
|
|||
}
|
||||
$should_commit = true;
|
||||
} else {
|
||||
$permit_autostash = $this->getConfigFromAnySource(
|
||||
'arc.autostash',
|
||||
false);
|
||||
$permit_autostash = $this->getConfigFromAnySource('arc.autostash');
|
||||
if ($permit_autostash && $api->canStashChanges()) {
|
||||
echo pht(
|
||||
'Stashing uncommitted changes. (You can restore them with `%s`).',
|
||||
|
|
Loading…
Add table
Reference in a new issue