Parent: [875040] (diff)

Child: [f8649f] (diff)

Download this file

controllers.py    23 lines (17 with data), 723 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
from tg import expose, redirect
from tg.decorators import with_trailing_slash
from pylons import c
from allura.controllers import repository
class BranchBrowser(repository.BranchBrowser):
@expose('jinja:forgegit:templates/git/index.html')
@with_trailing_slash
def index(self, limit=None, page=0, count=0, **kw):
latest = c.app.repo.latest(branch=self._branch)
if not latest:
return dict(allow_fork=False, log=[])
redirect(latest.url() + 'tree/')
class GitRestController(repository.RepoRootController):
@expose('json:')
def index(self, **kw):
all_commits = c.app.repo._impl.new_commits(all_commits=True)
return dict(commit_count=len(all_commits))