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

This commit is contained in:
Steve Rowe 2017-09-30 23:20:51 -04:00
parent 5afd41de11
commit 0e8d9411b0
2 changed files with 6 additions and 6 deletions

View File

@ -121,8 +121,8 @@ def update_backcompat_tests(types, index_version, current_version):
def __call__(self, buffer, match, line): def __call__(self, buffer, match, line):
if self.start: if self.start:
# find where this version should exist # find where this version should exist
i = len(buffer) - 1 i = len(buffer) - 1
previous_version_exists = '};' not in line # Version list closure => there are no versions previous_version_exists = not ('};' in line and buffer[-1].strip().endswith("{"))
if previous_version_exists: # Only look if there is a version here if previous_version_exists: # Only look if there is a version here
v = find_version(buffer[i]) v = find_version(buffer[i])
while i >= self.start and v.on_or_after(index_version): 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] last = buffer[-1]
spaces = ' ' * (len(last) - len(last.lstrip())) spaces = ' ' * (len(last) - len(last.lstrip()))
else: else:
spaces = ' ' spaces = ' '
for (j, t) in enumerate(types): for (j, t) in enumerate(types):
if t == 'sorted': if t == 'sorted':
newline = spaces + ('"sorted.%s"') % index_version newline = spaces + ('"sorted.%s"') % index_version

View File

@ -287,8 +287,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
} }
final static String[] oldNames = { final static String[] oldNames = {
"7.0.0-cfs", "7.0.0-cfs",
"7.0.0-nocfs" "7.0.0-nocfs"
}; };
public static String[] getOldNames() { public static String[] getOldNames() {
@ -296,7 +296,7 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
} }
final static String[] oldSortedNames = { final static String[] oldSortedNames = {
"sorted.7.0.0" "sorted.7.0.0"
}; };
public static String[] getOldSortedNames() { public static String[] getOldSortedNames() {