# HG changeset patch # User Marcin Kuzminski # Date 2013-04-26 22:40:16 # Node ID 222e9432298e6ae902afbbc85397cc6f7015878a # Parent 63adb3d5233a3d56d5b918ed7a118f1115cba5cb in case of empty directory don't redirect to changelog, it causes an redirection loop diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -37,7 +37,7 @@ from rhodecode.lib.helpers import RepoPa from rhodecode.lib.compat import json from rhodecode.lib.graphmod import _colored, _dagwalker from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError,\ - ChangesetError, NodeDoesNotExistError + ChangesetError, NodeDoesNotExistError, EmptyRepositoryError from rhodecode.lib.utils2 import safe_int from webob.exc import HTTPNotFound @@ -137,6 +137,9 @@ class ChangelogController(BaseRepoContro page_revisions = [x.raw_id for x in c.pagination] c.comments = c.rhodecode_db_repo.get_comments(page_revisions) c.statuses = c.rhodecode_db_repo.statuses(page_revisions) + except (EmptyRepositoryError), e: + h.flash(str(e), category='warning') + return redirect(url('summary_home', repo_name=c.repo_name)) except (RepositoryError, ChangesetDoesNotExistError, Exception), e: log.error(traceback.format_exc()) h.flash(str(e), category='error')