Edgewall Software

Changes between Version 131 and Version 132 of TracSubversion


Ignore:
Timestamp:
Jun 18, 2015, 7:47:27 PM (9 years ago)
Author:
Jun Omae
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • TracSubversion

    v131 v132  
    11[[PageOutline(2-3)]]
    22
    3 = Trac and Subversion =
     3= Trac and Subversion
    44
    55Trac has supported the [http://subversion.apache.org Subversion] VersionControlSystem since day one. Actually, Trac was even named `svntrac` back then!
     
    1010[=#tracopt]
    1111In Trac 1.0 (trunk, starting from r11082), the components for Subversion support have been moved below `tracopt.` so you need to explicitly enable them in your TracIni#components-section:
    12 {{{
     12{{{#!ini
    1313[components]
    1414tracopt.versioncontrol.svn.* = enabled
     
    2323options elsewhere.
    2424
    25 == Getting Subversion ==
     25== Getting Subversion
    2626
    2727From subversion.apache.org:
     
    2929 - [http://subversion.apache.org/packages.html Subversion Binary Packages]
    3030
    31 === Debian Linux ===
     31=== Debian Linux
    3232Install the Subversion Bindings using `apt`:
    33 {{{
    34 apt-get install python-subversion
     33{{{#!sh
     34$ apt-get install python-subversion
    3535}}}
    3636
     
    5656You ''MUST'' have exactly same version of `subversion` and `subversion-python` installed, otherwise binding won't work:
    5757
    58 {{{
    59 # yum list subversion subversion-python
     58{{{#!sh
     59$ yum list subversion subversion-python
    6060Available Packages
    6161subversion.x86_64                           1.7.14-6.el7                    base
     
    115115
    116116
    117 == Building Subversion ==
     117== Building Subversion
    118118
    119119The point is not to repeat the excellent build instructions found elsewhere,
     
    131131   (the one containing the `svn` and `libsvn` packages). [[br]]
    132132   e.g. if svn is installed in `/opt/subversion-1.4.4`:
    133    {{{
    134 # export PYTHONPATH=$PYTHONPATH:/opt/subversion-1.4.4/lib/svn-python`
     133   {{{#!sh
     134$ export PYTHONPATH=$PYTHONPATH:/opt/subversion-1.4.4/lib/svn-python
    135135   }}}
    136136   If you're using TracModPython, be sure that Apache will also see this environment variable, or alternatively use the [TracModPython#Subversionissues PythonPath] mod_python directive.[[br]][[br]]You may also just copy the libsvn/ and svn/ directories in the resulting installation directories, e.g. /usr/local/lib/svn-python/, to the site-packages/ directory in your /usr/lib/python2.x/ directory. Python will then find them without having to adapt your `PYTHONPATH`.
    137137
    138 === Getting Subversion working ===
     138=== Getting Subversion working
    139139(this is a cite from TracOnDebianSarge as this is extremely useful for first time user setting up subversion repository)
    140140
    141141To create a Subversion project at '''/var/svn/project''', issue these commands to get SVN up and running:
    142142
    143 {{{
    144   $ mkdir -p /var/svn/project
    145   $ mkdir -p /tmp/project/{branches,tags,trunk}
    146   $ svnadmin create /var/svn/project
    147   $ svn import /tmp/project file:///var/svn/project -m "initial import"
    148   $ rm -rf /tmp/project
     143{{{#!sh
     144$ mkdir -p /var/svn/project
     145$ mkdir -p /tmp/project/{branches,tags,trunk}
     146$ svnadmin create /var/svn/project
     147$ svn import /tmp/project file:///var/svn/project -m "initial import"
     148$ rm -rf /tmp/project
    149149}}}
    150150
    151151Fix permissions to the repository:
    152 {{{
    153   $ find /var/svn/project -type f -exec chmod 660 {} \;
    154   $ find /var/svn/project -type d -exec chmod 2770 {} \;
    155   $ chown -R root.www-data /var/svn/project
    156 }}}
    157 
    158 
    159 
    160 == Trac and specific Subversion versions ==
    161 {{{
    162 #!comment
     152{{{#!sh
     153$ find /var/svn/project -type f -exec chmod 660 {} \;
     154$ find /var/svn/project -type d -exec chmod 2770 {} \;
     155$ chown -R root.www-data /var/svn/project
     156}}}
     157
     158== Trac and specific Subversion versions
     159{{{#!comment
    163160The following info  about pre 1.3.0 versions is all ''by heart''
    164161and is probably inaccurate at places.
     
    171168Note that Trac always had issues with Subversion repositories using the Berkeley DB backend. If you happen to have such a repository, it would be a good idea to switch it to the FSFS backend if you intend to use it together with Trac. See google:svn+convert+bdb+to+fsfs.
    172169
    173 === Trac and Subversion 1.4 ===
     170=== Trac and Subversion 1.4
    174171
    175172Trac used to work well with Subversion 1.4.
     
    186183See also: [http://svn.apache.org/repos/asf/subversion/tags/1.4.0/CHANGES release notes for 1.4.0]
    187184
    188 === Trac and Subversion 1.5 ===
     185=== Trac and Subversion 1.5
    189186
    190187Trac works fine with Subversion 1.5.
     
    195192The new svn:externals format is still work in progress (#7687).
    196193
    197 === Trac and Subversion 1.6 ===
     194=== Trac and Subversion 1.6
    198195
    199196Trac works best with Subversion 1.6. A couple of memory leaks were fixed in 1.6 and you might benefit from these fixes.
    200197
    201 === Trac and Subversion 1.7 ===
     198=== Trac and Subversion 1.7
    202199
    203200Trac seems to work fine with 1.7.0 as well, however be sure to use Trac >= 0.12.3.
    204201
    205 === Trac and Subversion 1.8 ===
     202=== Trac and Subversion 1.8
    206203
    207204Trac seems to work fine with 1.8.0 as well, however be sure to use Trac >= 0.12.3.
     
    209206The `svn:keywords` with custom keyword definitions is unsupported yet (#11364).
    210207
    211 == Troubleshooting ==
     208== Troubleshooting
    212209
    213210==== `RuntimeError: instance.__dict__ not accessible in restricted mode` ==== #instance-dict-restricted-mode
    214211
    215212This is becoming one of the most frequently reported issues for Trac and the Subversion backend, when the TracModPython web front-end is used. The problem happen when Trac is running outside of the "main_interpreter" Python interpreter and can be fixed as explained in #3371:
    216 {{{
     213{{{#!apache
    217214<Location>
    218 ...
    219 PythonInterpreter main_interpreter
    220 ...
     215    ...
     216    PythonInterpreter main_interpreter
     217    ...
    221218</Location>
    222219}}}
    223220
    224221This problem can also occur when using mod_wsgi for both embedded mode or daemon mode. As documented in [http://code.google.com/p/modwsgi/wiki/IntegrationWithTrac integrating Trac with mod_wsgi], the solution is the same as for mod_python. That is, force Trac instance to run in main Python interpreter instance. When using mod_wsgi this is done using:
    225 {{{
     222{{{#!apache
    226223<Location>
    227 ...
    228 WSGIApplicationGroup %{GLOBAL}
    229 ...
     224    ...
     225    WSGIApplicationGroup %{GLOBAL}
     226    ...
    230227</Location>
    231228}}}
    232229
    233 ==== `TypeError: argument number 0: a 'apr_pool_t *' is expected, 'instance(<libsvn.core.GenericSWIGWrapper instance at 0x...>)' is received` ====
     230==== `TypeError: argument number 0: a 'apr_pool_t *' is expected, 'instance(<libsvn.core.GenericSWIGWrapper instance at 0x...>)' is received`
    234231Use the same fix as above. See #2611 for more information if needed.
    235232
     
    259256
    260257If you use FreeBSD try this:
    261 {{{
    262 [root@host /usr/ports/devel/py-subversion]# make FORCE_PKG_REGISTER= install clean
     258{{{#!sh
     259$ sudo make FORCE_PKG_REGISTER= install clean
    263260}}}
    264261
     
    266263following check list to find out.
    267264
    268 ==== Check list ====
     265==== Check list
    269266
    270267When there's some trouble using the Subversion bindings,
     
    272269
    273270 1. Verify that you can load the bindings using the Python interactive interpreter
    274  {{{
     271 {{{#!sh
    275272$ python
    276273Python ...
     
    303300
    304301 2. Check the version
    305  {{{
     302 {{{#!pycon
    306303>>> (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO, core.SVN_VER_PATCH)
    307304(1, 4, 3, 3)
     
    314311
    315312 e.g.
    316  {{{
    317 cat /proc/10213/maps | grep .so | cut -d/ -f2- | sort -u
     313 {{{#!sh
     314$ cat /proc/10213/maps | grep .so | cut -d/ -f2- | sort -u
    318315 }}}
    319316
     
    325322
    326323 Before Trac 1.0, the Subversion specific modules were always enabled, but even then it could happen that for some reason, people had explicitly disabled those and possibly forgot about it. If so, set it/them to enabled (or simply delete the offending lines, since I believe they are enabled by default.)
    327  {{{
     324 {{{#!ini
    328325[components]
    329326trac.versioncontrol.api.repositorymanager = enabled
     
    343340
    344341 If you have installed the Subversion .so-Files in some "remote" location, Apache may be unable to find them (and thus unable to pass them on to !Python/Trac, such that Trac cannot find Subversion). To check if this is the case, do the following:
    345  {{{
    346 /etc/init.d/apache2 stop
    347 $export LD_LIBRARY_PATH=/usr/lib/python/site-packages/libsvn/:$LD_LIBRARY_PATH
    348 /etc/init.d/apache2 restart
     342 {{{#!sh
     343$ /etc/init.d/apache2 stop
     344$ export LD_LIBRARY_PATH=/usr/lib/python/site-packages/libsvn/:$LD_LIBRARY_PATH
     345$ /etc/init.d/apache2 restart
    349346 }}}
    350347
     
    358355
    359356
    360 == Known Issues ==
     357== Known Issues
    361358
    362359[[TicketQuery(status=!closed&keywords=~svn&type=defect|enhancement)]]
    363360
    364 == Asking for More Support About Subversion ==
     361== Asking for More Support About Subversion
    365362
    366363 * !ReadTheFineBook: http://svnbook.red-bean.com and/or the