Changeset - ec483ce69ad9
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-11-28 01:34:59
marcin@python-works.com
added global fix for stripping multiple slashes from f_path variable
2 files changed with 4 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/config/routing.py
Show inline comments
 
@@ -29,12 +29,16 @@ def make_map(config):
 
        :param environ:
 
        :param match_dict:
 
        """
 
        from rhodecode.model.db import Repository
 
        repo_name = match_dict.get('repo_name')
 

	
 
        if match_dict.get('f_path'):
 
            #fix for multiple initial slashes that causes errors
 
            match_dict['f_path'] = match_dict['f_path'].lstrip('/')
 

	
 
        try:
 
            by_id = repo_name.split('_')
 
            if len(by_id) == 2 and by_id[1].isdigit() and by_id[0] == '':
 
                repo_name = Repository.get(by_id[1]).repo_name
 
                match_dict['repo_name'] = repo_name
 
        except:
rhodecode/controllers/shortlog.py
Show inline comments
 
@@ -70,13 +70,12 @@ class ShortlogController(BaseRepoControl
 
        def url_generator(**kw):
 
            return url('shortlog_home', repo_name=repo_name, size=size, **kw)
 

	
 
        collection = c.rhodecode_repo
 
        c.file_history = f_path
 
        if f_path:
 
            f_path = f_path.lstrip('/')
 
            # 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 !
0 comments (0 inline, 0 general)