mirror of
https://github.com/apache/lucene.git
synced 2025-02-09 11:35:14 +00:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/lucene-solr
This commit is contained in:
commit
91f74ee254
@ -19,9 +19,7 @@ sys.path.append(os.path.dirname(__file__))
|
|||||||
from scriptutil import *
|
from scriptutil import *
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import io
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
|
||||||
|
|
||||||
def update_changes(filename, new_version):
|
def update_changes(filename, new_version):
|
||||||
print(' adding new section to %s...' % filename, end='', flush=True)
|
print(' adding new section to %s...' % filename, end='', flush=True)
|
||||||
@ -168,18 +166,23 @@ def check_solr_version_tests():
|
|||||||
def read_config():
|
def read_config():
|
||||||
parser = argparse.ArgumentParser(description='Add a new version')
|
parser = argparse.ArgumentParser(description='Add a new version')
|
||||||
parser.add_argument('version', type=Version.parse)
|
parser.add_argument('version', type=Version.parse)
|
||||||
parser.add_argument('-c', '--changeid', type=str, help='SVN ChangeId for downstream version change to merge')
|
parser.add_argument('-c', '--changeid', type=str, help='Git ChangeId (commit hash) for downstream version change to merge')
|
||||||
c = parser.parse_args()
|
c = parser.parse_args()
|
||||||
|
|
||||||
c.branch_type = find_branch_type()
|
c.branch_type = find_branch_type()
|
||||||
c.matching_branch = c.version.is_bugfix_release() and c.branch_type == 'release' or \
|
c.matching_branch = c.version.is_bugfix_release() and c.branch_type == BranchType.release or \
|
||||||
c.version.is_minor_release() and c.branch_type == 'stable' or \
|
c.version.is_minor_release() and c.branch_type == BranchType.stable or \
|
||||||
c.branch_type == 'major'
|
c.version.is_major_release() and c.branch_type == BranchType.major
|
||||||
|
|
||||||
if c.changeid and c.matching_branch:
|
print ("branch_type is %s " % c.branch_type)
|
||||||
parser.error('Cannot use --changeid on branch that new version will originate on')
|
|
||||||
if c.changeid and c.version.is_major_release():
|
if c.changeid and c.version.is_major_release():
|
||||||
parser.error('Cannot use --changeid for major release')
|
parser.error('Cannot use --changeid for major release')
|
||||||
|
if c.changeid and c.matching_branch:
|
||||||
|
parser.error('Cannot use --changeid on branch that new version will originate on')
|
||||||
|
if c.version.is_bugfix_release() and c.branch_type in [BranchType.major, BranchType.stable] and not c.changeid:
|
||||||
|
parser.error('Adding bugfix release on master or stable branch requires --changeid')
|
||||||
|
if c.version.is_minor_release() and c.branch_type in [BranchType.major] and not c.changeid:
|
||||||
|
parser.error('Adding minor release on master branch requires --changeid')
|
||||||
|
|
||||||
return c
|
return c
|
||||||
|
|
||||||
|
@ -14,11 +14,10 @@
|
|||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import io
|
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
class Version(object):
|
class Version(object):
|
||||||
def __init__(self, major, minor, bugfix, prerelease):
|
def __init__(self, major, minor, bugfix, prerelease):
|
||||||
@ -95,7 +94,12 @@ def update_file(filename, line_re, edit):
|
|||||||
f.write(''.join(buffer))
|
f.write(''.join(buffer))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# branch types are "release", "stable" and "trunk"
|
# branch types are "release", "stable" and "major"
|
||||||
|
class BranchType(Enum):
|
||||||
|
major = 1
|
||||||
|
stable = 2
|
||||||
|
release = 3
|
||||||
|
|
||||||
def find_branch_type():
|
def find_branch_type():
|
||||||
output = subprocess.check_output('git status', shell=True)
|
output = subprocess.check_output('git status', shell=True)
|
||||||
for line in output.split(b'\n'):
|
for line in output.split(b'\n'):
|
||||||
@ -106,11 +110,11 @@ def find_branch_type():
|
|||||||
raise Exception('git status missing branch name')
|
raise Exception('git status missing branch name')
|
||||||
|
|
||||||
if branchName == b'master':
|
if branchName == b'master':
|
||||||
return 'master'
|
return BranchType.major
|
||||||
if re.match(r'branch_(\d+)x', branchName.decode('UTF-8')):
|
if re.match(r'branch_(\d+)x', branchName.decode('UTF-8')):
|
||||||
return 'stable'
|
return BranchType.stable
|
||||||
if re.match(r'branch_(\d+)_(\d+)', branchName.decode('UTF-8')):
|
if re.match(r'branch_(\d+)_(\d+)', branchName.decode('UTF-8')):
|
||||||
return 'release'
|
return BranchType.release
|
||||||
raise Exception('Cannot run bumpVersion.py on feature branch')
|
raise Exception('Cannot run bumpVersion.py on feature branch')
|
||||||
|
|
||||||
version_prop_re = re.compile('version\.base=(.*)')
|
version_prop_re = re.compile('version\.base=(.*)')
|
||||||
|
@ -76,6 +76,10 @@ Bug Fixes
|
|||||||
* LUCENE-7187: Block join queries' Weight#extractTerms(...) implementations
|
* LUCENE-7187: Block join queries' Weight#extractTerms(...) implementations
|
||||||
should delegate to the wrapped weight. (Martijn van Groningen)
|
should delegate to the wrapped weight. (Martijn van Groningen)
|
||||||
|
|
||||||
|
* LUCENE-7188: remove incorrect sanity check in NRTCachingDirectory.listAll()
|
||||||
|
that led to IllegalStateException being thrown when nothing was wrong.
|
||||||
|
(David Smiley, yonik)
|
||||||
|
|
||||||
Other
|
Other
|
||||||
|
|
||||||
* LUCENE-7174: Upgrade randomizedtesting to 2.3.4. (Uwe Schindler, Dawid Weiss)
|
* LUCENE-7174: Upgrade randomizedtesting to 2.3.4. (Uwe Schindler, Dawid Weiss)
|
||||||
|
@ -101,10 +101,7 @@ public class NRTCachingDirectory extends FilterDirectory implements Accountable
|
|||||||
files.add(f);
|
files.add(f);
|
||||||
}
|
}
|
||||||
for(String f : in.listAll()) {
|
for(String f : in.listAll()) {
|
||||||
if (!files.add(f)) {
|
files.add(f);
|
||||||
throw new IllegalStateException("file: " + in + " appears both in delegate and in cache: " +
|
|
||||||
"cache=" + Arrays.toString(cache.listAll()) + ",delegate=" + Arrays.toString(in.listAll()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
String[] result = files.toArray(new String[files.size()]);
|
String[] result = files.toArray(new String[files.size()]);
|
||||||
Arrays.sort(result);
|
Arrays.sort(result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user