Changeset - 46234d2d388f
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2013-01-08 15:47:37
marcin@python-works.com
fixed issues with getting repos by path on windows
2 files changed with 13 insertions and 1 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/db.py
Show inline comments
 
@@ -740,6 +740,17 @@ class Repository(Base, BaseModel):
 
        return URL_SEP
 

	
 
    @classmethod
 
    def normalize_repo_name(cls, repo_name):
 
        """
 
        Normalizes os specific repo_name to the format internally stored inside
 
        dabatabase using URL_SEP
 

	
 
        :param cls:
 
        :param repo_name:
 
        """
 
        return cls.url_sep().join(repo_name.split(os.sep))
 

	
 
    @classmethod
 
    def get_by_repo_name(cls, repo_name):
 
        q = Session().query(cls).filter(cls.repo_name == repo_name)
 
        q = q.options(joinedload(Repository.fork))\
 
@@ -750,6 +761,7 @@ class Repository(Base, BaseModel):
 
    @classmethod
 
    def get_by_full_path(cls, repo_full_path):
 
        repo_name = repo_full_path.split(cls.base_path(), 1)[-1]
 
        repo_name = cls.normalize_repo_name(repo_name)
 
        return cls.get_by_repo_name(repo_name.strip(URL_SEP))
 

	
 
    @classmethod
rhodecode/model/scm.py
Show inline comments
 
@@ -230,7 +230,7 @@ class ScmModel(BaseModel):
 

	
 
            # name need to be decomposed and put back together using the /
 
            # since this is internal storage separator for rhodecode
 
            name = Repository.url_sep().join(name.split(os.sep))
 
            name = Repository.normalize_repo_name(name)
 

	
 
            try:
 
                if name in repos:
0 comments (0 inline, 0 general)