Changeset - 9dc1d92d82ed
[Not reviewed]
beta
0 6 0
Marcin Kuzminski - 15 years ago 2010-11-02 22:26:50
marcin@python-works.com
updated setup for all newest versions
EmptyChangeset can take changeset as creation param.
6 files changed with 31 insertions and 19 deletions:
0 comments (0 inline, 0 general)
README.rst
Show inline comments
 

	
 
RhodeCode (RhodiumCode)
 
=======================
 

	
 
``RhodeCode`` (formerly hg-app) is Pylons based repository management and 
 
serving for mercurial_. It's similar to github or bitbucket, but it's suppose to run
 
as standalone app, it's open source and focuses more on restricted access to repositories
 
There's no default free access to RhodeCode You have to create an account in order
 
to use the application. It's powered by vcs_ library that we created to handle
 
many various version control systems.
 
serving for mercurial_ and git_. It's similar to github or bitbucket, but 
 
it's suppose to run as standalone app, it's open source and focuses more on 
 
restricted access to repositories. There's no default free access to RhodeCode 
 
You have to create an account in order to use the application. It's powered 
 
by vcs_ library that we created to handle many various version control systems.
 

	
 
RhodeCode uses `Semantic Versioning <http://semver.org/>`_
 

	
 

	
 
RhodeCode demo
 
--------------
 

	
 
http://hg.python-works.com
 

	
 
The default access is
rhodecode/controllers/summary.py
Show inline comments
 
@@ -20,15 +20,16 @@
 
"""
 
Created on April 18, 2010
 
summary controller for pylons
 
@author: marcink
 
"""
 
from pylons import tmpl_context as c, request, url
 
from vcs.exceptions import ChangesetError
 
from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
 
from rhodecode.lib.base import BaseController, render
 
from rhodecode.lib.utils import OrderedDict
 
from rhodecode.lib.utils import OrderedDict, EmptyChangeset
 
from rhodecode.model.hg import HgModel
 
from rhodecode.model.db import Statistics
 
from webhelpers.paginate import Page
 
from rhodecode.lib.celerylib import run_task
 
from rhodecode.lib.celerylib.tasks import get_commits_stats
 
from datetime import datetime, timedelta
 
@@ -67,17 +68,23 @@ class SummaryController(BaseController):
 
                                        'host':e.get('HTTP_HOST'),
 
                                        'prefix':e.get('SCRIPT_NAME'),
 
                                        'repo_name':c.repo_name, }
 
        c.clone_repo_url = uri
 
        c.repo_tags = OrderedDict()
 
        for name, hash in c.repo_info.tags.items()[:10]:
 
            c.repo_tags[name] = c.repo_info.get_changeset(hash)
 
            try:
 
                c.repo_tags[name] = c.repo_info.get_changeset(hash)
 
            except ChangesetError:
 
                c.repo_tags[name] = EmptyChangeset(hash)
 

	
 
        c.repo_branches = OrderedDict()
 
        for name, hash in c.repo_info.branches.items()[:10]:
 
            c.repo_branches[name] = c.repo_info.get_changeset(hash)
 
            try:
 
                c.repo_branches[name] = c.repo_info.get_changeset(hash)
 
            except ChangesetError:
 
                c.repo_branches[name] = EmptyChangeset(hash)
 

	
 
        td = datetime.today() + timedelta(days=1)
 
        y, m, d = td.year, td.month, td.day
 

	
 
        ts_min_y = mktime((y - 1, (td - timedelta(days=calendar.mdays[m])).month,
 
                            d, 0, 0, 0, 0, 0, 0,))
rhodecode/lib/helpers.py
Show inline comments
 
@@ -325,14 +325,17 @@ from mercurial import util
 
from mercurial.templatefilters import person as _person
 

	
 

	
 

	
 
def _age(curdate):
 
    """turns a datetime into an age string."""
 
    if not curdate:
 
        return ''
 

	
 
    from datetime import timedelta, datetime
 

	
 
    agescales = [("year", 3600 * 24 * 365),
 
             ("month", 3600 * 24 * 30),
 
             #("week", 3600 * 24 * 7),
 
             ("day", 3600 * 24),
 
             ("hour", 3600),
 
             ("minute", 60),
rhodecode/lib/middleware/simplegit.py
Show inline comments
 
@@ -148,13 +148,13 @@ class SimpleGit(object):
 
        self.repo_path = os.path.join(self.basepath, self.repo_name)
 
        #quick check if that dir exists...
 
        if check_repo_fast(self.repo_name, self.basepath):
 
            return HTTPNotFound()(environ, start_response)
 
        try:
 
            app = self.__make_app()
 
        except Exception:
 
        except:
 
            log.error(traceback.format_exc())
 
            return HTTPInternalServerError()(environ, start_response)
 

	
 
        #invalidate cache on push
 
        if action == 'push':
 
            self.__invalidate_cache(self.repo_name)
rhodecode/lib/utils.py
Show inline comments
 
@@ -293,27 +293,30 @@ def invalidate_cache(name, *args):
 
    if name == 'full_changelog':
 
        from rhodecode.model.hg import _full_changelog_cached
 
        region_invalidate(_full_changelog_cached, None, *args)
 

	
 
class EmptyChangeset(BaseChangeset):
 
    """
 
    An dummy empty changeset.
 
    An dummy empty changeset. It's possible to pass hash when creating
 
    an EmptyChangeset
 
    """
 

	
 
    revision = -1
 
    message = ''
 
    author = ''
 
    date = ''
 
    def __init__(self, cs='0' * 40):
 
        self._empty_cs = cs
 
        self.revision = -1
 
        self.message = ''
 
        self.author = ''
 
        self.date = ''
 

	
 
    @LazyProperty
 
    def raw_id(self):
 
        """
 
        Returns raw string identifying this changeset, useful for web
 
        representation.
 
        """
 
        return '0' * 40
 
        return self._empty_cs
 

	
 
    @LazyProperty
 
    def short_id(self):
 
        return self.raw_id[:12]
 

	
 
    def get_file_changeset(self, path):
setup.py
Show inline comments
 
@@ -3,17 +3,17 @@ import sys
 
py_version = sys.version_info
 

	
 
requirements = [
 
        "Pylons>=1.0.0",
 
        "SQLAlchemy>=0.6.4",
 
        "Mako>=0.3.5",
 
        "vcs==0.1.10",
 
        "vcs>=0.1.10",
 
        "pygments>=1.3.0",
 
        "mercurial==1.6.4",
 
        "whoosh==1.1.1",
 
        "celery==2.1.1",
 
        "whoosh>=1.2.5",
 
        "celery>=2.1.2",
 
        "py-bcrypt",
 
        "babel",
 
    ]
 

	
 
classifiers = ['Development Status :: 4 - Beta',
 
                   'Environment :: Web Environment',
0 comments (0 inline, 0 general)