From c83e48bb2e8ae304f629d7d6ae47fb97b5b325ff Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sun, 13 Dec 2009 20:35:14 -0500 Subject: [PATCH] Check for repo existence before initializing VCS --- libbe/storage/vcs/base.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py index fc3427a..662fc30 100644 --- a/libbe/storage/vcs/base.py +++ b/libbe/storage/vcs/base.py @@ -481,9 +481,9 @@ os.listdir(self.get_path("bugs")): path = os.path.abspath('.') return path - def _vcs_init(self): + def _vcs_init(self, path): """ - Begin versioning the tree based at self.repo. + Begin versioning the tree based at path. """ pass @@ -615,6 +615,8 @@ os.listdir(self.get_path("bugs")): Begin versioning the tree based at self.repo. Also roots the vcs at path. """ + if not os.path.exists(self.repo) or not os.path.isdir(self.repo): + raise VCSUnableToRoot(self) self._vcs_init(self.repo) self.root() os.mkdir(self.be_dir) -- 2.26.2