Changeset - 6832ef664673
ez_setup.py
Show inline comments
 
@@ -259,18 +259,12 @@ def update_md5(filenames):
 

	
 
    src = src[:match.start(1)] + repl + src[match.end(1):]
 
    f = open(srcfile,'w')
 
    f.write(src)
 
    f.close()
 

	
 

	
 
if __name__=='__main__':
 
    if len(sys.argv)>2 and sys.argv[1]=='--md5update':
 
        update_md5(sys.argv[2:])
 
    else:
 
        main(sys.argv[1:])
 

	
 

	
 

	
 

	
 

	
 

	
rhodecode/config/middleware.py
Show inline comments
 
@@ -67,13 +67,12 @@ def make_app(global_conf, full_stack=Tru
 
    # Establish the Registry for this application
 
    app = RegistryManager(app)
 

	
 
    if asbool(static_files):
 
        # Serve static files
 
        static_app = StaticURLParser(config['pylons.paths']['static_files'])
 
        app = Cascade([static_app, app])
 
        app = make_gzip_middleware(app, global_conf, compress_level=1)
 

	
 
    app.config = config
 

	
 
    return app
 

	
rhodecode/controllers/admin/admin.py
Show inline comments
 
@@ -48,13 +48,12 @@ class AdminController(BaseController):
 

	
 
        users_log = self.sa.query(UserLog)\
 
                .options(joinedload(UserLog.user))\
 
                .options(joinedload(UserLog.repository))\
 
                .order_by(UserLog.action_date.desc())
 

	
 
        p = int(request.params.get('page', 1))
 
        c.users_log = Page(users_log, page=p, items_per_page=10)
 
        c.log_data = render('admin/admin_log.html')
 
        if request.params.get('partial'):
 
            return c.log_data
 
        return render('admin/admin.html')
 

	
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -94,13 +94,12 @@ class ChangelogController(BaseRepoContro
 
        rev_start = repo.revisions.index(repo.revisions[(-1 * offset)])
 
        rev_end = max(0, rev_start - revcount)
 

	
 
        dag = graph_rev(repo._repo, rev_start, rev_end)
 
        c.dag = tree = list(colored(dag))
 
        data = []
 
        for (id, type, ctx, vtx, edges) in tree:
 
            if type != CHANGESET:
 
                continue
 
            data.append(('', vtx, edges))
 

	
 
        c.jsdata = json.dumps(data)
 

	
rhodecode/controllers/error.py
Show inline comments
 
@@ -98,14 +98,12 @@ class ErrorController(BaseController):
 
            code = 500
 

	
 
        if code == 400:
 
            return _('The request could not be understood by the server due to malformed syntax.')
 
        if code == 401:
 
            return _('Unauthorized access to resource')
 
        if code == 403:
 
            return _("You don't have permission to view this page")
 
        if code == 404:
 
            return _('The resource could not be found')
 
        if code == 500:
 
            return _('The server encountered an unexpected condition which prevented it from fulfilling the request.')
 

	
 

	
rhodecode/controllers/files.py
Show inline comments
 
@@ -292,13 +292,12 @@ class FilesController(BaseRepoController
 

	
 
        for name, chs in c.rhodecode_repo.branches.items():
 
            #chs = chs.split(':')[-1]
 
            branches_group[0].append((chs, name),)
 
        hist_l.append(branches_group)
 

	
 
        for name, chs in c.rhodecode_repo.tags.items():
 
            #chs = chs.split(':')[-1]
 
            tags_group[0].append((chs, name),)
 
        hist_l.append(tags_group)
 

	
 
        return hist_l
 

	
rhodecode/controllers/journal.py
Show inline comments
 
@@ -229,20 +229,12 @@ class JournalController(BaseController):
 
            title = "%s - %s %s" % (entry.user.short_contact, action,
 
                                 entry.repository.repo_name)
 
            desc = action_extra()
 
            feed.add_item(title=title,
 
                          pubdate=entry.action_date,
 
                          link=url('', qualified=True),
 
                          author_email=entry.user.email,
 
                          author_name=entry.user.full_contact,
 
                          description=desc)
 

	
 
        response.content_type = feed.mime_type
 
        return feed.writeString('utf-8')
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
rhodecode/lib/backup_manager.py
Show inline comments
 
@@ -95,14 +95,12 @@ class BackupManager(object):
 

	
 

	
 
if __name__ == "__main__":
 
    
 
    repo_location = '/home/repo_path'
 
    backup_server = 'root@192.168.1.100:/backups/mercurial'
 
    rsa_key = '/home/id_rsa'
 
    
 
    B_MANAGER = BackupManager(repo_location, rsa_key, backup_server)
 
    B_MANAGER.backup_repos()
 
    B_MANAGER.transfer_files()
 
    B_MANAGER.rm_file()
 

	
 

	
rhodecode/lib/celerylib/__init__.py
Show inline comments
 
@@ -88,20 +88,12 @@ def locked_task(func):
 
                '-'.join(map(str, params))).hexdigest()
 
        log.info('running task with lockkey %s', lockkey)
 
        try:
 
            l = DaemonLock(lockkey)
 
            ret = func(*fargs, **fkwargs)
 
            l.release()
 
            return ret
 
        except LockHeld:
 
            log.info('LockHeld')
 
            return 'Task with key %s already running' % lockkey
 

	
 
    return decorator(__wrapper, func)
 

	
 

	
 

	
 

	
 

	
 

	
 

	
 

	
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -395,16 +395,12 @@ def __get_codes_stats(repo_name):
 
            ext = f.extension
 
            key = LANGUAGES_EXTENSIONS_MAP.get(ext, ext)
 
            key = key or ext
 
            if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary:
 
                if code_stats.has_key(key):
 
                    code_stats[key] += 1
 
                else:
 
                    code_stats[key] = 1
 

	
 
    map(aggregate, tip.walk('/'))
 

	
 
    return code_stats or {}
 

	
 

	
 

	
 

	
rhodecode/lib/colored_formatter.py
Show inline comments
 
@@ -71,13 +71,12 @@ class ColorFormatterSql(logging.Formatte
 

	
 
    def format(self, record):
 
        """
 
        Changes record's levelname to use with COLORS enum
 
        """
 

	
 
        start = COLOR_SEQ % (COLORS['SQL'])
 
        def_record = format_sql(logging.Formatter.format(self, record))
 
        end = RESET_SEQ
 

	
 
        colored_record = start + def_record + end
 
        return colored_record
 

	
rhodecode/lib/db_manage.py
Show inline comments
 
@@ -507,13 +507,12 @@ class DbManage(object):
 
        default_repo_perm.permission = self.sa.query(Permission)\
 
        .filter(Permission.permission_name == 'repository.read')\
 
        .scalar()
 

	
 
        try:
 
            self.sa.add(reg_perm)
 
            self.sa.add(create_repo_perm)
 
            self.sa.add(default_repo_perm)
 
            self.sa.commit()
 
        except:
 
            self.sa.rollback()
 
            raise
 

	
rhodecode/lib/dbmigrate/migrate/versioning/util/importpath.py
Show inline comments
 
@@ -4,13 +4,12 @@ import sys
 
def import_path(fullpath):
 
    """ Import a file with full path specification. Allows one to
 
        import from anywhere, something __import__ does not do. 
 
    """
 
    # http://zephyrfalcon.org/weblog/arch_d7_2002_08_31.html
 
    path, filename = os.path.split(fullpath)
 
    filename, ext = os.path.splitext(filename)
 
    sys.path.append(path)
 
    module = __import__(filename)
 
    reload(module) # Might be out of date during tests
 
    del sys.path[-1]
 
    return module
 

	
rhodecode/lib/dbmigrate/versions/002_version_1_1_0.py
Show inline comments
 
@@ -104,14 +104,12 @@ def upgrade(migrate_engine):
 
            self.cache_args = cache_args
 
            self.cache_active = False
 

	
 
        def __repr__(self):
 
            return "<CacheInvalidation('%s:%s')>" % (self.cache_id, self.cache_key)
 
    CacheInvalidation().__table__.create()
 

	
 
    return
 

	
 
def downgrade(migrate_engine):
 
    meta = MetaData()
 
    meta.bind = migrate_engine
 

	
 

	
rhodecode/lib/dbmigrate/versions/003_version_1_2_0.py
Show inline comments
 
@@ -87,14 +87,12 @@ def upgrade(migrate_engine):
 

	
 
    clone_uri = Column("clone_uri", String(length=255, convert_unicode=False,
 
                                           assert_unicode=None),
 
                        nullable=True, unique=False, default=None)
 

	
 
    clone_uri.create(Repository().__table__)
 
    return
 

	
 

	
 
def downgrade(migrate_engine):
 
    meta = MetaData()
 
    meta.bind = migrate_engine
 

	
 

	
rhodecode/lib/helpers.py
Show inline comments
 
@@ -629,14 +629,12 @@ def changed_tooltip(nodes):
 

	
 

	
 
def repo_link(groups_and_repos):
 
    groups, repo_name = groups_and_repos
 

	
 
    if not groups:
 
        return repo_name
 
    else:
 
        def make_link(group):
 
            return link_to(group.group_name, url('repos_group', id=group.group_id))
 
        return literal(' &raquo; '.join(map(make_link, groups)) + \
 
                       " &raquo; " + repo_name)
 

	
 

	
rhodecode/lib/hooks.py
Show inline comments
 
@@ -104,13 +104,12 @@ def log_push_action(ui, repo, **kwargs):
 
        else:
 
            return (len(repo) - 1, 0)
 

	
 
    stop, start = get_revs(repo, [node + ':'])
 

	
 
    revs = (str(repo[r]) for r in xrange(start, stop + 1))
 

	
 
    action = action % ','.join(revs)
 

	
 
    action_logger(username, action, repository, extra_params['ip'])
 

	
 
    return 0
 

	
rhodecode/lib/profiler.py
Show inline comments
 
@@ -40,14 +40,12 @@ class ProfilingMiddleware(object):
 
                ## The profiling info is just appended to the response.
 
                ##  Browsers don't mind this.
 
                resp += '<pre style="text-align:left; border-top: 4px dashed red; padding: 1em;">'
 
                resp += cgi.escape(out.getvalue(), True)
 
                
 
                output = StringIO()
 
                pprint.pprint(environ, output, depth=3)
 
                
 
                resp += cgi.escape(output.getvalue(), True)
 
                resp += '</pre>'
 
                
 
            return resp
 
    
 

	
rhodecode/model/db.py
Show inline comments
 
@@ -378,13 +378,12 @@ class CacheInvalidation(Base):
 
        self.cache_active = False
 

	
 
    def __repr__(self):
 
        return "<%s('%s:%s')>" % (self.__class__.__name__,
 
                                  self.cache_id, self.cache_key)
 

	
 
class DbMigrateVersion(Base):
 
    __tablename__ = 'db_migrate_version'
 
    __table_args__ = {'useexisting':True}
 
    repository_id = Column('repository_id', String(250), primary_key=True)
 
    repository_path = Column('repository_path', Text)
 
    version = Column('version', Integer)
 

	
rhodecode/model/scm.py
Show inline comments
 
@@ -401,13 +401,12 @@ class ScmModel(BaseModel):
 
        :param cache_key:
 
        """
 

	
 
        if cache_key:
 
            log.debug('marking %s as already invalidated', cache_key)
 
        try:
 
            cache_key.cache_active = True
 
            self.sa.add(cache_key)
 
            self.sa.commit()
 
        except (DatabaseError,):
 
            log.error(traceback.format_exc())
 
            self.sa.rollback()
 

	
rhodecode/tests/functional/test_files.py
Show inline comments
 
@@ -302,13 +302,12 @@ removed extra unicode conversion in diff
 

	
 

	
 
    def test_raw_wrong_f_path(self):
 
        self.log_user()
 
        rev = '27cd5cce30c96924232dffcd24178a07ffeb5dfc'
 
        f_path = 'vcs/ERRORnodes.py'
 
        response = self.app.get(url(controller='files', action='raw',
 
                                    repo_name=HG_REPO,
 
                                    revision=rev,
 
                                    f_path=f_path))
 

	
 
        assert "There is no file nor directory at the given path: %r at revision %r" % (f_path, rev[:12]) in response.session['flash'][0][1], 'No flash message'
 

	
rhodecode/tests/functional/test_login.py
Show inline comments
 
@@ -219,15 +219,12 @@ class TestLoginController(TestController
 
                                            {'username':username,
 
                                             'password':password,
 
                                             'password_confirmation':password,
 
                                             'email':email,
 
                                             'name':name,
 
                                             'lastname':lastname})
 
        #register new user for email test
 
        response = self.app.post(url(controller='login', action='password_reset'),
 
                                            {'email':email, })
 
        print response.session['flash']
 
        assert 'You have successfully registered into rhodecode' in response.session['flash'][0], 'No flash message about user registration'
 
        assert 'Your new password was sent' in response.session['flash'][1], 'No flash message about password reset'
 

	
 

	
 

	
rhodecode/tests/functional/test_search.py
Show inline comments
 
@@ -24,13 +24,12 @@ class TestSearchController(TestControlle
 
        response = self.app.get(url(controller='search', action='index'), {'q':'def repo'})
 
        print response.body
 
        assert '10 results' in response.body, 'no message about proper search results'
 
        assert 'Permission denied' not in response.body, 'Wrong permissions settings for that repo and user'
 

	
 

	
 
    def test_repo_search(self):
 
        self.log_user()
 
        response = self.app.get(url(controller='search', action='index'), {'q':'repository:%s def test' % HG_REPO})
 
        print response.body
 
        assert '4 results' in response.body, 'no message about proper search results'
 
        assert 'Permission denied' not in response.body, 'Wrong permissions settings for that repo and user'
 

	
rhodecode/tests/functional/test_settings.py
Show inline comments
 
@@ -38,13 +38,12 @@ class TestSettingsController(TestControl
 
        assert fork_repo.fork.repo_name == repo_name, 'wrong fork parrent'
 

	
 

	
 
        #test if fork is visible in the list ?
 
        response = response.follow()
 

	
 

	
 
        #check if fork is marked as fork
 
        response = self.app.get(url(controller='summary', action='index',
 
                                    repo_name=fork_name))
 

	
 
        assert 'Fork of %s' % repo_name in response.body, 'no message about that this repo is a fork'
 

	
rhodecode/tests/functional/test_summary.py
Show inline comments
 
@@ -20,13 +20,12 @@ class TestSummaryController(TestControll
 
        response = self.app.get(url(controller='summary', action='index', repo_name=HG_REPO))
 
        assert """var data = {"Python": 42, "Rst": 11, "Bash": 2, "Makefile": 1, "Batch": 1, "Ini": 1, "Css": 1};""" in response.body, 'wrong info about % of codes stats'
 

	
 
        # clone url...
 
        assert """<input type="text" id="clone_url" readonly="readonly" value="hg clone http://test_admin@localhost:80/%s" size="70"/>""" % HG_REPO in response.body
 

	
 

	
 
    def _enable_stats(self):
 
        r = Repository.by_repo_name(HG_REPO)
 
        r.enable_statistics = True
 
        self.sa.add(r)
 
        self.sa.commit()
 

	
rhodecode/tests/test_hg_operations.py
Show inline comments
 
@@ -319,14 +319,12 @@ if __name__ == '__main__':
 
    create_test_user(force=False)
 
    create_test_repo()
 
    #test_push_modify_file()
 
    #test_clone()
 
    #test_clone_anonymous_ok()
 

	
 
    #test_clone_wrong_credentials()
 

	
 
    #test_pull()
 
    test_push_new_file(commits=15)
 
    #test_push_wrong_path()
 
    #test_push_wrong_credentials()
 

	
 

	
rhodecode/websetup.py
Show inline comments
 
@@ -38,17 +38,12 @@ def setup_app(command, conf, vars):
 
    """Place any commands to setup rhodecode here"""
 
    dbconf = conf['sqlalchemy.db1.url']
 
    dbmanage = DbManage(log_sql=True, dbconf=dbconf, root=conf['here'], tests=False)
 
    dbmanage.create_tables(override=True)
 
    dbmanage.set_db_version()
 
    dbmanage.create_settings(dbmanage.config_prompt(None))
 
    dbmanage.create_default_user()
 
    dbmanage.admin_prompt()
 
    dbmanage.create_permissions()
 
    dbmanage.populate_default_permissions()
 

	
 
    load_environment(conf.global_conf, conf.local_conf, initial=True)
 

	
 

	
 

	
 

	
 

	
0 comments (0 inline, 0 general)