Edgewall Software

Extension Point : IRepositoryConnector

InterfaceIRepositoryConnectorSince0.10
Moduletrac.versioncontrol.apiSourceapi.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

API History

  • 0.10 introduced the interface (changeset:2669)
  • 0.11.1 added the error attribute (#6796)
  • 0.12 replaced the authname parameter with the params dictionary (changeset:9125)
Last modified 10 years ago Last modified on Jul 30, 2014, 10:12:40 PM
Note: See TracWiki for help on using the wiki.