Improve release script
authorXavier Claessens <xclaesse@src.gnome.org>
Mon, 21 Jan 2008 11:35:49 +0000 (11:35 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Mon, 21 Jan 2008 11:35:49 +0000 (11:35 +0000)
svn path=/trunk/; revision=589

release.py

index b7f3208f1ff029f04222d44c9955a8b5e43d1ae8..66057fe643dd4a87d9259dbb4cbe72f06cad68b0 100755 (executable)
@@ -7,7 +7,6 @@ import csv
 import datetime
 from string import Template
 
-prev_tag = 'EMPATHY_0_21_5_1'
 username = 'xclaesse'
 upload_server = 'master.gnome.org'
 template = '''\
@@ -159,12 +158,19 @@ class Project:
                t = Template(template)
                return t.substitute(locals())
        
+       def get_last_tag(self):
+               tags_str = self.exec_cmd('git-tag')
+               tags = tags_str.splitlines()
+
+               return tags[len(tags)-1]
+
        def get_commits(self):
                bugs = ''
                co = None
                commits = []
+               last_tag = self.get_last_tag()
 
-               changes = self.exec_cmd ("git-log " + prev_tag + "..")
+               changes = self.exec_cmd ("git-log " + last_tag + "..")
                for line in changes.splitlines(1):
                        if line.startswith('commit'):
                                if co != None:
@@ -246,7 +252,7 @@ class Project:
 
                self.exec_cmd('git-tag -m "Tagged for release %s." %s' % ( self.package_version, new_tag))
 
-       def write_news(self):
+       def generate_news(self):
                bugs = ''
                translations = ''
                others = ''
@@ -263,6 +269,11 @@ class Project:
                news = 'NEW in '+ self.package_version + '\n==============\n' 
                news += others + '\nBugs fixed:\n' + bugs + '\nTranslations:\n' + translations + '\n'
 
+               return news
+
+       def write_news(self):
+               news = self.generate_news()
+
                f = open ('/tmp/NEWS', 'w')
                s = f.write(news)
                f.close()
@@ -285,5 +296,6 @@ class Project:
                print self.get_release_notes()
 
 p = Project()
+#print p.generate_news()
 #p.write_news()
 #p.release()