# HG changeset patch # User Marcin Kuzminski # Date 2013-05-02 11:50:19 # Node ID b95f383f428d40f2671d5d0c96d96ccd02b5e334 # Parent 9c91d3e4a11c5ab985ad2bea0fc1fea52ae57e0b backported redirection loop fix from beta ref: 222e9432298e diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -36,7 +36,8 @@ from rhodecode.lib.base import BaseRepoC from rhodecode.lib.helpers import RepoPage from rhodecode.lib.compat import json from rhodecode.lib.graphmod import _colored, _dagwalker -from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError +from rhodecode.lib.vcs.exceptions import RepositoryError, ChangesetDoesNotExistError,\ + EmptyRepositoryError from rhodecode.lib.utils2 import safe_int log = logging.getLogger(__name__) @@ -80,6 +81,9 @@ class ChangelogController(BaseRepoContro page_revisions = [x.raw_id for x in collection] 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')