Check for repo existence before initializing VCS
authorW. Trevor King <wking@drexel.edu>
Mon, 14 Dec 2009 01:35:14 +0000 (20:35 -0500)
committerW. Trevor King <wking@drexel.edu>
Mon, 14 Dec 2009 01:35:14 +0000 (20:35 -0500)
libbe/storage/vcs/base.py

index fc3427a75df0508a1a2ea23b4e24976dc1e9bd8b..662fc30f11121faede06bbf92050268f93d1c650 100644 (file)
@@ -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)