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
 
@@ -192,7 +192,7 @@ class SummaryController(BaseRepoControll
 
    @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()
 

	
rhodecode/public/css/style.css
Show inline comments
 
@@ -2329,8 +2329,8 @@ h3.files_location {
 
}
 

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

	
 
.changeset_hash {
 
@@ -2532,7 +2532,7 @@ h3.files_location {
 
}
 

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

	
rhodecode/templates/changelog/changelog.html
Show inline comments
 
@@ -64,6 +64,7 @@ ${self.context_bar('changelog')}
 
                        </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>
rhodecode/tests/__init__.py
Show inline comments
 
@@ -30,6 +30,7 @@ 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'
 
@@ -159,12 +160,12 @@ class TestController(TestCase):
 

	
 
    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 ##
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
 
@@ -31,7 +32,8 @@ class TestAdminReposController(TestContr
 
                                                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)\
 
@@ -64,8 +66,8 @@ class TestAdminReposController(TestContr
 
                                                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()
 
@@ -104,8 +106,8 @@ class TestAdminReposController(TestContr
 
                                                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()
 
@@ -141,7 +143,8 @@ class TestAdminReposController(TestContr
 
                                                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)\
 
@@ -176,7 +179,8 @@ class TestAdminReposController(TestContr
 
                                                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)\
 
@@ -221,8 +225,8 @@ class TestAdminReposController(TestContr
 
                                                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()
 
@@ -269,8 +273,8 @@ class TestAdminReposController(TestContr
 
                                                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()
rhodecode/tests/functional/test_changelog.py
Show inline comments
 
@@ -8,7 +8,7 @@ class TestChangelogController(TestContro
 
        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" """
 
@@ -16,18 +16,20 @@ class TestChangelogController(TestContro
 
            """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',
 
@@ -51,20 +53,22 @@ class TestChangelogController(TestContro
 
            """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
 
@@ -109,7 +109,7 @@ class TestForksController(TestController
 
        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',
 
@@ -119,7 +119,8 @@ class TestForksController(TestController
 

	
 
        #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)\
0 comments (0 inline, 0 general)