summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Wienhold <ewie@ewie.name>2023-09-05 19:45:54 +0200
committerDavid E. Wheeler <david@justatheory.com>2023-09-09 13:34:38 -0400
commit5724e0a5f35d5d9b7a545fdd4c12ec9f1c6a31fc (patch)
treeec33bb5ff5dbcd039830fbb2c897c94fde642c32
parent257c8eb75bd7f809f76541b90a9a185cb3668332 (diff)
Fix range of changes printed in deploy debug output
The debug output of deploy (added with commit 06daffc4) starts with the currently deployed change or the last planned change if nothing is deployed yet. Fix this by starting with the first change after the current plan position.
-rw-r--r--Changes3
-rw-r--r--lib/App/Sqitch/Engine.pm2
-rwxr-xr-xt/engine.t12
3 files changed, 15 insertions, 2 deletions
diff --git a/Changes b/Changes
index fbc954bc..bfc80831 100644
--- a/Changes
+++ b/Changes
@@ -14,6 +14,9 @@ Revision history for Perl extension App::Sqitch
- Fixed the output of the list of changes to be deployed or reverted to
actually require `--verbose` twice, as described in the v1.4.0 changes,
and not just once. Thanks to Erik Wienhold for the PR (#785)!
+ - Removed the duplicate change name from the output of the list of
+ changes to be deployed or reverted with `-VV`. Thanks to Erik Wienhold
+ for the PR (#787)!
1.4.0 2023-08-01T23:37:30Z
- Fixed Snowflake warehouse and role setup to properly quote identifiers
diff --git a/lib/App/Sqitch/Engine.pm b/lib/App/Sqitch/Engine.pm
index af6c901a..0c04a316 100644
--- a/lib/App/Sqitch/Engine.pm
+++ b/lib/App/Sqitch/Engine.pm
@@ -270,7 +270,7 @@ sub deploy {
);
$sqitch->debug(__ "Will deploy the following changes:");
- foreach my $will_deploy_position ($plan->position .. $to_index) {
+ foreach my $will_deploy_position (($plan->position + 1) .. $to_index) {
$sqitch->debug($plan->change_at($will_deploy_position)->format_name_with_tags);
}
diff --git a/t/engine.t b/t/engine.t
index 95ebfc82..a495dc9b 100755
--- a/t/engine.t
+++ b/t/engine.t
@@ -4,7 +4,7 @@ use strict;
use warnings;
use 5.010;
use utf8;
-use Test::More tests => 780;
+use Test::More tests => 781;
# use Test::More 'no_plan';
use App::Sqitch;
use App::Sqitch::Plan;
@@ -1169,6 +1169,7 @@ is_deeply +MockOutput->get_info, [
], 'Should have emitted deploy announcement and successes';
# Make sure we can deploy everything by change.
+MockOutput->clear;
$latest_change_id = undef;
$plan->reset;
$plan->add( name => 'lolz', note => 'ha ha' );
@@ -1208,6 +1209,15 @@ is_deeply +MockOutput->get_info_literal, [
[' + lolz ..', '.........', ' '],
], 'Should have seen the output of the deploy to the end';
+is_deeply +MockOutput->get_debug, [
+ [__ 'Will deploy the following changes:' ],
+ ['roles'],
+ ['users @alpha'],
+ ['widgets @beta'],
+ ['lolz'],
+], 'Debug output should show what will be deployed';
+
+
# If we deploy again, it should be up-to-date.
$latest_change_id = $changes[-1]->id;
ok $engine->deploy, 'Should return success for deploy to up-to-date DB';