|
a/ForgeSVN/forgesvn/controllers.py |
|
b/ForgeSVN/forgesvn/controllers.py |
|
... |
|
... |
7 |
class BranchBrowser(repository.BranchBrowser):
|
7 |
class BranchBrowser(repository.BranchBrowser):
|
8 |
|
8 |
|
9 |
def __init__(self):
|
9 |
def __init__(self):
|
10 |
super(BranchBrowser, self).__init__(None)
|
10 |
super(BranchBrowser, self).__init__(None)
|
11 |
|
11 |
|
12 |
@expose('jinja:svn/index.html')
|
12 |
@expose('jinja:forgesvn:templates/svn/index.html')
|
13 |
@with_trailing_slash
|
13 |
@with_trailing_slash
|
14 |
def index(self, limit=None, page=0, count=0, **kw):
|
14 |
def index(self, limit=None, page=0, count=0, **kw):
|
15 |
latest = c.app.repo.latest(branch=self._branch)
|
15 |
latest = c.app.repo.latest(branch=self._branch)
|
16 |
if not latest:
|
16 |
if not latest:
|
17 |
return dict(allow_fork=False, log=[])
|
17 |
return dict(allow_fork=False, log=[])
|
|
... |
|
... |
19 |
|
19 |
|
20 |
@expose()
|
20 |
@expose()
|
21 |
def _lookup(self, rev, *remainder):
|
21 |
def _lookup(self, rev, *remainder):
|
22 |
return repository.CommitBrowser(rev), remainder
|
22 |
return repository.CommitBrowser(rev), remainder
|
23 |
|
23 |
|
24 |
# from tg import expose, url, override_template, redirect
|
|
|
25 |
# from tg.decorators import with_trailing_slash, without_trailing_slash
|
|
|
26 |
# from pylons import c
|
|
|
27 |
# from webob import exc
|
|
|
28 |
|
|
|
29 |
# from allura.controllers import repository
|
|
|
30 |
# from allura.lib.security import require, has_artifact_access
|
|
|
31 |
|
|
|
32 |
# from .widgets import SVNRevisionWidget, SVNLog
|
|
|
33 |
|
|
|
34 |
# revision_widget = SVNRevisionWidget()
|
|
|
35 |
# log_widget = SVNLog()
|
|
|
36 |
|
|
|
37 |
# def on_import():
|
|
|
38 |
# BranchBrowser.CommitBrowserClass = CommitBrowser
|
|
|
39 |
# # CommitBrowser.TreeBrowserClass = TreeBrowser
|
|
|
40 |
# # TreeBrowser.FileBrowserClass = FileBrowser
|
|
|
41 |
|
|
|
42 |
# class BranchBrowser(repository.BranchBrowser):
|
|
|
43 |
|
|
|
44 |
# def _check_security(self):
|
|
|
45 |
# require(has_artifact_access('read', c.app.repo))
|
|
|
46 |
|
|
|
47 |
# def __init__(self):
|
|
|
48 |
# super(BranchBrowser, self).__init__(None)
|
|
|
49 |
|
|
|
50 |
# @expose('jinja:svn/index.html')
|
|
|
51 |
# @with_trailing_slash
|
|
|
52 |
# def index(self):
|
|
|
53 |
# latest = c.app.repo.latest(branch=None)
|
|
|
54 |
# if not latest:
|
|
|
55 |
# return dict(log=[])
|
|
|
56 |
# redirect(latest.url()+'tree/')
|
|
|
57 |
|
|
|
58 |
# @expose('jinja:svn/log.html')
|
|
|
59 |
# @with_trailing_slash
|
|
|
60 |
# def log(self, limit=None, page=0, count=0, **kw):
|
|
|
61 |
# c.log_widget=log_widget
|
|
|
62 |
# return super(BranchBrowser, self).index(limit, page, count)
|
|
|
63 |
|
|
|
64 |
# @expose()
|
|
|
65 |
# def _lookup(self, rev, *remainder):
|
|
|
66 |
# return CommitBrowser(rev), remainder
|
|
|
67 |
|
|
|
68 |
# class CommitBrowser(repository.CommitBrowser):
|
|
|
69 |
# revision_widget = SVNRevisionWidget()
|
|
|
70 |
|
|
|
71 |
# @expose('jinja:svn/commit.html')
|
|
|
72 |
# @with_trailing_slash
|
|
|
73 |
# def index(self, **kw):
|
|
|
74 |
# result = super(CommitBrowser, self).index()
|
|
|
75 |
# c.revision_widget = revision_widget
|
|
|
76 |
# return result
|
|
|
77 |
|
|
|
78 |
# # class TreeBrowser(repository.TreeBrowser):
|
|
|
79 |
|
|
|
80 |
# # @expose('jinja:svn/tree.html')
|
|
|
81 |
# # @with_trailing_slash
|
|
|
82 |
# # def index(self, **kw):
|
|
|
83 |
# # return super(TreeBrowser, self).index()
|
|
|
84 |
|
|
|
85 |
# # class FileBrowser(repository.FileBrowser):
|
|
|
86 |
|
|
|
87 |
# # @expose('jinja:svn/file.html')
|
|
|
88 |
# # @without_trailing_slash
|
|
|
89 |
# # def index(self, **kw):
|
|
|
90 |
# # if 'diff' in kw:
|
|
|
91 |
# # override_template(self.index, 'jinja:svn/diff.html')
|
|
|
92 |
# # return self.diff(int(kw['diff']))
|
|
|
93 |
# # result = super(FileBrowser, self).index(**kw)
|
|
|
94 |
# # return result
|
|
|
95 |
|
|
|
96 |
# on_import()
|
|
|