Changeset - 4a0bce848ed8
[Not reviewed]
default
0 1 0
Mads Kiilerich - 12 years ago 2013-06-14 16:27:34
madski@unity3d.com
Grafted from: a0c471218d07
changelog: use unknown branch names as revisions

Makes the system more resilient
1 file changed with 7 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/changelog.py
Show inline comments
 
@@ -127,24 +127,31 @@ class ChangelogController(BaseRepoContro
 
        limit = 100
 
        default = 20
 
        if request.GET.get('size'):
 
            c.size = max(min(safe_int(request.GET.get('size')), limit), 1)
 
            session['changelog_size'] = c.size
 
            session.save()
 
        else:
 
            c.size = int(session.get('changelog_size', default))
 
        # min size must be 1
 
        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:
 

	
 
            if f_path:
 
                log.debug('generating changelog for path %s' % f_path)
 
                # get the history for the file !
 
                tip_cs = c.rhodecode_repo.get_changeset()
 
                try:
 
                    collection = tip_cs.get_file_history(f_path)
 
                except (NodeDoesNotExistError, ChangesetError):
 
                    #this node is not present at tip !
 
                    try:
0 comments (0 inline, 0 general)