| 1 | == Extension Point : ''IRepositoryConnector'' == |
| 2 | |
| 3 | ||'''Interface'''||''IRepositoryConnector''||'''Since'''||0.10|| |
| 4 | ||'''Module'''||''trac.versioncontrol.api''||'''Source'''||[source:trunk/trac/versioncontrol/api.py#/IRepositoryConnector api.py]|| |
| 5 | |
| 6 | The ''IRepositoryConnector'' allows components to connect Trac to repositories of new types of [VersionControlSystem version control systems]. |
| 7 | |
| 8 | == Purpose == |
| 9 | Trac can be connected to Version Control systems to e.g. [TracBrowser browse files], [TracChangeset visualize changesets] or [TracRevisionLog revision logs]. Plugins can hook into the version control system to extend the set of repositories that are available in Trac. |
| 10 | |
| 11 | The main purpose for this interface is to allow plugins to implement support for other version control systems. |
| 12 | |
| 13 | (For implementing new mechanisms to ''find or register'' the repositories use [../trac.versioncontrol.api.IRepositoryProvider IRepositoryProvider] instead.) |
| 14 | |
| 15 | == Usage == |
| 16 | |
| 17 | Implementing the interface follows the standard guidelines found in [wiki:TracDev/ComponentArchitecture] and of course [wiki:TracDev/PluginDevelopment]. |
| 18 | |
| 19 | 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. |
| 20 | |
| 21 | 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. |
| 22 | |
| 23 | == Examples == |
| 24 | |
| 25 | Due to the complexity of implementing a full version control system connector, no simple example can be provided here. |
| 26 | |
| 27 | == Available Implementations == |
| 28 | |
| 29 | * `tracopt.versioncontrol.svn.svn_fs.SubversionConnector` |
| 30 | * `tracopt.versioncontrol.git.git_fs.GitConnector` |
| 31 | |
| 32 | * See VersionControlSystem#OtherVersioningSystems |
| 33 | |
| 34 | == Additional Information and References == |
| 35 | |
| 36 | * [apiref:trac.versioncontrol.api.IRepositoryConnector-class epydoc] |
| 37 | * [apidoc:api/trac_versioncontrol_api#trac.versioncontrol.api.IRepositoryConnector API Reference] |
| 38 | * See [../trac.versioncontrol.api.IRepositoryProvider trac.versioncontrol.api.IRepositoryProvider], [../trac.versioncontrol.api.IRepositoryChangeListener trac.versioncontrol.api.IRepositoryChangeListener] |
| 39 | * [TracDev/DatabaseSchema/VersionControl Version control cache database schema] |
| 40 | |
| 41 | === API History |
| 42 | * 0.10 introduced the interface (changeset:2669) |
| 43 | * 0.11.1 added the `error` attribute (#6796) |
| 44 | * 0.12 replaced the `authname` parameter with the `params` dictionary (changeset:9125) |