Extension Point : IRepositoryConnector
Interface | IRepositoryConnector | Since | 0.10 |
Module | trac.versioncontrol.api | Source | api.py |
The IRepositoryConnector allows components to connect Trac to repositories of new types of version control systems.
Purpose
Trac can be connected to Version Control systems to e.g. browse files, visualize changesets or revision logs. Plugins can hook into the version control system to extend the set of repositories that are available in Trac.
The main purpose for this interface is to allow plugins to implement support for other version control systems.
(For implementing new mechanisms to find or register the repositories use IRepositoryProvider instead.)
Usage
Implementing the interface follows the standard guidelines found in TracDev/ComponentArchitecture and of course TracDev/PluginDevelopment.
The main task is to return a trac.versioncontrol.api.Repository
instance. A subclass is required to implement the abstract methods, which entails similarly subclassing the trac.versioncontrol.api.Node
and trac.versioncontrol.api.Changeset
abstract base classes.
Instead of directly inheriting from the base classes mentioned above, you might want to support caching and use trac.versioncontrol.cache.CachedRepository
and trac.versioncontrol.cache.CachedChangeset
instead.
Examples
Due to the complexity of implementing a full version control system connector, no simple example can be provided here.
Available Implementations
tracopt.versioncontrol.svn.svn_fs.SubversionConnector
tracopt.versioncontrol.git.git_fs.GitConnector
Additional Information and References
- epydoc
- API Reference
- See trac.versioncontrol.api.IRepositoryProvider, trac.versioncontrol.api.IRepositoryChangeListener
- Version control cache database schema
API History
- 0.10 introduced the interface (changeset:2669)
- 0.11.1 added the
error
attribute (#6796) - 0.12 replaced the
authname
parameter with theparams
dictionary (changeset:9125)