# HG changeset patch # User Marcin Kuzminski # Date 2012-09-06 15:59:45 # Node ID bbaf0b86a1fe516843af3a61c94e1c9537e2aba7 # Parent 3d0bd5f71dabeaaf02915b88fb0b9e798a9a262f Detect symlink in given repository path, and ask user if stored path should be were the symlink points diff --git a/rhodecode/lib/db_manage.py b/rhodecode/lib/db_manage.py --- a/rhodecode/lib/db_manage.py +++ b/rhodecode/lib/db_manage.py @@ -543,7 +543,15 @@ class DbManage(object): retries -= 1 return self.config_prompt(test_repo_path, retries) - return path + real_path = os.path.realpath(path) + + if real_path != path: + if not ask_ok(('Path looks like a symlink, Rhodecode will store ' + 'given path as %s ? [y/n]') % (real_path)): + log.error('Canceled by user') + sys.exit(-1) + + return real_path def create_settings(self, path):