<commit_before>from tg import expose, redirect
from tg.decorators import with_trailing_slash
from pylons import c

from allura.controllers import repository
from allura.lib import helpers as h

class BranchBrowser(repository.BranchBrowser):

    def __init__(self):
        super(BranchBrowser, self).__init__(None)

    @expose('jinja:forgesvn:templates/svn/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 or (latest.object_id.split(':')[1] == '1' and h.has_access(c.app, 'write')()):
            return dict(allow_fork=False, log=[])
        redirect(latest.url() + 'tree/')

    @expose()
    def _lookup(self, rev, *remainder):
        return repository.CommitBrowser(rev), remainder
<commit_msg>[#4382] Fix to work with new scm model.<commit_after>from tg import expose, redirect
from tg.decorators import with_trailing_slash
from pylons import c

from allura.controllers import repository
from allura.lib import helpers as h

class BranchBrowser(repository.BranchBrowser):

    def __init__(self):
        super(BranchBrowser, self).__init__(None)

    @expose('jinja:forgesvn:templates/svn/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 or (latest._id.split(':')[1] == '1' and h.has_access(c.app, 'write')()):
            return dict(allow_fork=False, log=[])
        redirect(latest.url() + 'tree/')

    @expose()
    def _lookup(self, rev, *remainder):
        return repository.CommitBrowser(rev), remainder

{'fraction_non_alphanumeric': 0.12829736211031176, 'fraction_numerical': 0.007194244604316547, 'mean_word_length': 3.9525222551928785, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '949264', 'n_tokens_mistral': 547, 'n_tokens_neox': 535, 'n_words': 129}