Handle adding versions that are no longer supported

This commit is contained in:
Steve Rowe 2016-06-25 14:49:28 -04:00
parent aa4c87de85
commit 46c827e31a
1 changed files with 10 additions and 5 deletions

View File

@ -173,13 +173,13 @@ def check_solr_version_tests():
os.chdir(base_dir)
print('ok')
def read_config():
def read_config(current_version):
parser = argparse.ArgumentParser(description='Add a new version')
parser.add_argument('version', type=Version.parse)
c = parser.parse_args()
c.branch_type = find_branch_type()
c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
c.is_latest_version = c.version.on_or_after(current_version)
print ("branch_type is %s " % c.branch_type)
@ -210,12 +210,17 @@ def get_solr_init_changes():
''' % parse_properties_file('lucene/ivy-versions.properties'))
def main():
c = read_config()
current_version = Version.parse(find_current_version())
c = 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())
add_constant(c.version, not c.is_latest_version)
if current_version.is_back_compat_with(c.version):
add_constant(c.version, not c.is_latest_version)
else:
print('\nNot adding constant for version %s because it is no longer supported' % c.version)
if c.is_latest_version:
print('\nUpdating latest version')
@ -227,7 +232,7 @@ def main():
print('\nTODO: ')
print(' - Move backcompat oldIndexes to unsupportedIndexes in TestBackwardsCompatibility')
print(' - Update IndexFormatTooOldException throw cases')
else:
elif current_version.is_back_compat_with(c.version):
print('\nTesting changes')
check_lucene_version_tests()
check_solr_version_tests()