##// END OF EJS Templates
fixed issues with getting repos by path on windows
marcink -
r3152:46234d2d beta
parent child Browse files
Show More
@@ -740,6 +740,17 b' class Repository(Base, BaseModel):'
740 740 return URL_SEP
741 741
742 742 @classmethod
743 def normalize_repo_name(cls, repo_name):
744 """
745 Normalizes os specific repo_name to the format internally stored inside
746 dabatabase using URL_SEP
747
748 :param cls:
749 :param repo_name:
750 """
751 return cls.url_sep().join(repo_name.split(os.sep))
752
753 @classmethod
743 754 def get_by_repo_name(cls, repo_name):
744 755 q = Session().query(cls).filter(cls.repo_name == repo_name)
745 756 q = q.options(joinedload(Repository.fork))\
@@ -750,6 +761,7 b' class Repository(Base, BaseModel):'
750 761 @classmethod
751 762 def get_by_full_path(cls, repo_full_path):
752 763 repo_name = repo_full_path.split(cls.base_path(), 1)[-1]
764 repo_name = cls.normalize_repo_name(repo_name)
753 765 return cls.get_by_repo_name(repo_name.strip(URL_SEP))
754 766
755 767 @classmethod
@@ -230,7 +230,7 b' class ScmModel(BaseModel):'
230 230
231 231 # name need to be decomposed and put back together using the /
232 232 # since this is internal storage separator for rhodecode
233 name = Repository.url_sep().join(name.split(os.sep))
233 name = Repository.normalize_repo_name(name)
234 234
235 235 try:
236 236 if name in repos:
General Comments 0
You need to be logged in to leave comments. Login now