Apache Lucene open-source search software
LUCENE-7446: don't ask about version back-compatibility when we know it's not applicable (i.e., the version to be added is greater than the latest on the branch)
Steve Rowecd8592c850ae
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.pyindex e95a51f4181..5ce6bde7bba 100644--- a/dev-tools/scripts/addVersion.py+++ b/dev-tools/scripts/addVersion.py@@ -176,14 +176,14 @@ def check_solr_version_tests():def read_config(current_version):parser = argparse.ArgumentParser(description='Add a new version')parser.add_argument('version', type=Version.parse)- c = parser.parse_args()+ newconf = parser.parse_args()- c.branch_type = find_branch_type()- c.is_latest_version = c.version.on_or_after(current_version)+ newconf.branch_type = find_branch_type()+ newconf.is_latest_version = newconf.version.on_or_after(current_version)- print ("branch_type is %s " % c.branch_type)+ print ("branch_type is %s " % newconf.branch_type)- return c+ return newconf# Hack ConfigParser, designed to parse INI files, to parse & interpolate Java .properties filesdef parse_properties_file(filename):@@ -211,30 +211,29 @@ def get_solr_init_changes():def main():current_version = Version.parse(find_current_version())- c = read_config(current_version)+ newconf = read_config(current_version)- print('\nAdding new version %s' % c.version)- update_changes('lucene/CHANGES.txt', c.version)- update_changes('solr/CHANGES.txt', c.version, get_solr_init_changes())+ print('\nAdding new version %s' % newconf.version)+ update_changes('lucene/CHANGES.txt', newconf.version)+ update_changes('solr/CHANGES.txt', newconf.version, get_solr_init_changes())- is_back_compat = current_version.major == c.version.major or current_version.is_back_compat_with(c.version)-- if is_back_compat:- add_constant(c.version, not c.is_latest_version)+ latest_or_backcompat = newconf.is_latest_version or current_version.is_back_compat_with(newconf.version)+ if latest_or_backcompat:+ add_constant(newconf.version, not newconf.is_latest_version)else:- print('\nNot adding constant for version %s because it is no longer supported' % c.version)+ print('\nNot adding constant for version %s because it is no longer supported' % newconf.version)- if c.is_latest_version:+ if newconf.is_latest_version:print('\nUpdating latest version')- update_build_version(c.version)- update_latest_constant(c.version)- update_example_solrconfigs(c.version)+ update_build_version(newconf.version)+ update_latest_constant(newconf.version)+ update_example_solrconfigs(newconf.version)- if c.version.is_major_release():+ if newconf.version.is_major_release():print('\nTODO: ')print(' - Move backcompat oldIndexes to unsupportedIndexes in TestBackwardsCompatibility')print(' - Update IndexFormatTooOldException throw cases')- elif is_back_compat:+ elif latest_or_backcompat:print('\nTesting changes')check_lucene_version_tests()check_solr_version_tests()