Changeset - 7abbb77b02d0
[Not reviewed]
beta
0 7 0
Marcin Kuzminski - 13 years ago 2013-03-20 16:21:34
marcin@python-works.com
Repo size - show just the size without duplicating text
bring back numeric revision into changelog
Fixed tests
7 files changed with 57 insertions and 46 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/summary.py
Show inline comments
 
@@ -189,13 +189,13 @@ class SummaryController(BaseRepoControll
 
        return render('summary/summary.html')
 

	
 
    @NotAnonymous()
 
    @jsonify
 
    def repo_size(self, repo_name):
 
        if request.is_xhr:
 
            return _('repository size: %s') % c.rhodecode_db_repo._repo_size()
 
            return c.rhodecode_db_repo._repo_size()
 
        else:
 
            raise HTTPBadRequest()
 

	
 
    def __get_readme_data(self, db_repo):
 
        repo_name = db_repo.repo_name
 

	
rhodecode/public/css/style.css
Show inline comments
 
@@ -2326,14 +2326,14 @@ h3.files_location {
 

	
 
.tablerow1 {
 
    background-color: #FFFFFF;
 
}
 

	
 
.changeset_id {
 
    font-family: monospace;
 
    color: #666666;
 
    margin-right: -3px;
 
}
 

	
 
.changeset_hash {
 
    color: #000000;
 
}
 

	
 
@@ -2529,13 +2529,13 @@ h3.files_location {
 

	
 
#graph_content .container .author {
 
   width: 105px;
 
}
 

	
 
#graph_content .container .hash {
 
    width: 85px;
 
    width: 100px;
 
    font-size: 0.85em;
 
}
 

	
 
#graph_content #changesets .container .date {
 
    width: 76px;
 
    color: #666;
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -61,12 +61,13 @@ ${self.context_bar('changelog')}
 
                        <td class="author">
 
                            <img alt="gravatar" src="${h.gravatar_url(h.email_or_none(cs.author),16)}"/>
 
                            <span title="${cs.author}" class="user">${h.shorter(h.person(cs.author),22)}</span>
 
                        </td>
 
                        <td class="hash">
 
                            <a href="${h.url('changeset_home',repo_name=c.repo_name,revision=cs.raw_id)}">
 
                                <span class="changeset_id">${cs.revision}:</span>
 
                                <span class="changeset_hash">${h.short_id(cs.raw_id)}</span>
 
                            </a>
 
                        </td>
 
                        <td class="date">
 
                            <div class="date">${h.age(cs.date,True)}</div>
 
                        </td>
rhodecode/tests/__init__.py
Show inline comments
 
@@ -27,12 +27,13 @@ from webtest import TestApp
 
from rhodecode import is_windows
 
from rhodecode.model.meta import Session
 
from rhodecode.model.db import User
 
from rhodecode.tests.nose_parametrized import parameterized
 

	
 
import pylons.test
 
from rhodecode.lib.utils2 import safe_unicode, safe_str
 

	
 

	
 
os.environ['TZ'] = 'UTC'
 
if not is_windows:
 
    time.tzset()
 

	
 
@@ -156,18 +157,18 @@ class TestController(TestCase):
 

	
 
    def _get_logged_user(self):
 
        return User.get_by_username(self._logged_username)
 

	
 
    def checkSessionFlash(self, response, msg):
 
        self.assertTrue('flash' in response.session,
 
                        msg='Response session:%r have no flash' % response.session)
 
                        msg='Response session:%r have no flash'
 
                        % response.session)
 
        if not msg in response.session['flash'][0][1]:
 
            self.fail(
 
                'msg `%s` not found in session flash: got `%s` instead' % (
 
                      msg, response.session['flash'])
 
            )
 
            msg = u'msg `%s` not found in session flash: got `%s` instead' % (
 
                      msg, response.session['flash'][0][1])
 
            self.fail(safe_str(msg))
 

	
 

	
 
## HELPERS ##
 

	
 
def _get_repo_create_params(**custom):
 
    defs = {
rhodecode/tests/functional/test_admin_repos.py
Show inline comments
 
# -*- coding: utf-8 -*-
 

	
 
import os
 
import urllib
 

	
 
from rhodecode.lib import vcs
 

	
 
from rhodecode.model.db import Repository, RepoGroup
 
from rhodecode.tests import *
 
from rhodecode.model.repos_group import ReposGroupModel
 
from rhodecode.model.repo import RepoModel
 

	
 

	
 
@@ -28,13 +29,14 @@ class TestAdminReposController(TestContr
 
        description = 'description for newly created repo'
 
        response = self.app.post(url('repos'),
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_name=repo_name,
 
                                                repo_description=description))
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name))
 
                               'created repository <a href="/%s">%s</a>'
 
                               % (repo_name, repo_name))
 

	
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name)
 
@@ -61,14 +63,14 @@ class TestAdminReposController(TestContr
 
        private = False
 
        response = self.app.post(url('repos'),
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_name=repo_name,
 
                                                repo_description=description))
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name_unicode))
 

	
 
                               u'created repository <a href="/%s">%s</a>'
 
                               % (urllib.quote(repo_name), repo_name_unicode))
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name_unicode).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name_unicode)
 
        self.assertEqual(new_repo.description, description_unicode)
 
@@ -101,14 +103,14 @@ class TestAdminReposController(TestContr
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_name=repo_name,
 
                                                repo_description=description,
 
                                                repo_group=gr.group_id,))
 

	
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name))
 

	
 
                               'created repository <a href="/%s">%s</a>'
 
                               % (repo_name, repo_name))
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name_full).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name_full)
 
        self.assertEqual(new_repo.description, description)
 
@@ -138,13 +140,14 @@ class TestAdminReposController(TestContr
 
        response = self.app.post(url('repos'),
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_type='git',
 
                                                repo_name=repo_name,
 
                                                repo_description=description))
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name))
 
                               'created repository <a href="/%s">%s</a>'
 
                               % (repo_name, repo_name))
 

	
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name)
 
@@ -173,13 +176,14 @@ class TestAdminReposController(TestContr
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_type='git',
 
                                                repo_name=repo_name,
 
                                                repo_description=description))
 

	
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name_unicode))
 
                               u'created repository <a href="/%s">%s</a>'
 
                               % (urllib.quote(repo_name), repo_name_unicode))
 

	
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name_unicode).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name_unicode)
 
@@ -218,14 +222,14 @@ class TestAdminReposController(TestContr
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_type='hg',
 
                                                repo_name=repo_name,
 
                                                repo_description=description))
 

	
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name))
 

	
 
                               'created repository <a href="/%s">%s</a>'
 
                               % (repo_name, repo_name))
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name)
 
        self.assertEqual(new_repo.description, description)
 
@@ -266,14 +270,14 @@ class TestAdminReposController(TestContr
 
                        _get_repo_create_params(repo_private=False,
 
                                                repo_type='git',
 
                                                repo_name=repo_name,
 
                                                repo_description=description))
 

	
 
        self.checkSessionFlash(response,
 
                               'created repository %s' % (repo_name))
 

	
 
                               'created repository <a href="/%s">%s</a>'
 
                               % (repo_name, repo_name))
 
        #test if the repo was created in the database
 
        new_repo = self.Session().query(Repository)\
 
            .filter(Repository.repo_name == repo_name).one()
 

	
 
        self.assertEqual(new_repo.repo_name, repo_name)
 
        self.assertEqual(new_repo.description, description)
rhodecode/tests/functional/test_changelog.py
Show inline comments
 
@@ -5,32 +5,34 @@ class TestChangelogController(TestContro
 

	
 
    def test_index_hg(self):
 
        self.log_user()
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO))
 

	
 
        response.mustcontain("""<div id="chg_20" class="container tablerow1">""")
 
        response.mustcontain('''id="chg_20" class="container tablerow1"''')
 
        response.mustcontain(
 
            """<input class="changeset_range" """
 
            """id="5e204e7583b9c8e7b93a020bd036564b1e731dae" """
 
            """name="5e204e7583b9c8e7b93a020bd036564b1e731dae" """
 
            """type="checkbox" value="1" />"""
 
        )
 
        response.mustcontain(
 
            """<span class="changeset_id">154:"""
 
            """<span class="changeset_hash">5e204e7583b9</span></span>"""
 
            """<span class="changeset_id">154:</span>"""
 
        )
 
        response.mustcontain(
 
            """<span class="changeset_hash">5e204e7583b9</span>"""
 
        )
 

	
 
        response.mustcontain("""Small update at simplevcs app""")
 

	
 
        response.mustcontain(
 
            """<div id="changed_total_5e204e7583b9c8e7b93a020bd036564b1e731dae" """
 
            """style="float:right;" class="changed_total tooltip" """
 
            """title="Affected number of files, click to show """
 
            """more details">3</div>"""
 
        )
 
#        response.mustcontain(
 
#            """<div id="changed_total_5e204e7583b9c8e7b93a020bd036564b1e731dae" """
 
#            """style="float:right;" class="changed_total tooltip" """
 
#            """title="Affected number of files, click to show """
 
#            """more details">3</div>"""
 
#        )
 

	
 
        #pagination
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO), {'page': 1})
 
        response = self.app.get(url(controller='changelog', action='index',
 
                                    repo_name=HG_REPO), {'page': 2})
 
@@ -48,23 +50,25 @@ class TestChangelogController(TestContro
 
            """<input class="changeset_range" """
 
            """id="46ad32a4f974e45472a898c6b0acb600320579b1" """
 
            """name="46ad32a4f974e45472a898c6b0acb600320579b1" """
 
            """type="checkbox" value="1" />"""
 
        )
 
        response.mustcontain(
 
            """<span class="changeset_id">64:"""
 
            """<span class="changeset_hash">46ad32a4f974</span></span>"""
 
            """<span class="changeset_id">64:</span>"""
 
        )
 
        response.mustcontain(
 
            """<span class="changeset_hash">46ad32a4f974</span>"""
 
        )
 

	
 
        response.mustcontain(
 
            """<div id="changed_total_46ad32a4f974e45472a898c6b0acb600320579b1" """
 
            """style="float:right;" class="changed_total tooltip" """
 
            """title="Affected number of files, click to show """
 
            """more details">21</div>"""
 
        )
 

	
 
        response.mustcontain(
 
            """<a href="/%s/changeset/"""
 
            """46ad32a4f974e45472a898c6b0acb600320579b1" """
 
            """title="Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4">"""
 
            """46ad32a4f974</a>""" % HG_REPO
 
        )
 
#        response.mustcontain(
 
#            """<div id="changed_total_46ad32a4f974e45472a898c6b0acb600320579b1" """
 
#            """style="float:right;" class="changed_total tooltip" """
 
#            """title="Affected number of files, click to show """
 
#            """more details">21</div>"""
 
#        )
 
#
 
#        response.mustcontain(
 
#            """<a href="/%s/changeset/"""
 
#            """46ad32a4f974e45472a898c6b0acb600320579b1" """
 
#            """title="Merge with 2e6a2bf9356ca56df08807f4ad86d480da72a8f4">"""
 
#            """46ad32a4f974</a>""" % HG_REPO
 
#        )
rhodecode/tests/functional/test_forks.py
Show inline comments
 
@@ -106,23 +106,24 @@ class TestForksController(TestController
 
        fork_name = HG_FORK
 
        description = 'fork of vcs test'
 
        repo_name = HG_REPO
 
        org_repo = Repository.get_by_repo_name(repo_name)
 
        response = self.app.post(url(controller='forks', action='fork_create',
 
                                    repo_name=repo_name),
 
                                    {'repo_name':fork_name,
 
                                    {'repo_name': fork_name,
 
                                     'repo_group':'',
 
                                     'fork_parent_id':org_repo.repo_id,
 
                                     'repo_type':'hg',
 
                                     'description':description,
 
                                     'private':'False',
 
                                     'landing_rev': 'tip'})
 

	
 
        #test if we have a message that fork is ok
 
        self.checkSessionFlash(response,
 
                'forked %s repository as %s' % (repo_name, fork_name))
 
                'forked repository %s as <a href="/%s">%s</a>'
 
                % (repo_name, fork_name, fork_name))
 

	
 
        #test if the fork was created in the database
 
        fork_repo = Session().query(Repository)\
 
            .filter(Repository.repo_name == fork_name).one()
 

	
 
        self.assertEqual(fork_repo.repo_name, fork_name)
0 comments (0 inline, 0 general)