yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject yetus git commit: YETUS-174. releasedocmaker bug with ranges
Date Tue, 17 Nov 2015 04:49:52 GMT
Repository: yetus
Updated Branches:
  refs/heads/master 6ed5a98e3 -> bae1ae053


YETUS-174. releasedocmaker bug with ranges

Signed-off-by: Allen Wittenauer <aw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/bae1ae05
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/bae1ae05
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/bae1ae05

Branch: refs/heads/master
Commit: bae1ae0539b2a8edf90a875ffd9b7dab1e6f9dee
Parents: 6ed5a98
Author: Kengo Seki <sekikn@gmail.com>
Authored: Fri Nov 13 01:24:42 2015 +0900
Committer: Allen Wittenauer <aw@apache.org>
Committed: Mon Nov 16 20:47:16 2015 -0800

----------------------------------------------------------------------
 release-doc-maker/releasedocmaker.py | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/bae1ae05/release-doc-maker/releasedocmaker.py
----------------------------------------------------------------------
diff --git a/release-doc-maker/releasedocmaker.py b/release-doc-maker/releasedocmaker.py
index ae3ce45..e579efc 100755
--- a/release-doc-maker/releasedocmaker.py
+++ b/release-doc-maker/releasedocmaker.py
@@ -29,6 +29,10 @@ try:
     import json
 except ImportError:
     import simplejson as json
+try:
+    set
+except NameError:
+    from sets import Set as set
 
 RELEASE_VERSION = {}
 NAME_PATTERN = re.compile(r' \([0-9]+\)')
@@ -147,17 +151,22 @@ class GetVersions(object):
         self.newversions = []
         versions.sort(key=LooseVersion)
         print "Looking for %s through %s"%(versions[0], versions[-1])
+        newversions = set()
         for project in projects:
             url = "https://issues.apache.org/jira/rest/api/2/project/%s/versions" % project
             resp = urllib2.urlopen(url)
             datum = json.loads(resp.read())
             for data in datum:
-                name = data['name']
-                if name[0].isdigit and versions[0] <= name and name <= versions[-1]:
-                    print "Adding %s to the list" % name
-                    self.newversions.append(name)
-        newlist = list(set(self.newversions))
-        self.newversions = newlist
+                newversions.add(data['name'])
+        newlist = newversions.copy()
+        newlist.add(versions[0])
+        newlist.add(versions[-1])
+        newlist = list(newlist)
+        newlist.sort(key=LooseVersion)
+        for newversion in newlist[newlist.index(versions[0]):newlist.index(versions[-1])+1]:
+            if newversion in newversions:
+                print "Adding %s to the list" % newversion
+                self.newversions.append(newversion)
 
     def getlist(self):
         return self.newversions


Mime
View raw message