~ubuntu-branches/ubuntu/precise/trac/precise

« back to all changes in this revision

Viewing changes to trac/versioncontrol/svn_fs.py

  • Committer: Bazaar Package Importer
  • Author(s): Luis Matos
  • Date: 2008-08-16 00:08:30 UTC
  • mfrom: (1.1.14 upstream) (14.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080816000830-q50gglu6pbj0gas2
Tags: 0.11.1-2
* Upstream version 
  "Trac 0.11.1 contains a number of bug fixes and minor enhancements."
* Patch setup.py to install the contrib dir ( Closes: #495019 )
* Modified compatible version of trac-bzr so that trac 0.11.1 an be
  used with the current trac-bzr version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
244
244
        below that path will be included.
245
245
        """)
246
246
 
 
247
    error = None
 
248
 
247
249
    def __init__(self):
248
250
        self._version = None
249
251
        
250
252
        try:
251
253
            _import_svn()
252
254
            self.log.debug('Subversion bindings imported')
253
 
        except ImportError:
 
255
        except ImportError, e:
 
256
            self.error = e
254
257
            self.log.info('Failed to load Subversion bindings', exc_info=True)
255
 
            self.has_subversion = False
256
258
        else:
257
 
            self.has_subversion = True
258
259
            Pool()
259
260
 
260
261
    def get_supported_types(self):
261
 
        if self.has_subversion:
262
 
            yield ("direct-svnfs", 4)
263
 
            yield ("svnfs", 4)
264
 
            yield ("svn", 2)
 
262
        prio = 1
 
263
        if self.error:
 
264
            prio = -1
 
265
        yield ("direct-svnfs", prio*4)
 
266
        yield ("svnfs", prio*4)
 
267
        yield ("svn", prio*2)
265
268
 
266
269
    def get_repository(self, type, dir, authname):
267
270
        """Return a `SubversionRepository`.
278
281
        if type == 'direct-svnfs':
279
282
            repos = fs_repos
280
283
        else:
281
 
            repos = CachedRepository(self.env.get_db_cnx(), fs_repos, None,
 
284
            repos = CachedRepository(self.env.get_db_cnx, fs_repos, None,
282
285
                                     self.log)
283
286
            repos.has_linear_changesets = True
284
287
        if authname: