From 1d59d8d341a82ae9c7c4fef1b4a20fa7c756e347 Mon Sep 17 00:00:00 2001 From: Christopher Fujino Date: Fri, 4 Feb 2022 13:35:29 -0800 Subject: [PATCH] [flutter_tools] increment y instead of m when calling flutter --version on master (#97827) --- packages/flutter_tools/lib/src/version.dart | 4 +++- packages/flutter_tools/test/general.shard/version_test.dart | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 03546c06a9..86d7c05d22 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -736,7 +736,9 @@ class GitTagVersion { return '$x.$y.$z+hotfix.${hotfix! + 1}.pre.$commits'; } if (devPatch != null && devVersion != null) { - return '$x.$y.$z-${devVersion! + 1}.0.pre.$commits'; + // The next published release this commit will appear in will be a beta + // release, thus increment [y]. + return '$x.${y! + 1}.0-0.0.pre.$commits'; } return '$x.$y.${z! + 1}-0.0.pre.$commits'; } diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index e2cb8a8872..f373328e87 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -372,7 +372,7 @@ void main() { // Master channel gitTagVersion = GitTagVersion.parse('1.2.3-4.5.pre-13-g$hash'); - expect(gitTagVersion.frameworkVersionFor(hash), '1.2.3-5.0.pre.13'); + expect(gitTagVersion.frameworkVersionFor(hash), '1.3.0-0.0.pre.13'); expect(gitTagVersion.gitTag, '1.2.3-4.5.pre'); expect(gitTagVersion.devVersion, 4); expect(gitTagVersion.devPatch, 5); @@ -491,8 +491,8 @@ void main() { logger: BufferLogger.test(), ); final GitTagVersion gitTagVersion = GitTagVersion.determine(processUtils, workingDirectory: '.'); - // reported version should increment the number after the dash - expect(gitTagVersion.frameworkVersionFor(headRevision), '1.2.3-3.0.pre.12'); + // reported version should increment the y + expect(gitTagVersion.frameworkVersionFor(headRevision), '1.3.0-0.0.pre.12'); }); testUsingContext('determine does not call fetch --tags', () {