Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

addBackcompatIndexes.py: 4 space indent instead of 6 for new index names; check previous line when deciding whether there are previous versions.

Steve Rowe0e8d9411b071
diff --git a/dev-tools/scripts/addBackcompatIndexes.py b/dev-tools/scripts/addBackcompatIndexes.py
index 1cada018c89..03e858cb505 100644
--- a/dev-tools/scripts/addBackcompatIndexes.py
+++ b/dev-tools/scripts/addBackcompatIndexes.py
@@ -121,8 +121,8 @@ def update_backcompat_tests(types, index_version, current_version):
def __call__(self, buffer, match, line):
if self.start:
# find where this version should exist
- i = len(buffer) - 1
- previous_version_exists = '};' not in line # Version list closure => there are no versions
+ i = len(buffer) - 1
+ previous_version_exists = not ('};' in line and buffer[-1].strip().endswith("{"))
if previous_version_exists: # Only look if there is a version here
v = find_version(buffer[i])
while i >= self.start and v.on_or_after(index_version):
@@ -143,7 +143,7 @@ def update_backcompat_tests(types, index_version, current_version):
last = buffer[-1]
spaces = ' ' * (len(last) - len(last.lstrip()))
else:
- spaces = ' '
+ spaces = ' '
for (j, t) in enumerate(types):
if t == 'sorted':
newline = spaces + ('"sorted.%s"') % index_version
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 88900d439bc..7437e75679a 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
@@ -287,8 +287,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
}
final static String[] oldNames = {
- "7.0.0-cfs",
- "7.0.0-nocfs"
+ "7.0.0-cfs",
+ "7.0.0-nocfs"
};
public static String[] getOldNames() {
@@ -296,7 +296,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
}
final static String[] oldSortedNames = {
- "sorted.7.0.0"
+ "sorted.7.0.0"
};
public static String[] getOldSortedNames() {