# HG changeset patch # User Marcin Kuzminski # Date 1342781548 -7200 # 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 -r 4b17216f2110 -r d6fa7805e687 rhodecode/lib/utils.py --- a/rhodecode/lib/utils.py Fri Jul 20 12:05:32 2012 +0200 +++ b/rhodecode/lib/utils.py Fri Jul 20 12:52:28 2012 +0200 @@ -479,7 +479,7 @@ # 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 @@ except: #don't hold further removals on error log.error(traceback.format_exc()) + sa.rollback() # clear cache keys log.debug("Clearing cache keys now...")