mirror of https://github.com/apache/lucene.git
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)
This commit is contained in:
parent
f670a2c837
commit
cd8592c850
|
@ -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 files
|
||||
def 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()
|
||||
|
|
Loading…
Reference in New Issue