Opened 18 years ago
Last modified 15 years ago
#808 assigned enhancement
Add Changesets to TracXmlRpc plugin
Reported by: | iXce | Owned by: | Olemis Lang |
---|---|---|---|
Priority: | normal | Component: | XmlRpcPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
Here is a patch adding changeset interface into Trac XmlRpc API. It's not perfect but it works really well.
Attachments (1)
Change History (5)
Changed 18 years ago by
Attachment: | trac-xmlrpc-changeset.patch added |
---|
comment:1 Changed 18 years ago by
comment:2 follow-up: 3 Changed 15 years ago by
Trac Release: | 0.10 → 0.11 |
---|
TracGViz plugin includes some XML-RPC handlers. VersionControlRPC class's been included since version 1.3.3 (can't provide a link to browse the source code due to the fact that my SVN client is failing and I can't (commit | check) out anything ... sorry :( ).
Please see below a code snippet illustrating public methods :
class VersionControlRPC(Component): r""" An interface to Trac's Repository and RepositoryManager. """ implements(IXMLRPCHandler) # IXMLRPCHandler methods def xmlrpc_namespace(self): return 'source' def xmlrpc_methods(self): yield ('BROWSER_VIEW', ((list, list, str, str, bool, int), (list, list, str, str, bool), (list, list, str, str), (list, list, str), (list, list),), self.ls) yield ('BROWSER_VIEW', ((list, list, str), (list, list),), self.getFileAttributes) opt_types = [str, xmlrpclib.DateTime] yield ('CHANGESET_VIEW', tuple(rpc_opt_sigs(list, None, opt_types, \ opt_types, [bool]) ), self.getRevisions) yield ('CHANGESET_VIEW', ((list, str, str, xmlrpclib.DateTime), (list, str, str, str), (list, str, str), (list, str),), self.getFileHistory) yield ('CHANGESET_VIEW', ((list, str), (list, ),), self.enumChanges) yield ('CHANGESET_VIEW', ((list, str), (list, ),), self.normalize_rev)
It relies upon Trac Version Control API and has been tested using both wiki:TracMercurial connector and the default Subversion connector, and it should work with other (VCS | SCM). Besides it supports many features such as UNIX filename patterns, multiple specs (i.e. revision IDs + datetime values) for time intervals, and more.
There may be still a few open issues and further methods may be needed (e.g. file downloads). It is possible to move it onto XmlRpcPlugin. Feel free to do it !
PS: I tested it using 0.11, that's why I changed Trac Release
field . Hope you don't mind.
comment:3 Changed 15 years ago by
Replying to olemis:
TracGViz plugin includes some XML-RPC handlers. VersionControlRPC class's been included since version 1.3.3 (can't provide a link to browse the source code due to the fact that my SVN client is failing and I can't (commit | check) out anything ... sorry :( ).
BTW newer versions may include further features and bug fixes, so it's better to download the latest version. In fact in this case I've found a critical issue while using TracMercurial. So, please, take a look at the latest version instead.
comment:4 Changed 15 years ago by
Owner: | changed from Alec Thomas to Olemis Lang |
---|---|
Status: | new → assigned |
Good idea to add repository inspection, but I think a more general
versioncontrol
module might be better, mirroring thetrac.versioncontrol
API.