Skip to content

Commit

Permalink
The "aggregate" command now doesn't require sub-command, when "--igno…
Browse files Browse the repository at this point in the history
…re-*" options are used
  • Loading branch information
Alexander Obuhovich committed May 14, 2016
1 parent ef01b1c commit 036a529
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Wrap list of associated revision next to conflicted paths to "4 per row" to avoid too wide table creation.
- Name format of per-working copy config setting is changed, which will result in all data being lost unless migrated by hand in "~/.svn-buddy/config.json" file (old "path-settings.wc_url_hash.setting_name", new: "path-settings[wc_url].setting_name").
- Major under the hood revision information storage changes.
- The `aggregate` command no longer requires specifying `sub-command` argument, when `--ignore-*` options are used.

### Fixed
- The Subversion repositories hosted on https://unfuddle.com/ were not usable from `log` and `merge` commands.
Expand Down
14 changes: 9 additions & 5 deletions src/SVNBuddy/Command/AggregateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ protected function configure()
)
->addArgument(
'sub-command',
InputArgument::REQUIRED,
InputArgument::OPTIONAL,
'Command to execute on each found working copy'
)
->addArgument(
Expand Down Expand Up @@ -122,18 +122,22 @@ protected function getSubCommands()
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
if ( $this->processIgnoreAdd() || $this->processIgnoreRemove() || $this->processIgnoreShow() ) {
return;
}

$sub_command = $this->io->getArgument('sub-command');

if ( $sub_command === null ) {
throw new \RuntimeException('Not enough arguments (missing: "sub-command").');
}

if ( !in_array($sub_command, $this->getSubCommands()) ) {
throw new \RuntimeException(
'The "' . $sub_command . '" sub-command is unknown or doesn\'t support aggregation.'
);
}

if ( $this->processIgnoreAdd() || $this->processIgnoreRemove() || $this->processIgnoreShow() ) {
return;
}

$this->runSubCommand($sub_command);
}

Expand Down

0 comments on commit 036a529

Please sign in to comment.