mirror of
https://github.com/flutter/packages.git
synced 2025-06-08 12:47:00 +08:00
[tool] Allow importing packages with NEXT (#3215)
Fixes an issue that showed up in the trial repo merge PR; if a pacakge is new to the repository (i.e., has no git history in the parent commit), it was being treated as a version bump, which caused failures if NEXT was present. This adds a new state so that we can allow NEXT during import.
This commit is contained in:
@ -47,6 +47,9 @@ enum _CurrentVersionState {
|
||||
/// The version has changed, and the transition is invalid.
|
||||
invalidChange,
|
||||
|
||||
/// The package is new.
|
||||
newPackage,
|
||||
|
||||
/// There was an error determining the version state.
|
||||
unknown,
|
||||
}
|
||||
@ -216,6 +219,7 @@ class VersionCheckCommand extends PackageLoopingCommand {
|
||||
break;
|
||||
case _CurrentVersionState.validIncrease:
|
||||
case _CurrentVersionState.validRevert:
|
||||
case _CurrentVersionState.newPackage:
|
||||
versionChanged = true;
|
||||
break;
|
||||
case _CurrentVersionState.invalidChange:
|
||||
@ -318,7 +322,7 @@ ${indentation}HTTP response: ${pubVersionFinderResponse.httpResponse.body}
|
||||
'${getBoolArg(_againstPubFlag) ? 'on pub server' : 'at git base'}.');
|
||||
logWarning(
|
||||
'${indentation}If this package is not new, something has gone wrong.');
|
||||
return _CurrentVersionState.validIncrease; // Assume new, thus valid.
|
||||
return _CurrentVersionState.newPackage;
|
||||
}
|
||||
|
||||
if (previousVersion == currentVersion) {
|
||||
|
Reference in New Issue
Block a user