コード例 #1
0
 /**
  * Runs the command and returns it's output.
  *
  * @param array $input   Command input.
  * @param array $options Command tester options.
  *
  * @return string
  */
 protected function runCommand(array $input = array(), array $options = array())
 {
     $input['command'] = $this->command->getName();
     $options['interactive'] = true;
     $this->commandTester->execute($input, $options);
     return $this->commandTester->getDisplay();
 }
コード例 #2
0
 /**
  * Validates command setting usage.
  *
  * @param string          $name     Name.
  * @param AbstractCommand $command  Command to get settings from.
  * @param string          $raw_path Raw path.
  *
  * @return AbstractConfigSetting
  * @throws \LogicException When command don't have any config settings to provide.
  */
 protected function getSetting($name, AbstractCommand $command, $raw_path)
 {
     if (!$command instanceof IConfigAwareCommand) {
         throw new \LogicException('The "' . $command->getName() . '" command does not have any settings.');
     }
     $config_setting = $this->findSetting($name, $command->getConfigSettings(), $command->getName());
     if ($config_setting->isWithinScope(AbstractConfigSetting::SCOPE_WORKING_COPY)) {
         $config_setting->setWorkingCopyUrl($this->workingCopyResolver->getWorkingCopyUrl($raw_path));
     }
     $config_setting->setEditor($this->configEditor);
     return $config_setting;
 }
コード例 #3
0
ファイル: CommitCommand.php プロジェクト: aik099/svn-buddy
 /**
  * Prepare dependencies.
  *
  * @return void
  */
 protected function prepareDependencies()
 {
     parent::prepareDependencies();
     $container = $this->getContainer();
     $this->_revisionListParser = $container['revision_list_parser'];
     $this->_editor = $container['editor'];
 }
コード例 #4
0
ファイル: ResolveCommand.php プロジェクト: aik099/svn-buddy
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $description = <<<TEXT
TODO
TEXT;
        $this->setName('resolve')->setDescription('Interactively resolves working copy conflicts')->setHelp($description)->addArgument('path', InputArgument::OPTIONAL, 'Working copy path', '.');
        parent::configure();
    }
コード例 #5
0
ファイル: MergeCommand.php プロジェクト: aik099/svn-buddy
 /**
  * Return possible values for the named option
  *
  * @param string            $optionName Option name.
  * @param CompletionContext $context    Completion context.
  *
  * @return array
  */
 public function completeOptionValues($optionName, CompletionContext $context)
 {
     $ret = parent::completeOptionValues($optionName, $context);
     if ($optionName === 'revisions') {
         return array('all');
     }
     return $ret;
 }
コード例 #6
0
 /**
  * Return possible values for the named option
  *
  * @param string            $optionName Option name.
  * @param CompletionContext $context    Completion context.
  *
  * @return array
  */
 public function completeOptionValues($optionName, CompletionContext $context)
 {
     $ret = parent::completeOptionValues($optionName, $context);
     if ($optionName === 'extension') {
         return $this->_migrationManager->getMigrationFileExtensions();
     }
     return $ret;
 }
コード例 #7
0
ファイル: RevertCommand.php プロジェクト: aik099/svn-buddy
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $description = <<<TEXT
TODO
TEXT;
        $this->setName('revert')->setDescription('Restore pristine working copy file (undo most local edits)')->setHelp($description)->addArgument('path', InputArgument::OPTIONAL, 'Working copy path', '.');
        parent::configure();
    }
コード例 #8
0
ファイル: UpdateCommand.php プロジェクト: aik099/svn-buddy
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $description = <<<TEXT
TODO
TEXT;
        $this->setName('update')->setDescription('Bring changes from the repository into the working copy.')->setHelp($description)->setAliases(array('up'))->addArgument('path', InputArgument::OPTIONAL, 'Working copy path', '.');
        parent::configure();
    }
コード例 #9
0
 /**
  * Return possible values for the named option
  *
  * @param string            $optionName Option name.
  * @param CompletionContext $context    Completion context.
  *
  * @return array
  */
 public function completeOptionValues($optionName, CompletionContext $context)
 {
     $ret = parent::completeOptionValues($optionName, $context);
     if ($optionName === 'stability') {
         return $this->_getStabilities();
     }
     return $ret;
 }
コード例 #10
0
 /**
  * Return possible values for the named argument
  *
  * @param string            $argumentName Argument name.
  * @param CompletionContext $context      Completion context.
  *
  * @return array
  */
 public function completeArgumentValues($argumentName, CompletionContext $context)
 {
     $ret = parent::completeArgumentValues($argumentName, $context);
     if ($argumentName === 'sub-command') {
         return $this->getSubCommands();
     }
     return $ret;
 }
コード例 #11
0
ファイル: CleanupCommand.php プロジェクト: aik099/svn-buddy
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $description = <<<TEXT
TODO
TEXT;
        $this->setName('cleanup')->setDescription('Recursively clean up the working copy, removing locks, resuming unfinished operations, etc.')->setHelp($description)->addArgument('path', InputArgument::OPTIONAL, 'Working copy path', '.');
        parent::configure();
    }
コード例 #12
0
 /**
  * Return possible values for the named option
  *
  * @param string            $optionName Option name.
  * @param CompletionContext $context    Completion context.
  *
  * @return array
  */
 public function completeOptionValues($optionName, CompletionContext $context)
 {
     $ret = parent::completeOptionValues($optionName, $context);
     if ($optionName === 'mode') {
         return $this->getModes();
     }
     return $ret;
 }
コード例 #13
0
 /**
  * Return possible values for the named option
  *
  * @param string            $optionName Option name.
  * @param CompletionContext $context    Completion context.
  *
  * @return array
  */
 public function completeOptionValues($optionName, CompletionContext $context)
 {
     $ret = parent::completeOptionValues($optionName, $context);
     if (in_array($optionName, array('show', 'edit', 'delete'))) {
         return array_keys($this->configSettings);
     }
     return $ret;
 }
コード例 #14
0
 /**
  * Prepare dependencies.
  *
  * @return void
  */
 protected function prepareDependencies()
 {
     parent::prepareDependencies();
     $container = $this->getContainer();
     $this->_editor = $container['editor'];
     $this->_commitMessageBuilder = $container['commit_message_builder'];
     $this->_mergeTemplateFactory = $container['merge_template_factory'];
     $this->_workingCopyConflictTracker = $container['working_copy_conflict_tracker'];
 }
コード例 #15
0
ファイル: LogCommand.php プロジェクト: aik099/svn-buddy
    /**
     * {@inheritdoc}
     */
    protected function configure()
    {
        $this->pathAcceptsUrl = true;
        $description = <<<TEXT
TODO
TEXT;
        $this->setName('log')->setDescription('Show the log messages for revisions/bugs/path')->setHelp($description)->addArgument('path', InputArgument::OPTIONAL, 'Working copy path or URL', '.')->addOption('revisions', 'r', InputOption::VALUE_REQUIRED, 'Revision or revision range (e.g. "53324,34342,1224-4433,232")')->addOption('bugs', 'b', InputOption::VALUE_REQUIRED, 'Bugs to merge (e.g. "JRA-1234,43644")')->addOption('details', 'd', InputOption::VALUE_NONE, 'Shows path affected in each revision')->addOption('merge-oracle', null, InputOption::VALUE_NONE, 'Detects commits with possible merge conflicts')->addOption('limit', null, InputOption::VALUE_REQUIRED, 'Maximum number of log entries');
        parent::configure();
    }
コード例 #16
0
 /**
  * Returns all refs.
  *
  * @return array
  */
 protected function getAllRefs()
 {
     $ret = parent::getAllRefs();
     $ret[] = self::ALL_REFS;
     return $ret;
 }
コード例 #17
0
 /**
  * Prepare dependencies.
  *
  * @return void
  */
 protected function prepareDependencies()
 {
     parent::prepareDependencies();
     $container = $this->getContainer();
     $this->_configEditor = $container['config_editor'];
 }
コード例 #18
0
 /**
  * Return possible values for the named option
  *
  * @param string            $optionName Option name.
  * @param CompletionContext $context    Completion context.
  *
  * @return array
  */
 public function completeOptionValues($optionName, CompletionContext $context)
 {
     $ret = parent::completeOptionValues($optionName, $context);
     if ($optionName === 'revisions') {
         return array('all');
     }
     if ($optionName === 'source-url') {
         return $this->getAllRefs();
     }
     if ($optionName === 'auto-commit') {
         return array('yes', 'no');
     }
     return $ret;
 }
コード例 #19
0
 /**
  * {@inheritdoc}
  */
 protected function configure()
 {
     $this->setName('update')->setDescription('Bring changes from the repository into the working copy')->setAliases(array('up'))->addArgument('path', InputArgument::OPTIONAL, 'Working copy path', '.')->addOption('revision', 'r', InputOption::VALUE_REQUIRED, 'Update working copy to specified revision, e.g. <comment>NUMBER</comment>, <comment>{DATE}</comment>, <comment>HEAD</comment>, <comment>BASE</comment>, <comment>COMMITTED</comment>, <comment>PREV</comment>')->addOption('ignore-externals', null, InputOption::VALUE_NONE, 'Ignore externals definitions');
     parent::configure();
 }