Skip to content

Commit

Permalink
(stable) Promote 2017 Week 7
Browse files Browse the repository at this point in the history
  • Loading branch information
epriestley committed Feb 18, 2017
2 parents 67a47ac + d0353d2 commit a232e95
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 28 deletions.
7 changes: 4 additions & 3 deletions src/hgdaemon/ArcanistHgServerChannel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ final class ArcanistHgServerChannel extends PhutilProtocolChannel {
private $mode = self::MODE_CHANNEL;
private $byteLengthOfNextChunk = 1;
private $buf = '';
private $outputChannel;


/* -( Protocol Implementation )-------------------------------------------- */
Expand Down Expand Up @@ -137,7 +138,7 @@ protected function decodeStream($data) {
// '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;
Expand All @@ -153,11 +154,11 @@ protected function decodeStream($data) {
// 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;
Expand Down
2 changes: 1 addition & 1 deletion src/land/ArcanistGitLandEngine.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function execute() {

public function __destruct() {
if ($this->restoreWhenDestroyed) {
$this->writeWARN(
$this->writeWarn(
pht('INTERRUPTED!'),
pht('Restoring working copy to its original state.'));

Expand Down
2 changes: 1 addition & 1 deletion src/lint/linter/ArcanistBaseXHPASTLinter.php
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ final protected function getXHPASTTreeForPath($path) {
* 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) {
Expand Down
7 changes: 5 additions & 2 deletions src/lint/linter/__tests__/ArcanistClosureLinterTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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/');
}

}
3 changes: 3 additions & 0 deletions src/repository/api/ArcanistGitAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,9 @@ private function getDiffBaseOptions() {
// 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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/unit/parser/__tests__/XUnitTestResultParserTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function testEmptyInputFailure() {
$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
}
Expand All @@ -43,7 +43,7 @@ public function testInvalidXmlInputFailure() {
$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
}
Expand Down
4 changes: 1 addition & 3 deletions src/workflow/ArcanistLandWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,7 @@ private function readArguments() {
$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;
Expand Down
2 changes: 1 addition & 1 deletion src/workflow/ArcanistLintWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public function run() {
}

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);
Expand Down
31 changes: 23 additions & 8 deletions src/workflow/ArcanistSetConfigWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,19 @@ public function run() {

$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];
Expand All @@ -85,17 +98,18 @@ public function run() {
$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);

Expand All @@ -110,19 +124,20 @@ public function run() {
$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;
Expand Down
2 changes: 1 addition & 1 deletion src/workflow/ArcanistStartWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public function run() {
"%s: %s\n\n",
pht('Started'),
implode(', ', ipull($phid_query, 'fullName')));
$this->printCurrentTracking(true);
$this->printCurrentTracking();
}

}
2 changes: 1 addition & 1 deletion src/workflow/ArcanistStopWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public function run() {
"%s %s\n\n",
pht('Stopped:'),
implode(', ', ipull($phid_query, 'fullName')));
$this->printCurrentTracking(true);
$this->printCurrentTracking();
}

}
2 changes: 1 addition & 1 deletion src/workflow/ArcanistTasksWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function run() {
$unassigned = $this->getArgument('unassigned');

if ($owner) {
$owner_phid = $this->findOwnerPhid($owner);
$owner_phid = $this->findOwnerPHID($owner);
} else if ($unassigned) {
$owner_phid = null;
} else {
Expand Down
2 changes: 1 addition & 1 deletion src/workflow/ArcanistUnitWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function run() {
}

if ($everything) {
$paths = iterator_to_array($this->getRepositoryApi()->getAllFiles());
$paths = iterator_to_array($this->getRepositoryAPI()->getAllFiles());
} else {
$paths = $this->selectPathsForWorkflow($paths, $rev);
}
Expand Down
4 changes: 1 addition & 3 deletions src/workflow/ArcanistWorkflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -1008,9 +1008,7 @@ final public function requireCleanWorkingCopy() {
}
$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`).',
Expand Down

0 comments on commit a232e95

Please sign in to comment.