From 735070ffaa7cc3a5c1db8927617c290ea7fd3148 Mon Sep 17 00:00:00 2001 From: Alex Date: Thu, 11 Apr 2024 19:33:36 +0300 Subject: [PATCH] Perform auto-commit (when enabled) after merge, that because everything is already merged --- CHANGELOG.md | 1 + src/SVNBuddy/Command/MergeCommand.php | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fa0117e..4396ac6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - The `--bugs` and `--revisions` options of the `merge` and `log` commands now can be combined for better versatility. - Improved `merge` command phrasing for the "upcoming merge status" term. - Lazy load other commands to improve each individual command performance. +- Perform auto-commit (when enabled) after merge, that failed because everything is already merged. ### Fixed - The `--aggregate` option of the `merge` and `commit` commands wasn't working (triggered an exception) when revision without a bug wasn't present in the list of revisions. diff --git a/src/SVNBuddy/Command/MergeCommand.php b/src/SVNBuddy/Command/MergeCommand.php index edb74e4..3c6744b 100644 --- a/src/SVNBuddy/Command/MergeCommand.php +++ b/src/SVNBuddy/Command/MergeCommand.php @@ -284,7 +284,7 @@ protected function execute(InputInterface $input, OutputInterface $output) if ( $revisions ) { $revisions = array_intersect($revisions, $this->_usableRevisions); - if ( !$revisions ) { + if ( !$revisions && !$this->performCommit() ) { throw new CommandException(\sprintf( 'Requested revisions are %s', $this->isReverseMerge() ? 'not yet merged' : 'already merged' @@ -834,7 +834,7 @@ protected function limitRevisions(array $revisions, $max_revision) /** * Performs commit unless user doesn't want it. * - * @return void + * @return boolean */ protected function performCommit() { @@ -851,6 +851,8 @@ protected function performCommit() $this->io->writeln(array('', 'Commencing automatic commit after merge ...')); $this->runOtherCommand('commit'); } + + return $auto_commit; } /**