# HG changeset patch # User Marcin Kuzminski # Date 2012-07-20 10:52:28 # Node ID d6fa7805e687e7e96d97e705ab4d4f31a05e74d3 # Parent 4b17216f21106d6e559f123925d1eb9336fa4466 we must rollback if repo2db mapper cleanup fails ! Session blows up, and that code still throws an error without it diff --git a/rhodecode/lib/utils.py b/rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py +++ b/rhodecode/lib/utils.py @@ -479,7 +479,7 @@ def repo2db_mapper(initial_repo_list, re # remove from database those repositories that are not in the filesystem for repo in sa.query(Repository).all(): if repo.repo_name not in initial_repo_list.keys(): - log.debug("Removing non existing repository found in db %s" % + log.debug("Removing non existing repository found in db `%s`" % repo.repo_name) try: sa.delete(repo) @@ -488,6 +488,7 @@ def repo2db_mapper(initial_repo_list, re except: #don't hold further removals on error log.error(traceback.format_exc()) + sa.rollback() # clear cache keys log.debug("Clearing cache keys now...")