You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by sa...@apache.org on 2016/06/25 18:53:10 UTC

[19/28] lucene-solr:branch_6x: Handle adding versions that are no longer supported

Handle adding versions that are no longer supported


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/9ee183f5
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/9ee183f5
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/9ee183f5

Branch: refs/heads/branch_6x
Commit: 9ee183f5ca5b2a2e0a4861960f882f2cd36f4198
Parents: 29ddc08
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:49:28 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:50:29 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ee183f5/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 92a49b3..262e099 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -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()