Changes between Version 131 and Version 132 of TracSubversion
- Timestamp:
- Jun 18, 2015, 7:47:27 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracSubversion
v131 v132 1 1 [[PageOutline(2-3)]] 2 2 3 = Trac and Subversion =3 = Trac and Subversion 4 4 5 5 Trac has supported the [http://subversion.apache.org Subversion] VersionControlSystem since day one. Actually, Trac was even named `svntrac` back then! … … 10 10 [=#tracopt] 11 11 In 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 13 13 [components] 14 14 tracopt.versioncontrol.svn.* = enabled … … 23 23 options elsewhere. 24 24 25 == Getting Subversion ==25 == Getting Subversion 26 26 27 27 From subversion.apache.org: … … 29 29 - [http://subversion.apache.org/packages.html Subversion Binary Packages] 30 30 31 === Debian Linux ===31 === Debian Linux 32 32 Install the Subversion Bindings using `apt`: 33 {{{ 34 apt-get install python-subversion33 {{{#!sh 34 $ apt-get install python-subversion 35 35 }}} 36 36 … … 56 56 You ''MUST'' have exactly same version of `subversion` and `subversion-python` installed, otherwise binding won't work: 57 57 58 {{{ 59 #yum list subversion subversion-python58 {{{#!sh 59 $ yum list subversion subversion-python 60 60 Available Packages 61 61 subversion.x86_64 1.7.14-6.el7 base … … 115 115 116 116 117 == Building Subversion ==117 == Building Subversion 118 118 119 119 The point is not to repeat the excellent build instructions found elsewhere, … … 131 131 (the one containing the `svn` and `libsvn` packages). [[br]] 132 132 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 135 135 }}} 136 136 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`. 137 137 138 === Getting Subversion working ===138 === Getting Subversion working 139 139 (this is a cite from TracOnDebianSarge as this is extremely useful for first time user setting up subversion repository) 140 140 141 141 To create a Subversion project at '''/var/svn/project''', issue these commands to get SVN up and running: 142 142 143 {{{ 144 145 146 147 148 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 149 149 }}} 150 150 151 151 Fix 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 163 160 The following info about pre 1.3.0 versions is all ''by heart'' 164 161 and is probably inaccurate at places. … … 171 168 Note 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. 172 169 173 === Trac and Subversion 1.4 ===170 === Trac and Subversion 1.4 174 171 175 172 Trac used to work well with Subversion 1.4. … … 186 183 See also: [http://svn.apache.org/repos/asf/subversion/tags/1.4.0/CHANGES release notes for 1.4.0] 187 184 188 === Trac and Subversion 1.5 ===185 === Trac and Subversion 1.5 189 186 190 187 Trac works fine with Subversion 1.5. … … 195 192 The new svn:externals format is still work in progress (#7687). 196 193 197 === Trac and Subversion 1.6 ===194 === Trac and Subversion 1.6 198 195 199 196 Trac works best with Subversion 1.6. A couple of memory leaks were fixed in 1.6 and you might benefit from these fixes. 200 197 201 === Trac and Subversion 1.7 ===198 === Trac and Subversion 1.7 202 199 203 200 Trac seems to work fine with 1.7.0 as well, however be sure to use Trac >= 0.12.3. 204 201 205 === Trac and Subversion 1.8 ===202 === Trac and Subversion 1.8 206 203 207 204 Trac seems to work fine with 1.8.0 as well, however be sure to use Trac >= 0.12.3. … … 209 206 The `svn:keywords` with custom keyword definitions is unsupported yet (#11364). 210 207 211 == Troubleshooting ==208 == Troubleshooting 212 209 213 210 ==== `RuntimeError: instance.__dict__ not accessible in restricted mode` ==== #instance-dict-restricted-mode 214 211 215 212 This 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 217 214 <Location> 218 ...219 PythonInterpreter main_interpreter220 ...215 ... 216 PythonInterpreter main_interpreter 217 ... 221 218 </Location> 222 219 }}} 223 220 224 221 This 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 226 223 <Location> 227 ...228 WSGIApplicationGroup %{GLOBAL}229 ...224 ... 225 WSGIApplicationGroup %{GLOBAL} 226 ... 230 227 </Location> 231 228 }}} 232 229 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` 234 231 Use the same fix as above. See #2611 for more information if needed. 235 232 … … 259 256 260 257 If you use FreeBSD try this: 261 {{{ 262 [root@host /usr/ports/devel/py-subversion]#make FORCE_PKG_REGISTER= install clean258 {{{#!sh 259 $ sudo make FORCE_PKG_REGISTER= install clean 263 260 }}} 264 261 … … 266 263 following check list to find out. 267 264 268 ==== Check list ====265 ==== Check list 269 266 270 267 When there's some trouble using the Subversion bindings, … … 272 269 273 270 1. Verify that you can load the bindings using the Python interactive interpreter 274 {{{ 271 {{{#!sh 275 272 $ python 276 273 Python ... … … 303 300 304 301 2. Check the version 305 {{{ 302 {{{#!pycon 306 303 >>> (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, core.SVN_VER_MICRO, core.SVN_VER_PATCH) 307 304 (1, 4, 3, 3) … … 314 311 315 312 e.g. 316 {{{ 317 cat /proc/10213/maps | grep .so | cut -d/ -f2- | sort -u313 {{{#!sh 314 $ cat /proc/10213/maps | grep .so | cut -d/ -f2- | sort -u 318 315 }}} 319 316 … … 325 322 326 323 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 328 325 [components] 329 326 trac.versioncontrol.api.repositorymanager = enabled … … 343 340 344 341 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 stop347 $ export LD_LIBRARY_PATH=/usr/lib/python/site-packages/libsvn/:$LD_LIBRARY_PATH348 /etc/init.d/apache2 restart342 {{{#!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 349 346 }}} 350 347 … … 358 355 359 356 360 == Known Issues ==357 == Known Issues 361 358 362 359 [[TicketQuery(status=!closed&keywords=~svn&type=defect|enhancement)]] 363 360 364 == Asking for More Support About Subversion ==361 == Asking for More Support About Subversion 365 362 366 363 * !ReadTheFineBook: http://svnbook.red-bean.com and/or the