Skip to content

Commit

Permalink
Allow to override "--auto-deploy" flag of the "commit" command, that …
Browse files Browse the repository at this point in the history
…is invoked after "merge" command
  • Loading branch information
aik099 committed Aug 28, 2024
1 parent 687a927 commit dfea481
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,7 @@ The merges performed outside of SVN-Buddy are detected automatically (thanks to
* `-s`, `--with-summary` - Shows number of added/changed/removed paths in the revision
* `--update-revision=UPDATE-REVISION` - Update working copy to given revision before performing a merge
* `--auto-commit=AUTO-COMMIT` - Automatically perform commit on successful merge, e.g. `yes` or `no`
* `--auto-deploy=AUTO-DEPLOY` - Automatically perform remote deployment on successful merge commit, e.g. `yes` or `no`
* `--record-only` - Mark revisions as merged without actually merging them
* `--reverse` - Rollback previously merged revisions
* `-a`, `--aggregate` - Aggregate displayed revisions by bugs
Expand Down
19 changes: 17 additions & 2 deletions src/SVNBuddy/Command/MergeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@ protected function configure()
InputOption::VALUE_REQUIRED,
'Automatically perform commit on successful merge, e.g. <comment>yes</comment> or <comment>no</comment>'
)
->addOption(
'auto-deploy',
null,
InputOption::VALUE_REQUIRED,
'Automatically perform remote deployment on successful merge commit, e.g. <comment>yes</comment> or <comment>no</comment>'
)
->addOption(
'record-only',
null,
Expand Down Expand Up @@ -225,7 +231,7 @@ public function completeOptionValues($optionName, CompletionContext $context)
return $this->getAllRefs();
}

if ( $optionName === 'auto-commit' ) {
if ( $optionName === 'auto-commit' || $optionName === 'auto-deploy' ) {
return array('yes', 'no');
}

Expand Down Expand Up @@ -853,8 +859,17 @@ protected function performCommit()
}

if ( $auto_commit ) {
$auto_deploy = $this->io->getOption('auto-deploy');

if ( $auto_deploy !== null ) {
$commit_arguments = array('--auto-deploy' => $auto_deploy);
}
else {
$commit_arguments = array();
}

$this->io->writeln(array('', 'Commencing automatic commit after merge ...'));
$this->runOtherCommand('commit');
$this->runOtherCommand('commit', $commit_arguments);
}

return $auto_commit;
Expand Down

0 comments on commit dfea481

Please sign in to comment.