##// END OF EJS Templates
fixes #126, all credits go to cejones <chad.jones@milwaukeetool.com>
marcink -
r1119:143b37b7 beta
parent child Browse files
Show More
@@ -216,7 +216,8 class RepoModel(BaseModel):
216 #create default permission
216 #create default permission
217 repo_to_perm = RepoToPerm()
217 repo_to_perm = RepoToPerm()
218 default = 'repository.read'
218 default = 'repository.read'
219 for p in UserModel(self.sa).get_by_username('default', cache=False).user_perms:
219 for p in UserModel(self.sa).get_by_username('default',
220 cache=False).user_perms:
220 if p.permission.permission_name.startswith('repository.'):
221 if p.permission.permission_name.startswith('repository.'):
221 default = p.permission.permission_name
222 default = p.permission.permission_name
222 break
223 break
@@ -303,6 +304,7 class RepoModel(BaseModel):
303 def __create_repo(self, repo_name, alias, clone_uri=False):
304 def __create_repo(self, repo_name, alias, clone_uri=False):
304 """
305 """
305 makes repository on filesystem
306 makes repository on filesystem
307
306 :param repo_name:
308 :param repo_name:
307 :param alias:
309 :param alias:
308 """
310 """
@@ -317,6 +319,7 class RepoModel(BaseModel):
317 def __rename_repo(self, old, new):
319 def __rename_repo(self, old, new):
318 """
320 """
319 renames repository on filesystem
321 renames repository on filesystem
322
320 :param old: old name
323 :param old: old name
321 :param new: new name
324 :param new: new name
322 """
325 """
@@ -335,6 +338,7 class RepoModel(BaseModel):
335 added rm__ prefix into dir, and rename internat .hg/.git dirs so this
338 added rm__ prefix into dir, and rename internat .hg/.git dirs so this
336 repository is no longer valid for rhodecode, can be undeleted later on
339 repository is no longer valid for rhodecode, can be undeleted later on
337 by reverting the renames on this repository
340 by reverting the renames on this repository
341
338 :param repo: repo object
342 :param repo: repo object
339 """
343 """
340 rm_path = os.path.join(self.repos_path, repo.repo_name)
344 rm_path = os.path.join(self.repos_path, repo.repo_name)
@@ -345,5 +349,6 class RepoModel(BaseModel):
345 os.path.join(rm_path, 'rm__.%s' % alias))
349 os.path.join(rm_path, 'rm__.%s' % alias))
346 #disable repo
350 #disable repo
347 shutil.move(rm_path, os.path.join(self.repos_path, 'rm__%s__%s' \
351 shutil.move(rm_path, os.path.join(self.repos_path, 'rm__%s__%s' \
348 % (datetime.today().isoformat(),
352 % (datetime.today()\
349 repo.repo_name)))
353 .strftime('%Y%m%d_%H%M%S_%f'),
354 repo.repo_name)))
General Comments 0
You need to be logged in to leave comments. Login now