Ticket #327: ChangeLog-11.patch
| File ChangeLog-11.patch, 3.1 kB (added by DiGi, 10 months ago) |
|---|
-
setup.py
old new 1 1 from setuptools import setup 2 2 3 3 PACKAGE = 'tracchangelog' 4 VERSION = '0.1 '4 VERSION = '0.11' 5 5 6 setup(name=PACKAGE, version=VERSION, packages=['tracchangelog']) 6 setup( 7 name=PACKAGE, 8 version=VERSION, 9 packages=['tracchangelog'], 10 author = 'Alec Thomas', 11 author_email = 'alec@swapoff.org', 12 url = 'http://trac-hacks.org/wiki/ChangeLogPlugin', 13 description = 'ChangeLog Macro for Trac', 14 license = 'BSD', 15 zip_safe=True, 16 install_requires = [ 17 #'trac>=0.11', 18 ], 19 entry_points = { 20 'trac.plugins': [ 21 'tracchangelog = tracchangelog.tracchangelog', 22 ] 23 }, 24 ) -
tracchangelog.egg-info/trac_plugin.txt
old new -
tracchangelog/__init__.py
old new 1 # tracchangelog module2 from tracchangelog import * -
tracchangelog/tracchangelog.py
old new 12 12 class TracChangeLogPlugin(Component): 13 13 """ Provides the macro 14 14 {{{ 15 [[ChangeLog(path[,limit[,rev ]])]]15 [[ChangeLog(path[,limit[,rev[,torev]]])]] 16 16 }}} 17 17 which dumps the change log for path of revision rev, back 18 limit revisions. "rev" can be 0 for the latest revision. 18 limit revisions. "rev" can be 0 for the latest revision. torev is used for from revision to revision. limit must 19 19 """ 20 20 21 21 implements(IWikiMacroProvider) … … 27 27 return pydoc.getdoc(self) 28 28 29 29 def render_macro(self, req, name, content): 30 path, limit, rev = ([x.strip() for x in (content or '').split(',')] + [None, None])[0:3]30 path, limit, rev, torev = ([x.strip() for x in (content or '').split(',')] + [None, None, None])[0:4] 31 31 32 32 if not hasattr(req, 'authname'): 33 33 return Markup('<i>Changelog not available</i>') … … 44 44 limit = 5 45 45 else: 46 46 limit = int(limit) 47 47 if torev is None: 48 torev = 0 49 else: 50 torev = int(torev) 51 48 52 node = repo.get_node(path, rev) 49 53 out = StringIO() 50 54 for npath, nrev, nlog in node.get_history(limit): 51 55 change = repo.get_changeset(nrev) 56 if nrev < torev: 57 break 52 58 out.write(wiki_to_html("'''[%i] by %s on %s'''\n\n%s" % (nrev, change.author, format_datetime(change.date), change.message), self.env, req)); 59 if nrev == torev: 60 break 53 61 return out.getvalue()
