From 0e8d9411b0714e581793689530c5e43ef5939950 Mon Sep 17 00:00:00 2001 From: Steve Rowe Date: Sat, 30 Sep 2017 23:20:51 -0400 Subject: [PATCH] addBackcompatIndexes.py: 4 space indent instead of 6 for new index names; check previous line when deciding whether there are previous versions. --- dev-tools/scripts/addBackcompatIndexes.py | 6 +++--- .../org/apache/lucene/index/TestBackwardsCompatibility.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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() {