From b50acb512922920d7a7e6f695ee865678e9f5416 Mon Sep 17 00:00:00 2001 From: epriestley Date: Fri, 18 Feb 2011 22:17:41 -0800 Subject: [PATCH] Provide a "--conduit-uri" override for testing, and tweak some documentation. Summary: Test Plan: Reviewers: CC: --- scripts/arcanist.php | 11 ++++++++++- src/workflow/help/ArcanistHelpWorkflow.php | 8 ++++++++ .../mark-committed/ArcanistMarkCommittedWorkflow.php | 2 +- .../shell-complete/ArcanistShellCompleteWorkflow.php | 7 +++---- .../ArcanistSvnHookPreCommitWorkflow.php | 4 +++- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index 83eebff2..b4de5327 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -31,6 +31,7 @@ phutil_require_module('arcanist', 'workingcopyidentity'); phutil_require_module('arcanist', 'repository/api/base'); $config_trace_mode = false; +$force_conduit = null; $args = array_slice($argv, 1); $load = array(); $matches = null; @@ -46,6 +47,9 @@ foreach ($args as $key => $arg) { } else if (preg_match('/^--load-phutil-library=(.*)$/', $arg, $matches)) { unset($args[$key]); $load['?'] = $matches[1]; + } else if (preg_match('/^--conduit-uri=(.*)$/', $arg, $matches)) { + unset($args[$key]); + $force_conduit = $matches[1]; } } @@ -135,7 +139,12 @@ try { $set_guid = false; if ($need_conduit) { - $conduit_uri = $working_copy->getConduitURI(); + + if ($force_conduit) { + $conduit_uri = $force_conduit; + } else { + $conduit_uri = $working_copy->getConduitURI(); + } if (!$conduit_uri) { throw new ArcanistUsageException( "No Conduit URI is specified in the .arcconfig file for this project. ". diff --git a/src/workflow/help/ArcanistHelpWorkflow.php b/src/workflow/help/ArcanistHelpWorkflow.php index 4427610d..7ebb9ac3 100644 --- a/src/workflow/help/ArcanistHelpWorkflow.php +++ b/src/workflow/help/ArcanistHelpWorkflow.php @@ -157,6 +157,14 @@ EOTEXT __--no-ansi__ Output in plain ASCII text only, without color or style. + __--load-phutil-library=/path/to/library__ + Ignore libraries listed in .arcconfig and explicitly load specified + libraries instead. Mostly useful for Arcanist development. + + __--conduit-uri=...__ + Ignore configured Conduit URI and use an explicit one instead. Mostly + useful for Arcanist development. + EOTEXT ); diff --git a/src/workflow/mark-committed/ArcanistMarkCommittedWorkflow.php b/src/workflow/mark-committed/ArcanistMarkCommittedWorkflow.php index 97197541..6aa64a53 100644 --- a/src/workflow/mark-committed/ArcanistMarkCommittedWorkflow.php +++ b/src/workflow/mark-committed/ArcanistMarkCommittedWorkflow.php @@ -26,7 +26,7 @@ class ArcanistMarkCommittedWorkflow extends ArcanistBaseWorkflow { to do this; arc commit (svn), arc amend (git) or commit hooks in the master remote repository should do it for you. However, if these mechanisms have failed for some reason you can use this command to - manually change a revision status from "accepted" to "committed". + manually change a revision status from "Accepted" to "Committed". EOTEXT ); } diff --git a/src/workflow/shell-complete/ArcanistShellCompleteWorkflow.php b/src/workflow/shell-complete/ArcanistShellCompleteWorkflow.php index 9ce06663..b2973752 100644 --- a/src/workflow/shell-complete/ArcanistShellCompleteWorkflow.php +++ b/src/workflow/shell-complete/ArcanistShellCompleteWorkflow.php @@ -24,7 +24,6 @@ class ArcanistShellCompleteWorkflow extends ArcanistBaseWorkflow { Supports: bash, etc. Implements shell completion. To use shell completion, source the appropriate script from 'resources/shell/' in your .shellrc. - EOTEXT ); } @@ -123,7 +122,7 @@ EOTEXT } return 0; } else { - + $output = array(); foreach ($arguments as $argument => $spec) { if ($argument == '*') { @@ -136,7 +135,7 @@ EOTEXT } $output[] = '--'.$argument; } - + $cur = idx($argv, $pos, ''); $any_match = false; foreach ($output as $possible) { @@ -144,7 +143,7 @@ EOTEXT $any_match = true; } } - + if (!$any_match && isset($arguments['*'])) { // TODO: the '*' specifier should probably have more details about // whether or not it is a list of files. Since it almost always is in diff --git a/src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php b/src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php index 23f85133..398920f6 100644 --- a/src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php +++ b/src/workflow/svn-hook-pre-commit/ArcanistSvnHookPreCommitWorkflow.php @@ -22,7 +22,9 @@ class ArcanistSvnHookPreCommitWorkflow extends ArcanistBaseWorkflow { return phutil_console_format(<<