From dc2fab88f8af1b8826ca2aac005beca2aa99f479 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 19 Sep 2024 12:22:08 +0200 Subject: [PATCH 1/3] Add to-next-major-dev command to update-release-version --- bin/update-release-version.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bin/update-release-version.php b/bin/update-release-version.php index 9731cdd13..d9187f614 100755 --- a/bin/update-release-version.php +++ b/bin/update-release-version.php @@ -17,6 +17,7 @@ function usage() to-stable: Mark the current version as stable to-next-patch-dev: Update to the next patch development version to-next-minor-dev: Update to the next minor development version + to-next-major-dev: Update to the next major development version get-version: Print the current version number EOT; @@ -167,6 +168,23 @@ function get_next_minor_version(array $versions): array ]; } +function get_next_major_version(array $versions): array +{ + $versionComponents = $versions['versionComponents']; + + // Increase major version, set other components to 0 + $versionComponents[0] += 1; + $versionComponents[1] = 0; + $versionComponents[2] = 0; + $versionComponents[3] = 0; + + return [ + 'version' => get_version_string_from_components($versionComponents) . 'dev', + 'stability' => 'devel', + 'versionComponents' => $versionComponents, + ]; +} + function get_next_release_version(array $versions, string $releaseVersion): array { $releaseVersion = parse_release_version($releaseVersion); @@ -244,6 +262,10 @@ function get_next_dev_version(array $versions): array $newVersion = get_next_minor_version($currentVersion); break; + case 'to-next-major-dev': + $newVersion = get_next_major_version($currentVersion); + break; + default: usage(); } From 147b7e5e090f415afda80705f51ceeedc132a97e Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 19 Sep 2024 12:22:14 +0200 Subject: [PATCH 2/3] 2.x is now 2.0.0-dev --- phongo_version.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phongo_version.h b/phongo_version.h index 38727ac5f..a0cd3a0cc 100644 --- a/phongo_version.h +++ b/phongo_version.h @@ -22,9 +22,9 @@ * publishing a release. */ /* clang-format off */ -#define PHP_MONGODB_VERSION "1.21.0dev" +#define PHP_MONGODB_VERSION "2.0.0dev" #define PHP_MONGODB_STABILITY "devel" -#define PHP_MONGODB_VERSION_DESC 1,21,0,0 +#define PHP_MONGODB_VERSION_DESC 2,0,0,0 /* clang-format on */ #endif /* PHONGO_VERSION_H */ From 5b0d78f241abed9d2ffad38844de75820a26dbe9 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 19 Sep 2024 12:47:20 +0200 Subject: [PATCH 3/3] Use %d for major version in tests --- tests/manager/manager-debug-001.phpt | 2 +- tests/manager/manager-debug-002.phpt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/manager/manager-debug-001.phpt b/tests/manager/manager-debug-001.phpt index cc4a81841..fa4789740 100644 --- a/tests/manager/manager-debug-001.phpt +++ b/tests/manager/manager-debug-001.phpt @@ -22,5 +22,5 @@ rmdir($name); --EXPECTF-- %A[%s] PHONGO: DEBUG > Connection string: '%s' -[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s +[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s %A===DONE===%A diff --git a/tests/manager/manager-debug-002.phpt b/tests/manager/manager-debug-002.phpt index 470c3a540..89e882da2 100644 --- a/tests/manager/manager-debug-002.phpt +++ b/tests/manager/manager-debug-002.phpt @@ -12,5 +12,5 @@ $manager = new MongoDB\Driver\Manager; --EXPECTF-- %A[%s] PHONGO: DEBUG > Connection string: '%s' -[%s] PHONGO: DEBUG > Creating Manager, phongo-1.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s +[%s] PHONGO: DEBUG > Creating Manager, phongo-%d.%d.%d%S[%s] - mongoc-1.%s(%s), libbson-1.%s(%s), php-%s %A===DONE===%A