Opened 14 years ago
Last modified 13 years ago
#7242 closed enhancement
[PATCH] Trac 0.12 compatibility + other improvements — at Initial Version
Reported by: | Mikael Relbe | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Component: | ChangeLogMacro |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
I have modified the plugin and adapted it to Trac 0.12 and made it multi-repo aware. I also couldn't resist in implementing some other requested improvements. In short:
- Multi-repo aware for Trac 0.12 (#7062)
- Revision ranges can now be stated (#327)
- Changelog are put in a definition list (#3919)
The log indents nicely when stated in a list:
Last changes: * Default repo: [[ChangeLog(/)]] * otherrepo: [[ChangeLog(otherrepo:/)]]
I hope you don't mind me providing this patch, it may look like the plugin is completely re-written, but it's not. I've done this by applying successive changes, before supplying this ticket, all in good faith.
Please be critical to the patch as I am not a very experienced Python coder. I wouldn't be surprised if the parameter decoding can be made simpler/smarter.
I have not tested this on Trac 0.11, the plugin should be broken using Trac 0.11 due to the multi-repo capability (I have not studied the Trac 0.11 code).
I also updated the documentation:
Write repository change log to output.
The ChangeLog macro writes a log of the last changes of a repository at a given path. Following variants are possible to use:
1. [[ChangeLog([reponame:]path)]] 2. [[ChangeLog([reponame:]path@rev)]] 3. [[ChangeLog([reponame:]path@rev, limit)]] 4. [[ChangeLog([reponame:]path@from-to)]] 5. [[ChangeLog([reponame:]path@rev, limit, rev)]]
- Default repository is used if reponame is left out. To show the last five changes of the default repository:
[[ChangeLog(/)]]
To show the last five changes of the trunk folder in a named repo:[[ChangeLog(otherrepo:/trunk)]]
- The ending revision can be set. To show the last five changes up to revision 99:
[[ChangeLog(otherrepo:/trunk@99)]]
- The limit can be set by an optional parameter. To show the last 10 changes, up to revision 99:
[[ChangeLog(otherrepo:/trunk@99, 10)]]
- A range of revisions can be logged.
[[ChangeLog(otherrepo:/trunk@90-99)]]
To lists all changes:[[ChangeLog(otherrepo:/trunk@1-HEAD)]]
HEAD can be left out:[[ChangeLog(otherrepo:/trunk@1-)]]
- For backwards compatibility, revision can be stated as a second parameter instead:
[[ChangeLog(otherrepo:/trunk, 10, 99)]]
limit and rev may be keyword arguments.
[[ChangeLog(otherrepo:/trunk, limit=10, rev=99)]]
Patch for #7242 to apply on r7928