Changeset - 4c401e37f01d
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-01-31 02:09:50
marcin@python-works.com
fixes issue #747, load changeset cache after forking to refresh lightweight dashboard caches
1 file changed with 1 insertions and 0 deletions:
0 comments (0 inline, 0 general)
rhodecode/lib/celerylib/tasks.py
Show inline comments
 
@@ -412,45 +412,46 @@ def create_repo_fork(form_data, cur_user
 

	
 
    if repo_type == 'git':
 
        r = backend(safe_str(destination_fork_path), create=True,
 
                src_url=safe_str(source_repo_path),
 
                update_after_clone=update_after_clone,
 
                bare=True)
 
        # add rhodecode hook into this repo
 
        ScmModel().install_git_hook(repo=r)
 
    elif repo_type == 'hg':
 
        r = backend(safe_str(destination_fork_path), create=True,
 
                src_url=safe_str(source_repo_path),
 
                update_after_clone=update_after_clone)
 
    else:
 
        raise Exception('Unknown backend type %s' % repo_type)
 

	
 
    log_create_repository(fork_repo.get_dict(), created_by=cur_user.username)
 

	
 
    action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
 
                   fork_of.repo_name, '', DBS)
 

	
 
    action_logger(cur_user, 'user_created_fork:%s' % fork_name,
 
                   fork_name, '', DBS)
 
    # finally commit at latest possible stage
 
    DBS.commit()
 
    fork_repo.update_changeset_cache()
 

	
 

	
 
def __get_codes_stats(repo_name):
 
    from rhodecode.config.conf import  LANGUAGES_EXTENSIONS_MAP
 
    repo = Repository.get_by_repo_name(repo_name).scm_instance
 

	
 
    tip = repo.get_changeset()
 
    code_stats = {}
 

	
 
    def aggregate(cs):
 
        for f in cs[2]:
 
            ext = lower(f.extension)
 
            if ext in LANGUAGES_EXTENSIONS_MAP.keys() and not f.is_binary:
 
                if ext in code_stats:
 
                    code_stats[ext] += 1
 
                else:
 
                    code_stats[ext] = 1
 

	
 
    map(aggregate, tip.walk('/'))
 

	
 
    return code_stats or {}
0 comments (0 inline, 0 general)