diff options
author | W. Trevor King <wking@drexel.edu> | 2009-12-14 03:29:20 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-12-14 03:29:20 -0500 |
commit | 2f0ceedba5b6619faf476cd1aa67e826e91d5c7c (patch) | |
tree | 09fa80c735c20a40e466b5139a878038bd46b33c /libbe/storage | |
parent | 1bec5c0d3880a1cd848d765365104e221f390e71 (diff) | |
download | bugseverywhere-2f0ceedba5b6619faf476cd1aa67e826e91d5c7c.tar.gz |
Transitioned init to Command format
Diffstat (limited to 'libbe/storage')
-rw-r--r-- | libbe/storage/vcs/base.py | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py index a765a80..9ea38d3 100644 --- a/libbe/storage/vcs/base.py +++ b/libbe/storage/vcs/base.py @@ -629,7 +629,8 @@ os.listdir(self.get_path("bugs")): """ if not os.path.exists(self.repo) or not os.path.isdir(self.repo): raise VCSUnableToRoot(self) - self._vcs_init(self.repo) + if self._vcs_detect(self.repo) == False: + self._vcs_init(self.repo) self.root() os.mkdir(self.be_dir) self._vcs_add(self._u_rel_path(self.be_dir)) @@ -644,6 +645,8 @@ os.listdir(self.get_path("bugs")): def _connect(self): if self._rooted == False: self.root() + if not os.path.isdir(self.be_dir): + raise libbe.storage.base.ConnectionError(self) self._cached_path_id.connect() self.check_disk_version() @@ -732,9 +735,8 @@ os.listdir(self.get_path("bugs")): return default relpath = self._u_rel_path(path) contents = self._vcs_get_file_contents(relpath,revision) - if contents == libbe.storage.base.InvalidDirectory: - raise libbe.storage.base.InvalidDirectory(id) - elif contents == libbe.util.InvalidObject: + if contents in [libbe.storage.base.InvalidDirectory, + libbe.util.InvalidObject]: raise libbe.storage.base.InvalidID(id) elif len(contents) == 0: return None |