# HG changeset patch # User Mads Kiilerich # Date 2013-06-14 14:27:34 # Node ID 4a0bce848ed87f894d94524696c9364762295d3a # Parent b619842f173d09d6becc7726aa934f95bba5e575 changelog: use unknown branch names as revisions Makes the system more resilient diff --git a/rhodecode/controllers/changelog.py b/rhodecode/controllers/changelog.py --- a/rhodecode/controllers/changelog.py +++ b/rhodecode/controllers/changelog.py @@ -136,6 +136,13 @@ class ChangelogController(BaseRepoContro c.size = max(c.size, 1) p = safe_int(request.GET.get('page', 1), 1) branch_name = request.GET.get('branch', None) + if (branch_name and + branch_name not in c.rhodecode_repo.branches and + branch_name not in c.rhodecode_repo.closed_branches and + not revision): + return redirect(url('changelog_file_home', repo_name=c.repo_name, + revision=branch_name, f_path=f_path or '')) + c.changelog_for_path = f_path try: