# HG changeset patch # User Marcin Kuzminski # Date 1357656457 -3600 # Node ID 46234d2d388fc4d019e38accbd8bf714a8476bd2 # Parent 58a4004224a26d49bc236e8afcd606373065140a fixed issues with getting repos by path on windows diff -r 58a4004224a2 -r 46234d2d388f rhodecode/model/db.py --- a/rhodecode/model/db.py Sat Jan 05 03:30:24 2013 +0100 +++ b/rhodecode/model/db.py Tue Jan 08 15:47:37 2013 +0100 @@ -740,6 +740,17 @@ 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 @@ @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 diff -r 58a4004224a2 -r 46234d2d388f rhodecode/model/scm.py --- a/rhodecode/model/scm.py Sat Jan 05 03:30:24 2013 +0100 +++ b/rhodecode/model/scm.py Tue Jan 08 15:47:37 2013 +0100 @@ -230,7 +230,7 @@ # 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: