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/09/13 15:40:00 UTC

[4/5] lucene-solr:branch_5x: 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)

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)


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

Branch: refs/heads/branch_5x
Commit: b2a0ccdfe1f429f73570f6adbbe22dfae1795df7
Parents: f3447f4
Author: Steve Rowe <sa...@gmail.com>
Authored: Tue Sep 13 11:26:16 2016 -0400
Committer: Steve Rowe <sa...@gmail.com>
Committed: Tue Sep 13 11:34:46 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 37 ++++++++++++++++++------------------
 1 file changed, 19 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b2a0ccdf/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index db3ebec..6636a3d 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 files
 def parse_properties_file(filename):
@@ -211,28 +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())
 
-  if current_version.is_back_compat_with(c.version):
-    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 current_version.is_back_compat_with(c.version):
+  elif latest_or_backcompat:
     print('\nTesting changes')
     check_lucene_version_tests()
     check_solr_version_tests()