Special case the 0.6.0 release in the Changelog

This commit is contained in:
Kovid Goyal 2009-07-22 14:20:32 -06:00
parent d0e1fa2d90
commit d43fcc768f

View File

@ -1,7 +1,7 @@
''' '''
Trac Macro to generate an end use Changelog from the svn logs. Trac Macro to generate an end use Changelog from the svn logs.
''' '''
import re, collections, time import re, collections, time, os
from bzrlib import log as blog, branch from bzrlib import log as blog, branch
@ -12,12 +12,13 @@ from trac.wiki.macros import WikiMacroBase
from trac.util import Markup from trac.util import Markup
BZR_PATH = '/var/bzr/code/calibre/trunk' BZR_PATH = '/usr/local/calibre'
class ChangelogFormatter(blog.LogFormatter): class ChangelogFormatter(blog.LogFormatter):
supports_tags = True supports_tags = True
supports_merge_revisions = False supports_merge_revisions = False
_show_advice = False
def __init__(self, num_of_versions=20): def __init__(self, num_of_versions=20):
self.num_of_versions = num_of_versions self.num_of_versions = num_of_versions
@ -47,13 +48,19 @@ class ChangelogFormatter(blog.LogFormatter):
txt = ['= Changelog =\n[[PageOutline]]'] txt = ['= Changelog =\n[[PageOutline]]']
for entry in self.entries: for entry in self.entries:
txt.append(u'----\n== Version '+entry[0]+' ==') txt.append(u'----\n== Version '+entry[0]+' ==')
if entry[0] == '0.6.0':
txt.append(u'For a list of new features in 0.6.0 see http://calibre.kovidgoyal.net/new_in_6')
else:
for msg in entry[1]: for msg in entry[1]:
txt.append(u' * ' + msg) txt.append(u' * ' + msg)
return u'\n'.join(txt) return u'\n'.join(txt)
def bzr_log_to_txt(): def bzr_log_to_txt():
b = branch.Branch.open(BZR_PATH) path = BZR_PATH
if not os.path.exists(path):
path = '/home/kovid/work/calibre'
b = branch.Branch.open(path)
lf = ChangelogFormatter() lf = ChangelogFormatter()
blog.show_log(b, lf) blog.show_log(b, lf)
return lf.to_wiki_txt() return lf.to_wiki_txt()
@ -68,6 +75,6 @@ class ChangeLogMacro(WikiMacroBase):
if __name__ == '__main__': if __name__ == '__main__':
print bzr_log_to_txt() print bzr_log_to_txt().encode('utf-8')