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:56 UTC

[05/28] lucene-solr:branch_6x: 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/a78db407
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/a78db407
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/a78db407

Branch: refs/heads/branch_6x
Commit: a78db407204da9c73b0cc119e70a43c29eebeba1
Parents: 98d5c83
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:11:52 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/a78db407/dev-tools/scripts/addVersion.py
----------------------------------------------------------------------
diff --git a/dev-tools/scripts/addVersion.py b/dev-tools/scripts/addVersion.py
index cc41116..92a49b3 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/a78db407/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')