Changes between Version 1 and Version 2 of TracRepositoryAdmin


Ignore:
Timestamp:
Jan 22, 2019, 12:08:22 AM (5 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • TracRepositoryAdmin

    v1 v2  
    7979Note that the default repository has an empty name, so it will likely need to be quoted when running `trac-admin` from a shell. Alternatively, the name "`(default)`" can be used instead, for example when running `trac-admin` in interactive mode.
    8080
     81== Repository caching
     82
     83The Subversion and Git repository connectors support caching, which improves the performance browsing the repository, viewing logs and viewing changesets. Cached repositories must be [#Synchronization synchronized]; either explicit or implicit synchronization can be used. When searching changesets, only cached repositories are searched.
     84
     85Subversion repositories are cached unless the type is `direct-svnfs`. Git repositories are cached when `[git]` [wiki:TracIni#git-section cached_repository] is `true`.
    8186
    8287== Repository synchronization #Synchronization
     
    144149{{{#!sh
    145150#!/bin/sh
     151tracenv=/path/to/env     # change with your Trac environment's path
     152repos=                   # change with your repository's name
    146153while read oldrev newrev refname; do
    147         git rev-list --reverse $newrev ^$oldrev  | \
    148         while read rev; do
    149                 trac-admin /path/to/env changeset added <repos> $rev
    150         done
     154    if [ "$oldrev" = 0000000000000000000000000000000000000000 ]; then
     155        git rev-list --reverse "$newrev" --
     156    else
     157        git rev-list --reverse "$newrev" "^$oldrev" --
     158    fi | xargs trac-admin "$tracenv" changeset added "$repos"
    151159done
    152160}}}
     
    178186
    179187
     188== Automatic changeset references in tickets
     189
     190You can automatically add a reference to the changeset as a ticket comment whenever changes are committed to the repository. The description of the commit needs to contain one of the following formulas:
     191 * '''`Refs #123`''' - to reference this changeset in `#123` ticket
     192 * '''`Fixes #123`''' - to reference this changeset and close `#123` ticket with the default status ''fixed''
     193
     194This functionality requires installing a post-commit hook as described in [#ExplicitSync], and enabling the optional commit updater components by adding the following line to the `[components]` section of your [wiki:TracIni#components-section trac.ini], or enabling the components in the //Plugins// admin panel.
     195{{{#!ini
     196tracopt.ticket.commit_updater.* = enabled
     197}}}
     198For more information, see the documentation of the `CommitTicketUpdater` component in the //Plugins// admin panel and the [trac:CommitTicketUpdater] page.
     199
    180200== Migration from a single-repository setup (Subversion) #Migration
    181201The following procedure illustrates a typical migration from a Subversion single-repository setup to multiple repositories.
     
    191211The 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.
    192212
    193  1. Upgrade to the latest version of the TracMercurial plugin.
     213 1. Upgrade to the latest version of the [trac:TracMercurial] plugin.
    194214 1. Remove the default repository specification from the `[trac] repository_dir` option.
    195215 1. Add the main repository as a named repository.
     
    202222
    203223You must now use the optional components from `tracopt.ticket.commit_updater.*`, which you can activate through the Plugins panel in the Administrative part of the web interface, or by directly modifying the [TracIni#components-section "[components]"] section in the trac.ini. Be sure to use [#ExplicitSync explicit synchronization] as explained above.
     224
     225See [trac:CommitTicketUpdater#Troubleshooting] for more troubleshooting tips.