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:59 UTC
[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
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')