# HG changeset patch # User Marcin Kuzminski # Date 2010-11-02 21:26:50 # Node ID 9dc1d92d82ed45e0854c14ecdb5aa59ab09fdadc # Parent 674ecf21de85cedb2436216a03f72cb0cbe3dd73 updated setup for all newest versions EmptyChangeset can take changeset as creation param. diff --git a/README.rst b/README.rst --- a/README.rst +++ b/README.rst @@ -3,15 +3,14 @@ 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 `_ - RhodeCode demo -------------- diff --git a/rhodecode/controllers/summary.py b/rhodecode/controllers/summary.py --- a/rhodecode/controllers/summary.py +++ b/rhodecode/controllers/summary.py @@ -23,9 +23,10 @@ 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 @@ -70,11 +71,17 @@ class SummaryController(BaseController): 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 diff --git a/rhodecode/lib/helpers.py b/rhodecode/lib/helpers.py --- a/rhodecode/lib/helpers.py +++ b/rhodecode/lib/helpers.py @@ -328,8 +328,11 @@ from mercurial.templatefilters import pe 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), diff --git a/rhodecode/lib/middleware/simplegit.py b/rhodecode/lib/middleware/simplegit.py --- a/rhodecode/lib/middleware/simplegit.py +++ b/rhodecode/lib/middleware/simplegit.py @@ -151,7 +151,7 @@ class SimpleGit(object): return HTTPNotFound()(environ, start_response) try: app = self.__make_app() - except Exception: + except: log.error(traceback.format_exc()) return HTTPInternalServerError()(environ, start_response) diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -296,13 +296,16 @@ def invalidate_cache(name, *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): @@ -310,7 +313,7 @@ class EmptyChangeset(BaseChangeset): Returns raw string identifying this changeset, useful for web representation. """ - return '0' * 40 + return self._empty_cs @LazyProperty def short_id(self): diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -6,11 +6,11 @@ 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", ]