8 | | * Set the `sync_per_request` attribute to `false` to disable per-request syncing. |
9 | | * Make sure the user under which your Subversion hooks are run has write access to the Trac environment, or use a tool like `sudo` to temporarily elevate privileges. |
| 9 | * Make sure the user under which your hooks are run has write access to the Trac environment, or use a tool like `sudo` to temporarily elevate privileges. |
| 10 | |
| 11 | == Enabling the components |
| 12 | |
| 13 | Support for version control systems is provided by optional components distributed with Trac, which are disabled by default //(since 1.0)//. Subversion and Git must be explicitly enabled if you wish to use them. |
| 14 | |
| 15 | The version control systems can be enabled by adding the following to the `[components]` section of your [TracIni#components-section trac.ini], or enabling the components in the //Plugins// admin panel. |
| 16 | |
| 17 | {{{#!ini |
| 18 | tracopt.versioncontrol.svn.* = enabled |
| 19 | }}} |
| 20 | |
| 21 | {{{#!ini |
| 22 | tracopt.versioncontrol.git.* = enabled |
| 23 | }}} |
12 | | Trac supports more than one repository per environment. The repositories may be of the same type, or of different types. The repository configurations may be stored in different locations, the two supported by default being the [#ReposDatabase database store] and the [#ReposTracIni trac.ini configuration file]. |
13 | | |
14 | | It is possible to define aliases of repositories, that act as "pointers" to real repositories. This can be useful when renaming a repository, to avoid breaking all the links to the old name. |
15 | | |
16 | | A number of attributes can be associated with each repository, which define the repository's location, type, name and how it is displayed in the source browser. The following attributes are supported: |
| 26 | Trac supports multiple repositories per environment, and the repositories may be for different version control system types. Each repository must be defined in a repository configuration provider, the two supported by default are the [#ReposDatabase database store] and the [#ReposTracIni trac.ini configuration file]. A repository should not be defined in multiple configuration providers. |
| 27 | |
| 28 | It is possible to define aliases of repositories, that act as "pointers" to real repositories. This can be useful when renaming a repository, to avoid breaking links to the old name. |
| 29 | |
| 30 | A number of attributes can be associated with each repository. The attributes define the repository's location, type, name and how it is displayed in the source browser. The following attributes are supported: |
192 | | == Migration from a single-repository setup (Subversion) #Migration |
193 | | The following procedure illustrates a typical migration from a Subversion single-repository setup to multiple repositories. |
194 | | |
195 | | 1. Remove the default repository specification from the `[trac] repository_dir` option. |
196 | | 1. Add the main repository as a named repository. |
197 | | 1. Re-synchronize the main repository. |
198 | | 1. Set up post-commit and post-revprop-change hooks on the "main" repository, and set the repository's `sync_per_request` attribute to `false`. |
199 | | 1. Add an alias to the main repository as the default repository (by leaving out the the `name`, e.g. `.alias = main`). This ensures that all links predating the migration still resolve to the main repository. |
200 | | 1. Repeat steps 2, 3 and 4 to add other "named" repositories as needed. |
201 | | |
202 | | == Migration from a single-repository setup (Mercurial) #MigrationMercurial |
203 | | The following procedure illustrates a typical migration from a Mercurial single-repository setup to multiple repositories. Please note that at the time of writing, no initial resynchronization or any hooks are necessary for Mercurial repositories - see [trac:ticket:9485 #9485] for more information. |
204 | | |
205 | | 1. Upgrade to the latest version of the [trac:TracMercurial] plugin. |
206 | | 1. Remove the default repository specification from the `[trac] repository_dir` option. |
207 | | 1. Add the main repository as a named repository. |
208 | | 1. Add an alias to the main repository as the default repository (by leaving out the the `name`, e.g. `.alias = main`). This ensures that all links predating the migration still resolve to the main repository. |
209 | | 1. Repeat step 3 to add other "named" repositories as needed. |
210 | | |