|
a/ForgeSVN/forgesvn/controllers.py |
|
b/ForgeSVN/forgesvn/controllers.py |
1 |
from tg import expose, redirect
|
1 |
from tg import expose, redirect
|
2 |
from tg.decorators import with_trailing_slash
|
2 |
from tg.decorators import with_trailing_slash
|
3 |
from pylons import c
|
3 |
from pylons import c
|
4 |
|
4 |
|
5 |
from allura.controllers import repository
|
5 |
from allura.controllers import repository
|
|
|
6 |
from allura.lib import helpers as h
|
6 |
|
7 |
|
7 |
class BranchBrowser(repository.BranchBrowser):
|
8 |
class BranchBrowser(repository.BranchBrowser):
|
8 |
|
9 |
|
9 |
def __init__(self):
|
10 |
def __init__(self):
|
10 |
super(BranchBrowser, self).__init__(None)
|
11 |
super(BranchBrowser, self).__init__(None)
|
11 |
|
12 |
|
12 |
@expose('jinja:forgesvn:templates/svn/index.html')
|
13 |
@expose('jinja:forgesvn:templates/svn/index.html')
|
13 |
@with_trailing_slash
|
14 |
@with_trailing_slash
|
14 |
def index(self, limit=None, page=0, count=0, **kw):
|
15 |
def index(self, limit=None, page=0, count=0, **kw):
|
15 |
latest = c.app.repo.latest(branch=self._branch)
|
16 |
latest = c.app.repo.latest(branch=self._branch)
|
16 |
if not latest:
|
17 |
if not latest or (latest._id.split(':')[1] == '1' and h.has_access(c.app, 'write')()):
|
17 |
return dict(allow_fork=False, log=[])
|
18 |
return dict(allow_fork=False, log=[])
|
18 |
redirect(latest.url() + 'tree/')
|
19 |
redirect(latest.url() + 'tree/')
|
19 |
|
20 |
|
20 |
@expose()
|
21 |
@expose()
|
21 |
def _lookup(self, rev, *remainder):
|
22 |
def _lookup(self, rev, *remainder):
|