comparison rhodecode/lib/utils.py @ 3458:0ad025ee005e beta

better detection of deleting groups with subgroups inside. Added less strict checks on delete group routing so we can delete zombie groups (those that are not in filesystem but in DB)
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 05 Mar 2013 22:37:58 +0100
parents 64c194492aad
children e2fad0c6b19a
comparison
equal deleted inserted replaced
3457:08e8115585bd 3458:0ad025ee005e
238 return True 238 return True
239 except VCSError: 239 except VCSError:
240 return False 240 return False
241 241
242 242
243 def is_valid_repos_group(repos_group_name, base_path): 243 def is_valid_repos_group(repos_group_name, base_path, skip_path_check=False):
244 """ 244 """
245 Returns True if given path is a repos group False otherwise 245 Returns True if given path is a repos group False otherwise
246 246
247 :param repo_name: 247 :param repo_name:
248 :param base_path: 248 :param base_path:
261 return False 261 return False
262 except VCSError: 262 except VCSError:
263 pass 263 pass
264 264
265 # check if it's a valid path 265 # check if it's a valid path
266 if os.path.isdir(full_path): 266 if skip_path_check or os.path.isdir(full_path):
267 return True 267 return True
268 268
269 return False 269 return False
270 270
271 271
493 removed.append(repo.repo_name) 493 removed.append(repo.repo_name)
494 except: 494 except:
495 #don't hold further removals on error 495 #don't hold further removals on error
496 log.error(traceback.format_exc()) 496 log.error(traceback.format_exc())
497 sa.rollback() 497 sa.rollback()
498
499 return added, removed 498 return added, removed
500 499
501 500
502 # set cache regions for beaker so celery can utilise it 501 # set cache regions for beaker so celery can utilise it
503 def add_cache(settings): 502 def add_cache(settings):