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:16 UTC

[25/28] lucene-solr:branch_5x: 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/0a172ce9
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0a172ce9
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0a172ce9

Branch: refs/heads/branch_5x
Commit: 0a172ce90a416199a93a0c6f762007c35857fd2f
Parents: c48826f
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:51:26 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/0a172ce9/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index 81e3f12..db3ebec 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()