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

[01/28] lucene-solr:branch_5_5: Add 5.5.2 back compat test indexes

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5_5 ec0ab0d61 -> 33ef9eb08
  refs/heads/branch_5x 2489de287 -> 29f559990
  refs/heads/branch_6_0 e7f47f75a -> 5dce97fd5
  refs/heads/branch_6_1 99ed3f8ee -> 8504e02b6
  refs/heads/branch_6x 98d5c83db -> d1a047ad6
  refs/heads/master d730f4a1c -> 46c827e31


Add 5.5.2 back compat test indexes


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

Branch: refs/heads/branch_5_5
Commit: e24aa4fd0da5b127a84879e6c4ec1c09194c2c9c
Parents: ec0ab0d
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 11:08:51 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 11:08:51 2016 -0400

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   4 +++-
 .../org/apache/lucene/index/index.5.5.2-cfs.zip    | Bin 0 -> 13740 bytes
 .../org/apache/lucene/index/index.5.5.2-nocfs.zip  | Bin 0 -> 13748 bytes
 3 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e24aa4fd/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 9599a96..30c1903 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -288,7 +288,9 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.5.0-cfs",
       "5.5.0-nocfs",
       "5.5.1-cfs",
-      "5.5.1-nocfs"
+      "5.5.1-nocfs",
+      "5.5.2-cfs",
+      "5.5.2-nocfs"
   };
   
   final String[] unsupportedNames = {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e24aa4fd/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
new file mode 100644
index 0000000..dfef8dd
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/e24aa4fd/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
new file mode 100644
index 0000000..82c4600
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip differ


[16/28] lucene-solr:master: Handle adding back compat indexes for versions that are no longer supported

Posted by sa...@apache.org.
Handle adding back compat indexes for 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/0018003b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/0018003b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/0018003b

Branch: refs/heads/master
Commit: 0018003b7cc99fe6aa6d671e1da2c64134c23998
Parents: 60fac6c
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:26:42 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:26:42 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addBackcompatIndexes.py | 31 ++++++++++++++------------
 dev-tools/scripts/scriptutil.py           |  5 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0018003b/dev-tools/scripts/addBackcompatIndexes.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 9e0963d..8a8b5b2 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -30,15 +30,16 @@ import urllib.request
 import re
 import shutil
 
-def create_and_add_index(source, indextype, version, temp_dir):
+def create_and_add_index(source, indextype, index_version, current_version, temp_dir):
   if indextype in ('cfs', 'nocfs'):
     dirname = 'index.%s' % indextype
   else:
     dirname = indextype
+  prefix = 'index' if current_version.is_back_compat_with(index_version) else 'unsupported'
   filename = {
-    'cfs': 'index.%s-cfs.zip',
-    'nocfs': 'index.%s-nocfs.zip'
-  }[indextype] % version
+    'cfs': '%s.%s-cfs.zip',
+    'nocfs': '%s.%s-nocfs.zip'
+  }[indextype] % (prefix, index_version)
   print('  creating %s...' % filename, end='', flush=True)
   module = 'backward-codecs'
   index_dir = os.path.join('lucene', module, 'src/test/org/apache/lucene/index')
@@ -84,11 +85,12 @@ def create_and_add_index(source, indextype, version, temp_dir):
   scriptutil.run('rm -rf %s' % bc_index_dir)
   print('done')
 
-def update_backcompat_tests(types, version):
+def update_backcompat_tests(types, index_version, current_version):
   print('  adding new indexes to backcompat tests...', end='', flush=True)
   module = 'lucene/backward-codecs'
   filename = '%s/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java' % module
-  matcher = re.compile(r'final static String\[\] oldNames = {|};')
+  matcher = re.compile(r'final static String\[\] oldNames = {|};' if current_version.is_back_compat_with(index_version)
+                       else r'final String\[\] unsupportedNames = {|};')
 
   def find_version(x):
     x = x.strip()
@@ -99,17 +101,17 @@ def update_backcompat_tests(types, version):
     start = None
     def __call__(self, buffer, match, line):
       if self.start:
-        # find where we this version should exist
+        # find where this version should exist
         i = len(buffer) - 1 
         v = find_version(buffer[i])
-        while i >= self.start and v.on_or_after(version):
+        while i >= self.start and v.on_or_after(index_version):
           i -= 1
           v = find_version(buffer[i])
         i += 1 # readjust since we skipped past by 1
 
         # unfortunately python doesn't have a range remove from list...
         # here we want to remove any previous references to the version we are adding
-        while i < len(buffer) and version.on_or_after(find_version(buffer[i])):
+        while i < len(buffer) and index_version.on_or_after(find_version(buffer[i])):
           buffer.pop(i)
 
         if i == len(buffer) and not buffer[-1].strip().endswith(","):
@@ -119,7 +121,7 @@ def update_backcompat_tests(types, version):
         last = buffer[-1]
         spaces = ' ' * (len(last) - len(last.lstrip()))
         for (j, t) in enumerate(types):
-          newline = spaces + ('"%s-%s"' % (version, t))
+          newline = spaces + ('"%s-%s"' % (index_version, t))
           if j < len(types) - 1 or i < len(buffer):
             newline += ','
           buffer.insert(i, newline + '\n')
@@ -128,7 +130,7 @@ def update_backcompat_tests(types, version):
         buffer.append(line)
         return True
 
-      if 'oldNames' in line:
+      if 'Names = {' in line:
         self.start = len(buffer) # location of first index name
       buffer.append(line)
       return False
@@ -213,11 +215,12 @@ def main():
 
   print('\nCreating backwards compatibility indexes')
   source = download_release(c.version, c.temp_dir, c.force)
-  create_and_add_index(source, 'cfs', c.version, c.temp_dir)
-  create_and_add_index(source, 'nocfs', c.version, c.temp_dir)
+  current_version = scriptutil.Version.parse(scriptutil.find_current_version())
+  create_and_add_index(source, 'cfs', c.version, current_version, c.temp_dir)
+  create_and_add_index(source, 'nocfs', c.version, current_version, c.temp_dir)
     
   print('\nAdding backwards compatibility tests')
-  update_backcompat_tests(['cfs', 'nocfs'], c.version)
+  update_backcompat_tests(['cfs', 'nocfs'], c.version, current_version)
 
   print('\nTesting changes')
   check_backcompat_tests()

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/0018003b/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index bf7cec5..9b26413 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -66,6 +66,11 @@ class Version(object):
            (self.bugfix > other.bugfix or self.bugfix == other.bugfix and
            self.prerelease >= other.prerelease)))
 
+  def is_back_compat_with(self, other):
+    if not self.on_or_after(other):
+      raise Exception('Back compat check disallowed for newer version: %s < %s' % (self, other))
+    return other.major + 1 >= self.major
+
 def run(cmd):
   try:
     output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)


[11/28] lucene-solr:branch_6_0: Add 5.5.2 back compat test indexes

Posted by sa...@apache.org.
Add 5.5.2 back compat test indexes


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

Branch: refs/heads/branch_6_0
Commit: 62dff546ed40455f0bb2c6751153e67f895492db
Parents: 9ae39f1
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:17:08 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:17:08 2016 -0400

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   2 ++
 .../org/apache/lucene/index/index.5.5.2-cfs.zip    | Bin 0 -> 13717 bytes
 .../org/apache/lucene/index/index.5.5.2-nocfs.zip  | Bin 0 -> 13717 bytes
 3 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/62dff546/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 64acce0..7f656a6 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -238,6 +238,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.5.0-nocfs",
       "5.5.1-cfs",
       "5.5.1-nocfs",
+      "5.5.2-cfs",
+      "5.5.2-nocfs",
       "6.0.0-cfs",
       "6.0.0-nocfs",
       "6.0.1-cfs",

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/62dff546/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
new file mode 100644
index 0000000..d5ee38a
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/62dff546/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
new file mode 100644
index 0000000..e5d591c
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip differ


[05/28] lucene-solr:branch_6x: Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

Posted by sa...@apache.org.
Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version


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

Branch: refs/heads/branch_6x
Commit: a78db407204da9c73b0cc119e70a43c29eebeba1
Parents: 98d5c83
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:11:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:11:52 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 8 +++-----
 dev-tools/scripts/scriptutil.py | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a78db407/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc41116..92a49b3 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -179,9 +179,7 @@ def read_config():
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
-  c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
-                      c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.unstable
+  c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
 
   print ("branch_type is %s " % c.branch_type)
 
@@ -217,9 +215,9 @@ def main():
   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.matching_branch)
+  add_constant(c.version, not c.is_latest_version)
 
-  if c.matching_branch:
+  if c.is_latest_version:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/a78db407/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 84c39cd..bf7cec5 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -119,7 +119,7 @@ def find_branch_type():
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():
-  return version_prop_re.search(open('lucene/version.properties').read()).group(1)
+  return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
 
 if __name__ == '__main__':
   print('This is only a support module, it cannot be run')


[17/28] lucene-solr:master: Add 5.5.2 back compat test indexes

Posted by sa...@apache.org.
Add 5.5.2 back compat test indexes


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

Branch: refs/heads/master
Commit: aa4c87de859934a784a43c2ba7db70ff58032f90
Parents: 0018003
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:27:58 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:27:58 2016 -0400

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   2 ++
 .../apache/lucene/index/unsupported.5.5.2-cfs.zip  | Bin 0 -> 13712 bytes
 .../lucene/index/unsupported.5.5.2-nocfs.zip       | Bin 0 -> 13720 bytes
 3 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aa4c87de/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 7d32c8f..11096e4 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -349,6 +349,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.5.0-nocfs",
       "5.5.1-cfs",
       "5.5.1-nocfs",
+      "5.5.2-cfs",
+      "5.5.2-nocfs"
   };
 
   // TODO: on 6.0.0 release, gen the single segment indices and add here:

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aa4c87de/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-cfs.zip
new file mode 100644
index 0000000..ae8233b
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/aa4c87de/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-nocfs.zip
new file mode 100644
index 0000000..83e21c0
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/unsupported.5.5.2-nocfs.zip differ


[09/28] lucene-solr:branch_5_5: Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

Posted by sa...@apache.org.
Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version


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

Branch: refs/heads/branch_5_5
Commit: add302a739091b3d72e6a029a6cbf0a960dd766c
Parents: e24aa4f
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:11:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:12:25 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 8 +++-----
 dev-tools/scripts/scriptutil.py | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/add302a7/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc41116..92a49b3 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -179,9 +179,7 @@ def read_config():
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
-  c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
-                      c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.unstable
+  c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
 
   print ("branch_type is %s " % c.branch_type)
 
@@ -217,9 +215,9 @@ def main():
   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.matching_branch)
+  add_constant(c.version, not c.is_latest_version)
 
-  if c.matching_branch:
+  if c.is_latest_version:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/add302a7/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 84c39cd..bf7cec5 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -119,7 +119,7 @@ def find_branch_type():
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():
-  return version_prop_re.search(open('lucene/version.properties').read()).group(1)
+  return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
 
 if __name__ == '__main__':
   print('This is only a support module, it cannot be run')


[14/28] lucene-solr:branch_6x: Add version 5.5.2

Posted by sa...@apache.org.
Add version 5.5.2


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

Branch: refs/heads/branch_6x
Commit: cb47769f37524ef0cfb00d1d9f14b55d262a6e2a
Parents: a78db40
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:24:15 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:24:15 2016 -0400

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/util/Version.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/cb47769f/lucene/core/src/java/org/apache/lucene/util/Version.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/Version.java b/lucene/core/src/java/org/apache/lucene/util/Version.java
index 50cc01a..c1bdaa2 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Version.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Version.java
@@ -109,6 +109,13 @@ public final class Version {
   @Deprecated
   public static final Version LUCENE_5_5_1 = new Version(5, 5, 1);
 
+  /**
+   * Match settings and bugs in Lucene's 5.5.2 release.
+   * @deprecated Use latest
+   */
+  @Deprecated
+  public static final Version LUCENE_5_5_2 = new Version(5, 5, 2);
+
   /** Match settings and bugs in Lucene's 6.0 release.
    * @deprecated (6.1.0) Use latest
    */


[13/28] lucene-solr:branch_6_1: Add 5.5.2 back compat test indexes

Posted by sa...@apache.org.
Add 5.5.2 back compat test indexes


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

Branch: refs/heads/branch_6_1
Commit: 8f22d75c2d1f38132d0abaeec6628d28b270e577
Parents: 82b4c5e
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:21:14 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:21:14 2016 -0400

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   2 ++
 .../org/apache/lucene/index/index.5.5.2-cfs.zip    | Bin 0 -> 13719 bytes
 .../org/apache/lucene/index/index.5.5.2-nocfs.zip  | Bin 0 -> 13727 bytes
 3 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8f22d75c/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index d553752..6955392 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -238,6 +238,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.5.0-nocfs",
       "5.5.1-cfs",
       "5.5.1-nocfs",
+      "5.5.2-cfs",
+      "5.5.2-nocfs",
       "6.0.0-cfs",
       "6.0.0-nocfs",
       "6.0.1-cfs",

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8f22d75c/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
new file mode 100644
index 0000000..af544ca
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8f22d75c/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
new file mode 100644
index 0000000..d460ff9
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip differ


[15/28] lucene-solr:branch_6x: Add 5.5.2 back compat test indexes

Posted by sa...@apache.org.
Add 5.5.2 back compat test indexes


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

Branch: refs/heads/branch_6x
Commit: 29ddc081c6fb78556cda95589cb226775019ef62
Parents: cb47769
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:26:05 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:26:05 2016 -0400

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   2 ++
 .../org/apache/lucene/index/index.5.5.2-cfs.zip    | Bin 0 -> 13722 bytes
 .../org/apache/lucene/index/index.5.5.2-nocfs.zip  | Bin 0 -> 13724 bytes
 3 files changed, 2 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/29ddc081/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index d5dcd9a..d357d74 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -238,6 +238,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.5.0-nocfs",
       "5.5.1-cfs",
       "5.5.1-nocfs",
+      "5.5.2-cfs",
+      "5.5.2-nocfs",
       "6.0.0-cfs",
       "6.0.0-nocfs",
       "6.0.1-cfs",

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/29ddc081/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
new file mode 100644
index 0000000..10a591a
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/29ddc081/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
new file mode 100644
index 0000000..c90fa5e
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip differ


[06/28] lucene-solr:branch_6_1: Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

Posted by sa...@apache.org.
Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version


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

Branch: refs/heads/branch_6_1
Commit: 34ca18ab2853bb656208a1fedc396eb06ec45d72
Parents: 99ed3f8
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:11:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:12:02 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 8 +++-----
 dev-tools/scripts/scriptutil.py | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/34ca18ab/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc41116..92a49b3 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -179,9 +179,7 @@ def read_config():
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
-  c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
-                      c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.unstable
+  c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
 
   print ("branch_type is %s " % c.branch_type)
 
@@ -217,9 +215,9 @@ def main():
   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.matching_branch)
+  add_constant(c.version, not c.is_latest_version)
 
-  if c.matching_branch:
+  if c.is_latest_version:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/34ca18ab/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 84c39cd..bf7cec5 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -119,7 +119,7 @@ def find_branch_type():
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():
-  return version_prop_re.search(open('lucene/version.properties').read()).group(1)
+  return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
 
 if __name__ == '__main__':
   print('This is only a support module, it cannot be run')


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

Posted by sa...@apache.org.
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()


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

Posted by sa...@apache.org.
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/3eaf36f8
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3eaf36f8
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3eaf36f8

Branch: refs/heads/branch_6_0
Commit: 3eaf36f8a5a20dbf8ace080424ace43b7d2eaa5f
Parents: 62dff54
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:10 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/3eaf36f8/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()


[12/28] lucene-solr:branch_6_1: Add version 5.5.2

Posted by sa...@apache.org.
Add version 5.5.2


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

Branch: refs/heads/branch_6_1
Commit: 82b4c5e191911e8a4a4fb31b64158568414d8874
Parents: 34ca18a
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:19:14 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:19:14 2016 -0400

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/util/Version.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/82b4c5e1/lucene/core/src/java/org/apache/lucene/util/Version.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/Version.java b/lucene/core/src/java/org/apache/lucene/util/Version.java
index efc5daf..c36e39d 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Version.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Version.java
@@ -109,6 +109,13 @@ public final class Version {
   @Deprecated
   public static final Version LUCENE_5_5_1 = new Version(5, 5, 1);
 
+  /**
+   * Match settings and bugs in Lucene's 5.5.2 release.
+   * @deprecated Use latest
+   */
+  @Deprecated
+  public static final Version LUCENE_5_5_2 = new Version(5, 5, 2);
+
   /** Match settings and bugs in Lucene's 6.0 release.
    * @deprecated (6.1.0) Use latest
    */


[03/28] lucene-solr:branch_5x: Add 5.5.2 back compat test indexes

Posted by sa...@apache.org.
Add 5.5.2 back compat test indexes


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

Branch: refs/heads/branch_5x
Commit: 1de1af936c24488972adb4370f65bcd8558fc2f6
Parents: 84ca5d2
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 11:19:40 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 11:19:40 2016 -0400

----------------------------------------------------------------------
 .../lucene/index/TestBackwardsCompatibility.java   |   4 +++-
 .../org/apache/lucene/index/index.5.5.2-cfs.zip    | Bin 0 -> 13742 bytes
 .../org/apache/lucene/index/index.5.5.2-nocfs.zip  | Bin 0 -> 13757 bytes
 3 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1de1af93/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index 9599a96..30c1903 100644
--- a/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/backward-codecs/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -288,7 +288,9 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
       "5.5.0-cfs",
       "5.5.0-nocfs",
       "5.5.1-cfs",
-      "5.5.1-nocfs"
+      "5.5.1-nocfs",
+      "5.5.2-cfs",
+      "5.5.2-nocfs"
   };
   
   final String[] unsupportedNames = {

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1de1af93/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip
new file mode 100644
index 0000000..b83430e
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-cfs.zip differ

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/1de1af93/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
----------------------------------------------------------------------
diff --git a/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip
new file mode 100644
index 0000000..2038a2b
Binary files /dev/null and b/lucene/backward-codecs/src/test/org/apache/lucene/index/index.5.5.2-nocfs.zip differ


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

Posted by sa...@apache.org.
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/7dc24eb4
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/7dc24eb4
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/7dc24eb4

Branch: refs/heads/branch_6_1
Commit: 7dc24eb48a648948b02596d8432ba288836bd239
Parents: 8f22d75
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:50 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/7dc24eb4/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()


[10/28] lucene-solr:branch_6_0: Add version 5.5.2

Posted by sa...@apache.org.
Add version 5.5.2


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

Branch: refs/heads/branch_6_0
Commit: 9ae39f15a6dc00b635114d09290d2d0845c83bc2
Parents: b53bfc1
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:15:34 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:15:34 2016 -0400

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/util/Version.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/9ae39f15/lucene/core/src/java/org/apache/lucene/util/Version.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/Version.java b/lucene/core/src/java/org/apache/lucene/util/Version.java
index 004d519..a39edaf 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Version.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Version.java
@@ -109,6 +109,13 @@ public final class Version {
   @Deprecated
   public static final Version LUCENE_5_5_1 = new Version(5, 5, 1);
 
+  /**
+   * Match settings and bugs in Lucene's 5.5.2 release.
+   * @deprecated Use latest
+   */
+  @Deprecated
+  public static final Version LUCENE_5_5_2 = new Version(5, 5, 2);
+
   /** Match settings and bugs in Lucene's 6.0 release.
    * @deprecated (6.0.1) Use latest
    */


[07/28] lucene-solr:branch_6_0: Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

Posted by sa...@apache.org.
Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version


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

Branch: refs/heads/branch_6_0
Commit: b53bfc1c1dfad145b604cf1bdcb24594b5f842f8
Parents: e7f47f7
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:11:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:12:08 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 8 +++-----
 dev-tools/scripts/scriptutil.py | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b53bfc1c/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc41116..92a49b3 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -179,9 +179,7 @@ def read_config():
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
-  c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
-                      c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.unstable
+  c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
 
   print ("branch_type is %s " % c.branch_type)
 
@@ -217,9 +215,9 @@ def main():
   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.matching_branch)
+  add_constant(c.version, not c.is_latest_version)
 
-  if c.matching_branch:
+  if c.is_latest_version:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/b53bfc1c/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 84c39cd..bf7cec5 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -119,7 +119,7 @@ def find_branch_type():
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():
-  return version_prop_re.search(open('lucene/version.properties').read()).group(1)
+  return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
 
 if __name__ == '__main__':
   print('This is only a support module, it cannot be run')


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

Posted by sa...@apache.org.
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()


[08/28] lucene-solr:branch_5x: Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

Posted by sa...@apache.org.
Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version


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

Branch: refs/heads/branch_5x
Commit: c48826f8ac8b4d2d24e608882a5f08a0ed47f9ab
Parents: 1de1af9
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:11:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:12:18 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 8 +++-----
 dev-tools/scripts/scriptutil.py | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c48826f8/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc4dc5e..81e3f12 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -179,9 +179,7 @@ def read_config():
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
-  c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
-                      c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.unstable
+  c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
 
   print ("branch_type is %s " % c.branch_type)
 
@@ -217,9 +215,9 @@ def main():
   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.matching_branch)
+  add_constant(c.version, not c.is_latest_version)
 
-  if c.matching_branch:
+  if c.is_latest_version:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/c48826f8/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 84c39cd..bf7cec5 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -119,7 +119,7 @@ def find_branch_type():
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():
-  return version_prop_re.search(open('lucene/version.properties').read()).group(1)
+  return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
 
 if __name__ == '__main__':
   print('This is only a support module, it cannot be run')


[20/28] lucene-solr:branch_6x: Handle adding back compat indexes for versions that are no longer supported

Posted by sa...@apache.org.
Handle adding back compat indexes for 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/d1a047ad
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d1a047ad
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d1a047ad

Branch: refs/heads/branch_6x
Commit: d1a047ad6f24078f23c9b4adf15210ac8a6e8f8a
Parents: 9ee183f
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:26:42 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:50:38 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addBackcompatIndexes.py | 31 ++++++++++++++------------
 dev-tools/scripts/scriptutil.py           |  5 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1a047ad/dev-tools/scripts/addBackcompatIndexes.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 9e0963d..8a8b5b2 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -30,15 +30,16 @@ import urllib.request
 import re
 import shutil
 
-def create_and_add_index(source, indextype, version, temp_dir):
+def create_and_add_index(source, indextype, index_version, current_version, temp_dir):
   if indextype in ('cfs', 'nocfs'):
     dirname = 'index.%s' % indextype
   else:
     dirname = indextype
+  prefix = 'index' if current_version.is_back_compat_with(index_version) else 'unsupported'
   filename = {
-    'cfs': 'index.%s-cfs.zip',
-    'nocfs': 'index.%s-nocfs.zip'
-  }[indextype] % version
+    'cfs': '%s.%s-cfs.zip',
+    'nocfs': '%s.%s-nocfs.zip'
+  }[indextype] % (prefix, index_version)
   print('  creating %s...' % filename, end='', flush=True)
   module = 'backward-codecs'
   index_dir = os.path.join('lucene', module, 'src/test/org/apache/lucene/index')
@@ -84,11 +85,12 @@ def create_and_add_index(source, indextype, version, temp_dir):
   scriptutil.run('rm -rf %s' % bc_index_dir)
   print('done')
 
-def update_backcompat_tests(types, version):
+def update_backcompat_tests(types, index_version, current_version):
   print('  adding new indexes to backcompat tests...', end='', flush=True)
   module = 'lucene/backward-codecs'
   filename = '%s/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java' % module
-  matcher = re.compile(r'final static String\[\] oldNames = {|};')
+  matcher = re.compile(r'final static String\[\] oldNames = {|};' if current_version.is_back_compat_with(index_version)
+                       else r'final String\[\] unsupportedNames = {|};')
 
   def find_version(x):
     x = x.strip()
@@ -99,17 +101,17 @@ def update_backcompat_tests(types, version):
     start = None
     def __call__(self, buffer, match, line):
       if self.start:
-        # find where we this version should exist
+        # find where this version should exist
         i = len(buffer) - 1 
         v = find_version(buffer[i])
-        while i >= self.start and v.on_or_after(version):
+        while i >= self.start and v.on_or_after(index_version):
           i -= 1
           v = find_version(buffer[i])
         i += 1 # readjust since we skipped past by 1
 
         # unfortunately python doesn't have a range remove from list...
         # here we want to remove any previous references to the version we are adding
-        while i < len(buffer) and version.on_or_after(find_version(buffer[i])):
+        while i < len(buffer) and index_version.on_or_after(find_version(buffer[i])):
           buffer.pop(i)
 
         if i == len(buffer) and not buffer[-1].strip().endswith(","):
@@ -119,7 +121,7 @@ def update_backcompat_tests(types, version):
         last = buffer[-1]
         spaces = ' ' * (len(last) - len(last.lstrip()))
         for (j, t) in enumerate(types):
-          newline = spaces + ('"%s-%s"' % (version, t))
+          newline = spaces + ('"%s-%s"' % (index_version, t))
           if j < len(types) - 1 or i < len(buffer):
             newline += ','
           buffer.insert(i, newline + '\n')
@@ -128,7 +130,7 @@ def update_backcompat_tests(types, version):
         buffer.append(line)
         return True
 
-      if 'oldNames' in line:
+      if 'Names = {' in line:
         self.start = len(buffer) # location of first index name
       buffer.append(line)
       return False
@@ -213,11 +215,12 @@ def main():
 
   print('\nCreating backwards compatibility indexes')
   source = download_release(c.version, c.temp_dir, c.force)
-  create_and_add_index(source, 'cfs', c.version, c.temp_dir)
-  create_and_add_index(source, 'nocfs', c.version, c.temp_dir)
+  current_version = scriptutil.Version.parse(scriptutil.find_current_version())
+  create_and_add_index(source, 'cfs', c.version, current_version, c.temp_dir)
+  create_and_add_index(source, 'nocfs', c.version, current_version, c.temp_dir)
     
   print('\nAdding backwards compatibility tests')
-  update_backcompat_tests(['cfs', 'nocfs'], c.version)
+  update_backcompat_tests(['cfs', 'nocfs'], c.version, current_version)
 
   print('\nTesting changes')
   check_backcompat_tests()

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d1a047ad/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index bf7cec5..9b26413 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -66,6 +66,11 @@ class Version(object):
            (self.bugfix > other.bugfix or self.bugfix == other.bugfix and
            self.prerelease >= other.prerelease)))
 
+  def is_back_compat_with(self, other):
+    if not self.on_or_after(other):
+      raise Exception('Back compat check disallowed for newer version: %s < %s' % (self, other))
+    return other.major + 1 >= self.major
+
 def run(cmd):
   try:
     output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)


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

Posted by sa...@apache.org.
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/46c827e3
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/46c827e3
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/46c827e3

Branch: refs/heads/master
Commit: 46c827e31a5534bb032d0803318d01309bf0195c
Parents: aa4c87d
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:49:28 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/46c827e3/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()


[26/28] lucene-solr:branch_5x: Handle adding back compat indexes for versions that are no longer supported

Posted by sa...@apache.org.
Handle adding back compat indexes for 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/29f55999
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/29f55999
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/29f55999

Branch: refs/heads/branch_5x
Commit: 29f559990c09898c5fbbbce7150e9ea043103514
Parents: 0a172ce
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:26:42 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:51:33 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addBackcompatIndexes.py | 31 ++++++++++++++------------
 dev-tools/scripts/scriptutil.py           |  5 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/29f55999/dev-tools/scripts/addBackcompatIndexes.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 9e0963d..8a8b5b2 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -30,15 +30,16 @@ import urllib.request
 import re
 import shutil
 
-def create_and_add_index(source, indextype, version, temp_dir):
+def create_and_add_index(source, indextype, index_version, current_version, temp_dir):
   if indextype in ('cfs', 'nocfs'):
     dirname = 'index.%s' % indextype
   else:
     dirname = indextype
+  prefix = 'index' if current_version.is_back_compat_with(index_version) else 'unsupported'
   filename = {
-    'cfs': 'index.%s-cfs.zip',
-    'nocfs': 'index.%s-nocfs.zip'
-  }[indextype] % version
+    'cfs': '%s.%s-cfs.zip',
+    'nocfs': '%s.%s-nocfs.zip'
+  }[indextype] % (prefix, index_version)
   print('  creating %s...' % filename, end='', flush=True)
   module = 'backward-codecs'
   index_dir = os.path.join('lucene', module, 'src/test/org/apache/lucene/index')
@@ -84,11 +85,12 @@ def create_and_add_index(source, indextype, version, temp_dir):
   scriptutil.run('rm -rf %s' % bc_index_dir)
   print('done')
 
-def update_backcompat_tests(types, version):
+def update_backcompat_tests(types, index_version, current_version):
   print('  adding new indexes to backcompat tests...', end='', flush=True)
   module = 'lucene/backward-codecs'
   filename = '%s/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java' % module
-  matcher = re.compile(r'final static String\[\] oldNames = {|};')
+  matcher = re.compile(r'final static String\[\] oldNames = {|};' if current_version.is_back_compat_with(index_version)
+                       else r'final String\[\] unsupportedNames = {|};')
 
   def find_version(x):
     x = x.strip()
@@ -99,17 +101,17 @@ def update_backcompat_tests(types, version):
     start = None
     def __call__(self, buffer, match, line):
       if self.start:
-        # find where we this version should exist
+        # find where this version should exist
         i = len(buffer) - 1 
         v = find_version(buffer[i])
-        while i >= self.start and v.on_or_after(version):
+        while i >= self.start and v.on_or_after(index_version):
           i -= 1
           v = find_version(buffer[i])
         i += 1 # readjust since we skipped past by 1
 
         # unfortunately python doesn't have a range remove from list...
         # here we want to remove any previous references to the version we are adding
-        while i < len(buffer) and version.on_or_after(find_version(buffer[i])):
+        while i < len(buffer) and index_version.on_or_after(find_version(buffer[i])):
           buffer.pop(i)
 
         if i == len(buffer) and not buffer[-1].strip().endswith(","):
@@ -119,7 +121,7 @@ def update_backcompat_tests(types, version):
         last = buffer[-1]
         spaces = ' ' * (len(last) - len(last.lstrip()))
         for (j, t) in enumerate(types):
-          newline = spaces + ('"%s-%s"' % (version, t))
+          newline = spaces + ('"%s-%s"' % (index_version, t))
           if j < len(types) - 1 or i < len(buffer):
             newline += ','
           buffer.insert(i, newline + '\n')
@@ -128,7 +130,7 @@ def update_backcompat_tests(types, version):
         buffer.append(line)
         return True
 
-      if 'oldNames' in line:
+      if 'Names = {' in line:
         self.start = len(buffer) # location of first index name
       buffer.append(line)
       return False
@@ -213,11 +215,12 @@ def main():
 
   print('\nCreating backwards compatibility indexes')
   source = download_release(c.version, c.temp_dir, c.force)
-  create_and_add_index(source, 'cfs', c.version, c.temp_dir)
-  create_and_add_index(source, 'nocfs', c.version, c.temp_dir)
+  current_version = scriptutil.Version.parse(scriptutil.find_current_version())
+  create_and_add_index(source, 'cfs', c.version, current_version, c.temp_dir)
+  create_and_add_index(source, 'nocfs', c.version, current_version, c.temp_dir)
     
   print('\nAdding backwards compatibility tests')
-  update_backcompat_tests(['cfs', 'nocfs'], c.version)
+  update_backcompat_tests(['cfs', 'nocfs'], c.version, current_version)
 
   print('\nTesting changes')
   check_backcompat_tests()

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/29f55999/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index bf7cec5..9b26413 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -66,6 +66,11 @@ class Version(object):
            (self.bugfix > other.bugfix or self.bugfix == other.bugfix and
            self.prerelease >= other.prerelease)))
 
+  def is_back_compat_with(self, other):
+    if not self.on_or_after(other):
+      raise Exception('Back compat check disallowed for newer version: %s < %s' % (self, other))
+    return other.major + 1 >= self.major
+
 def run(cmd):
   try:
     output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)


[02/28] lucene-solr:branch_5x: Add version 5.5.2

Posted by sa...@apache.org.
Add version 5.5.2


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

Branch: refs/heads/branch_5x
Commit: 84ca5d235697ab00b335fc803f0e6d34ccd583f3
Parents: 2489de2
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 11:16:18 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 11:16:18 2016 -0400

----------------------------------------------------------------------
 lucene/core/src/java/org/apache/lucene/util/Version.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/84ca5d23/lucene/core/src/java/org/apache/lucene/util/Version.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/util/Version.java b/lucene/core/src/java/org/apache/lucene/util/Version.java
index f0518e1..10036ef 100644
--- a/lucene/core/src/java/org/apache/lucene/util/Version.java
+++ b/lucene/core/src/java/org/apache/lucene/util/Version.java
@@ -287,6 +287,13 @@ public final class Version {
   public static final Version LUCENE_5_5_1 = new Version(5, 5, 1);
 
   /**
+   * Match settings and bugs in Lucene's 5.5.2 release.
+   * @deprecated Use latest
+   */
+  @Deprecated
+  public static final Version LUCENE_5_5_2 = new Version(5, 5, 2);
+
+  /**
    * Match settings and bugs in Lucene's 5.6.0 release.
    */
   public static final Version LUCENE_5_6_0 = new Version(5, 6, 0);


[04/28] lucene-solr:master: Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version

Posted by sa...@apache.org.
Switch is-latest-version check from whether the branch types match to directly comparing the new version against the current version


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

Branch: refs/heads/master
Commit: 60fac6c177f8f858573e4f40c1449f020d77ac4f
Parents: d730f4a
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 13:11:16 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 13:11:16 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addVersion.py | 8 +++-----
 dev-tools/scripts/scriptutil.py | 2 +-
 2 files changed, 4 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/60fac6c1/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc41116..92a49b3 100644
--- a/dev-tools/scripts/addVersion.py
+++ b/dev-tools/scripts/addVersion.py
@@ -179,9 +179,7 @@ def read_config():
   c = parser.parse_args()
 
   c.branch_type = find_branch_type()
-  c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
-                      c.version.is_minor_release() and c.branch_type == BranchType.stable or \
-                      c.version.is_major_release() and c.branch_type == BranchType.unstable
+  c.is_latest_version = c.version.on_or_after(Version.parse(find_current_version()))
 
   print ("branch_type is %s " % c.branch_type)
 
@@ -217,9 +215,9 @@ def main():
   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.matching_branch)
+  add_constant(c.version, not c.is_latest_version)
 
-  if c.matching_branch:
+  if c.is_latest_version:
     print('\nUpdating latest version')
     update_build_version(c.version)
     update_latest_constant(c.version)

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/60fac6c1/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index 84c39cd..bf7cec5 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -119,7 +119,7 @@ def find_branch_type():
 
 version_prop_re = re.compile('version\.base=(.*)')
 def find_current_version():
-  return version_prop_re.search(open('lucene/version.properties').read()).group(1)
+  return version_prop_re.search(open('lucene/version.properties').read()).group(1).strip()
 
 if __name__ == '__main__':
   print('This is only a support module, it cannot be run')


[24/28] lucene-solr:branch_6_0: Handle adding back compat indexes for versions that are no longer supported

Posted by sa...@apache.org.
Handle adding back compat indexes for 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/5dce97fd
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/5dce97fd
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/5dce97fd

Branch: refs/heads/branch_6_0
Commit: 5dce97fd58016b5adb7025ad51cd9b5961cb3829
Parents: 3eaf36f
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:26:42 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:51:14 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addBackcompatIndexes.py | 31 ++++++++++++++------------
 dev-tools/scripts/scriptutil.py           |  5 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5dce97fd/dev-tools/scripts/addBackcompatIndexes.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 9e0963d..8a8b5b2 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -30,15 +30,16 @@ import urllib.request
 import re
 import shutil
 
-def create_and_add_index(source, indextype, version, temp_dir):
+def create_and_add_index(source, indextype, index_version, current_version, temp_dir):
   if indextype in ('cfs', 'nocfs'):
     dirname = 'index.%s' % indextype
   else:
     dirname = indextype
+  prefix = 'index' if current_version.is_back_compat_with(index_version) else 'unsupported'
   filename = {
-    'cfs': 'index.%s-cfs.zip',
-    'nocfs': 'index.%s-nocfs.zip'
-  }[indextype] % version
+    'cfs': '%s.%s-cfs.zip',
+    'nocfs': '%s.%s-nocfs.zip'
+  }[indextype] % (prefix, index_version)
   print('  creating %s...' % filename, end='', flush=True)
   module = 'backward-codecs'
   index_dir = os.path.join('lucene', module, 'src/test/org/apache/lucene/index')
@@ -84,11 +85,12 @@ def create_and_add_index(source, indextype, version, temp_dir):
   scriptutil.run('rm -rf %s' % bc_index_dir)
   print('done')
 
-def update_backcompat_tests(types, version):
+def update_backcompat_tests(types, index_version, current_version):
   print('  adding new indexes to backcompat tests...', end='', flush=True)
   module = 'lucene/backward-codecs'
   filename = '%s/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java' % module
-  matcher = re.compile(r'final static String\[\] oldNames = {|};')
+  matcher = re.compile(r'final static String\[\] oldNames = {|};' if current_version.is_back_compat_with(index_version)
+                       else r'final String\[\] unsupportedNames = {|};')
 
   def find_version(x):
     x = x.strip()
@@ -99,17 +101,17 @@ def update_backcompat_tests(types, version):
     start = None
     def __call__(self, buffer, match, line):
       if self.start:
-        # find where we this version should exist
+        # find where this version should exist
         i = len(buffer) - 1 
         v = find_version(buffer[i])
-        while i >= self.start and v.on_or_after(version):
+        while i >= self.start and v.on_or_after(index_version):
           i -= 1
           v = find_version(buffer[i])
         i += 1 # readjust since we skipped past by 1
 
         # unfortunately python doesn't have a range remove from list...
         # here we want to remove any previous references to the version we are adding
-        while i < len(buffer) and version.on_or_after(find_version(buffer[i])):
+        while i < len(buffer) and index_version.on_or_after(find_version(buffer[i])):
           buffer.pop(i)
 
         if i == len(buffer) and not buffer[-1].strip().endswith(","):
@@ -119,7 +121,7 @@ def update_backcompat_tests(types, version):
         last = buffer[-1]
         spaces = ' ' * (len(last) - len(last.lstrip()))
         for (j, t) in enumerate(types):
-          newline = spaces + ('"%s-%s"' % (version, t))
+          newline = spaces + ('"%s-%s"' % (index_version, t))
           if j < len(types) - 1 or i < len(buffer):
             newline += ','
           buffer.insert(i, newline + '\n')
@@ -128,7 +130,7 @@ def update_backcompat_tests(types, version):
         buffer.append(line)
         return True
 
-      if 'oldNames' in line:
+      if 'Names = {' in line:
         self.start = len(buffer) # location of first index name
       buffer.append(line)
       return False
@@ -213,11 +215,12 @@ def main():
 
   print('\nCreating backwards compatibility indexes')
   source = download_release(c.version, c.temp_dir, c.force)
-  create_and_add_index(source, 'cfs', c.version, c.temp_dir)
-  create_and_add_index(source, 'nocfs', c.version, c.temp_dir)
+  current_version = scriptutil.Version.parse(scriptutil.find_current_version())
+  create_and_add_index(source, 'cfs', c.version, current_version, c.temp_dir)
+  create_and_add_index(source, 'nocfs', c.version, current_version, c.temp_dir)
     
   print('\nAdding backwards compatibility tests')
-  update_backcompat_tests(['cfs', 'nocfs'], c.version)
+  update_backcompat_tests(['cfs', 'nocfs'], c.version, current_version)
 
   print('\nTesting changes')
   check_backcompat_tests()

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/5dce97fd/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index bf7cec5..9b26413 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -66,6 +66,11 @@ class Version(object):
            (self.bugfix > other.bugfix or self.bugfix == other.bugfix and
            self.prerelease >= other.prerelease)))
 
+  def is_back_compat_with(self, other):
+    if not self.on_or_after(other):
+      raise Exception('Back compat check disallowed for newer version: %s < %s' % (self, other))
+    return other.major + 1 >= self.major
+
 def run(cmd):
   try:
     output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)


[22/28] lucene-solr:branch_6_1: Handle adding back compat indexes for versions that are no longer supported

Posted by sa...@apache.org.
Handle adding back compat indexes for 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/8504e02b
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/8504e02b
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/8504e02b

Branch: refs/heads/branch_6_1
Commit: 8504e02b67ea927a083b1ac5988a793a9c4f02ad
Parents: 7dc24eb
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:26:42 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:50:53 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addBackcompatIndexes.py | 31 ++++++++++++++------------
 dev-tools/scripts/scriptutil.py           |  5 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8504e02b/dev-tools/scripts/addBackcompatIndexes.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 9e0963d..8a8b5b2 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -30,15 +30,16 @@ import urllib.request
 import re
 import shutil
 
-def create_and_add_index(source, indextype, version, temp_dir):
+def create_and_add_index(source, indextype, index_version, current_version, temp_dir):
   if indextype in ('cfs', 'nocfs'):
     dirname = 'index.%s' % indextype
   else:
     dirname = indextype
+  prefix = 'index' if current_version.is_back_compat_with(index_version) else 'unsupported'
   filename = {
-    'cfs': 'index.%s-cfs.zip',
-    'nocfs': 'index.%s-nocfs.zip'
-  }[indextype] % version
+    'cfs': '%s.%s-cfs.zip',
+    'nocfs': '%s.%s-nocfs.zip'
+  }[indextype] % (prefix, index_version)
   print('  creating %s...' % filename, end='', flush=True)
   module = 'backward-codecs'
   index_dir = os.path.join('lucene', module, 'src/test/org/apache/lucene/index')
@@ -84,11 +85,12 @@ def create_and_add_index(source, indextype, version, temp_dir):
   scriptutil.run('rm -rf %s' % bc_index_dir)
   print('done')
 
-def update_backcompat_tests(types, version):
+def update_backcompat_tests(types, index_version, current_version):
   print('  adding new indexes to backcompat tests...', end='', flush=True)
   module = 'lucene/backward-codecs'
   filename = '%s/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java' % module
-  matcher = re.compile(r'final static String\[\] oldNames = {|};')
+  matcher = re.compile(r'final static String\[\] oldNames = {|};' if current_version.is_back_compat_with(index_version)
+                       else r'final String\[\] unsupportedNames = {|};')
 
   def find_version(x):
     x = x.strip()
@@ -99,17 +101,17 @@ def update_backcompat_tests(types, version):
     start = None
     def __call__(self, buffer, match, line):
       if self.start:
-        # find where we this version should exist
+        # find where this version should exist
         i = len(buffer) - 1 
         v = find_version(buffer[i])
-        while i >= self.start and v.on_or_after(version):
+        while i >= self.start and v.on_or_after(index_version):
           i -= 1
           v = find_version(buffer[i])
         i += 1 # readjust since we skipped past by 1
 
         # unfortunately python doesn't have a range remove from list...
         # here we want to remove any previous references to the version we are adding
-        while i < len(buffer) and version.on_or_after(find_version(buffer[i])):
+        while i < len(buffer) and index_version.on_or_after(find_version(buffer[i])):
           buffer.pop(i)
 
         if i == len(buffer) and not buffer[-1].strip().endswith(","):
@@ -119,7 +121,7 @@ def update_backcompat_tests(types, version):
         last = buffer[-1]
         spaces = ' ' * (len(last) - len(last.lstrip()))
         for (j, t) in enumerate(types):
-          newline = spaces + ('"%s-%s"' % (version, t))
+          newline = spaces + ('"%s-%s"' % (index_version, t))
           if j < len(types) - 1 or i < len(buffer):
             newline += ','
           buffer.insert(i, newline + '\n')
@@ -128,7 +130,7 @@ def update_backcompat_tests(types, version):
         buffer.append(line)
         return True
 
-      if 'oldNames' in line:
+      if 'Names = {' in line:
         self.start = len(buffer) # location of first index name
       buffer.append(line)
       return False
@@ -213,11 +215,12 @@ def main():
 
   print('\nCreating backwards compatibility indexes')
   source = download_release(c.version, c.temp_dir, c.force)
-  create_and_add_index(source, 'cfs', c.version, c.temp_dir)
-  create_and_add_index(source, 'nocfs', c.version, c.temp_dir)
+  current_version = scriptutil.Version.parse(scriptutil.find_current_version())
+  create_and_add_index(source, 'cfs', c.version, current_version, c.temp_dir)
+  create_and_add_index(source, 'nocfs', c.version, current_version, c.temp_dir)
     
   print('\nAdding backwards compatibility tests')
-  update_backcompat_tests(['cfs', 'nocfs'], c.version)
+  update_backcompat_tests(['cfs', 'nocfs'], c.version, current_version)
 
   print('\nTesting changes')
   check_backcompat_tests()

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/8504e02b/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index bf7cec5..9b26413 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -66,6 +66,11 @@ class Version(object):
            (self.bugfix > other.bugfix or self.bugfix == other.bugfix and
            self.prerelease >= other.prerelease)))
 
+  def is_back_compat_with(self, other):
+    if not self.on_or_after(other):
+      raise Exception('Back compat check disallowed for newer version: %s < %s' % (self, other))
+    return other.major + 1 >= self.major
+
 def run(cmd):
   try:
     output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)


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

Posted by sa...@apache.org.
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/6868778a
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/6868778a
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/6868778a

Branch: refs/heads/branch_5_5
Commit: 6868778aab2d400f71782cff41d5e9790f5310c2
Parents: add302a
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:44 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/6868778a/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()


[28/28] lucene-solr:branch_5_5: Handle adding back compat indexes for versions that are no longer supported

Posted by sa...@apache.org.
Handle adding back compat indexes for 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/33ef9eb0
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/33ef9eb0
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/33ef9eb0

Branch: refs/heads/branch_5_5
Commit: 33ef9eb087851ce93cf182b9e93f6fcc383b1c11
Parents: 6868778
Author: Steve Rowe <sa...@apache.org>
Authored: Sat Jun 25 14:26:42 2016 -0400
Committer: Steve Rowe <sa...@apache.org>
Committed: Sat Jun 25 14:51:48 2016 -0400

----------------------------------------------------------------------
 dev-tools/scripts/addBackcompatIndexes.py | 31 ++++++++++++++------------
 dev-tools/scripts/scriptutil.py           |  5 +++++
 2 files changed, 22 insertions(+), 14 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/33ef9eb0/dev-tools/scripts/addBackcompatIndexes.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 9e0963d..8a8b5b2 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -30,15 +30,16 @@ import urllib.request
 import re
 import shutil
 
-def create_and_add_index(source, indextype, version, temp_dir):
+def create_and_add_index(source, indextype, index_version, current_version, temp_dir):
   if indextype in ('cfs', 'nocfs'):
     dirname = 'index.%s' % indextype
   else:
     dirname = indextype
+  prefix = 'index' if current_version.is_back_compat_with(index_version) else 'unsupported'
   filename = {
-    'cfs': 'index.%s-cfs.zip',
-    'nocfs': 'index.%s-nocfs.zip'
-  }[indextype] % version
+    'cfs': '%s.%s-cfs.zip',
+    'nocfs': '%s.%s-nocfs.zip'
+  }[indextype] % (prefix, index_version)
   print('  creating %s...' % filename, end='', flush=True)
   module = 'backward-codecs'
   index_dir = os.path.join('lucene', module, 'src/test/org/apache/lucene/index')
@@ -84,11 +85,12 @@ def create_and_add_index(source, indextype, version, temp_dir):
   scriptutil.run('rm -rf %s' % bc_index_dir)
   print('done')
 
-def update_backcompat_tests(types, version):
+def update_backcompat_tests(types, index_version, current_version):
   print('  adding new indexes to backcompat tests...', end='', flush=True)
   module = 'lucene/backward-codecs'
   filename = '%s/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java' % module
-  matcher = re.compile(r'final static String\[\] oldNames = {|};')
+  matcher = re.compile(r'final static String\[\] oldNames = {|};' if current_version.is_back_compat_with(index_version)
+                       else r'final String\[\] unsupportedNames = {|};')
 
   def find_version(x):
     x = x.strip()
@@ -99,17 +101,17 @@ def update_backcompat_tests(types, version):
     start = None
     def __call__(self, buffer, match, line):
       if self.start:
-        # find where we this version should exist
+        # find where this version should exist
         i = len(buffer) - 1 
         v = find_version(buffer[i])
-        while i >= self.start and v.on_or_after(version):
+        while i >= self.start and v.on_or_after(index_version):
           i -= 1
           v = find_version(buffer[i])
         i += 1 # readjust since we skipped past by 1
 
         # unfortunately python doesn't have a range remove from list...
         # here we want to remove any previous references to the version we are adding
-        while i < len(buffer) and version.on_or_after(find_version(buffer[i])):
+        while i < len(buffer) and index_version.on_or_after(find_version(buffer[i])):
           buffer.pop(i)
 
         if i == len(buffer) and not buffer[-1].strip().endswith(","):
@@ -119,7 +121,7 @@ def update_backcompat_tests(types, version):
         last = buffer[-1]
         spaces = ' ' * (len(last) - len(last.lstrip()))
         for (j, t) in enumerate(types):
-          newline = spaces + ('"%s-%s"' % (version, t))
+          newline = spaces + ('"%s-%s"' % (index_version, t))
           if j < len(types) - 1 or i < len(buffer):
             newline += ','
           buffer.insert(i, newline + '\n')
@@ -128,7 +130,7 @@ def update_backcompat_tests(types, version):
         buffer.append(line)
         return True
 
-      if 'oldNames' in line:
+      if 'Names = {' in line:
         self.start = len(buffer) # location of first index name
       buffer.append(line)
       return False
@@ -213,11 +215,12 @@ def main():
 
   print('\nCreating backwards compatibility indexes')
   source = download_release(c.version, c.temp_dir, c.force)
-  create_and_add_index(source, 'cfs', c.version, c.temp_dir)
-  create_and_add_index(source, 'nocfs', c.version, c.temp_dir)
+  current_version = scriptutil.Version.parse(scriptutil.find_current_version())
+  create_and_add_index(source, 'cfs', c.version, current_version, c.temp_dir)
+  create_and_add_index(source, 'nocfs', c.version, current_version, c.temp_dir)
     
   print('\nAdding backwards compatibility tests')
-  update_backcompat_tests(['cfs', 'nocfs'], c.version)
+  update_backcompat_tests(['cfs', 'nocfs'], c.version, current_version)
 
   print('\nTesting changes')
   check_backcompat_tests()

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/33ef9eb0/dev-tools/scripts/scriptutil.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/scriptutil.py b/dev-tools/scripts/scriptutil.py
index bf7cec5..9b26413 100644
--- a/dev-tools/scripts/scriptutil.py
+++ b/dev-tools/scripts/scriptutil.py
@@ -66,6 +66,11 @@ class Version(object):
            (self.bugfix > other.bugfix or self.bugfix == other.bugfix and
            self.prerelease >= other.prerelease)))
 
+  def is_back_compat_with(self, other):
+    if not self.on_or_after(other):
+      raise Exception('Back compat check disallowed for newer version: %s < %s' % (self, other))
+    return other.major + 1 >= self.major
+
 def run(cmd):
   try:
     output = subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)