##// END OF EJS Templates
fixes #245 Rescan of the repositories on Windows
marcink -
r1554:e7c6341a beta
parent child Browse files
Show More
@@ -503,6 +503,10 b' class Repository(Base, BaseModel):'
503 503 self.repo_id, self.repo_name)
504 504
505 505 @classmethod
506 def url_sep(cls):
507 return '/'
508
509 @classmethod
506 510 def get_by_repo_name(cls, repo_name):
507 511 q = Session.query(cls).filter(cls.repo_name == repo_name)
508 512
@@ -523,7 +527,8 b' class Repository(Base, BaseModel):'
523 527
524 528 :param cls:
525 529 """
526 q = Session.query(RhodeCodeUi).filter(RhodeCodeUi.ui_key == '/')
530 q = Session.query(RhodeCodeUi).filter(RhodeCodeUi.ui_key ==
531 cls.url_sep())
527 532 q.options(FromCache("sql_cache_short", "repository_repo_path"))
528 533 return q.one().ui_value
529 534
@@ -558,7 +563,8 b' class Repository(Base, BaseModel):'
558 563 Returns base full path for that repository means where it actually
559 564 exists on a filesystem
560 565 """
561 q = Session.query(RhodeCodeUi).filter(RhodeCodeUi.ui_key == '/')
566 q = Session.query(RhodeCodeUi).filter(RhodeCodeUi.ui_key ==
567 Repository.url_sep())
562 568 q.options(FromCache("sql_cache_short", "repository_repo_path"))
563 569 return q.one().ui_value
564 570
@@ -568,7 +574,7 b' class Repository(Base, BaseModel):'
568 574 # we need to split the name by / since this is how we store the
569 575 # names in the database, but that eventually needs to be converted
570 576 # into a valid system path
571 p += self.repo_name.split('/')
577 p += self.repo_name.split(Repository.url_sep())
572 578 return os.path.join(*p)
573 579
574 580 def get_new_name(self, repo_name):
@@ -578,7 +584,7 b' class Repository(Base, BaseModel):'
578 584 :param group_name:
579 585 """
580 586 path_prefix = self.group.full_path_splitted if self.group else []
581 return '/'.join(path_prefix + [repo_name])
587 return Repository.url_sep().join(path_prefix + [repo_name])
582 588
583 589 @property
584 590 def _ui(self):
@@ -22,6 +22,7 b''
22 22 #
23 23 # You should have received a copy of the GNU General Public License
24 24 # along with this program. If not, see <http://www.gnu.org/licenses/>.
25 import os
25 26 import time
26 27 import traceback
27 28 import logging
@@ -146,10 +147,15 b' class ScmModel(BaseModel):'
146 147 repos_list = {}
147 148
148 149 for name, path in get_filesystem_repos(repos_path, recursive=True):
150
151 # name need to be decomposed and put back together using the /
152 # since this is internal storage separator for rhodecode
153 name = Repository.url_sep().join(name.split(os.sep))
154
149 155 try:
150 156 if name in repos_list:
151 157 raise RepositoryError('Duplicate repository name %s '
152 'found in %s' % (name, path))
158 'found in %s' % (name, path))
153 159 else:
154 160
155 161 klass = get_backend(path[0])
General Comments 0
You need to be logged in to leave comments. Login now