Raise exceptions if bug or comment value files are missing.
authorW. Trevor King <wking@drexel.edu>
Sun, 17 Apr 2011 01:01:53 +0000 (21:01 -0400)
committerW. Trevor King <wking@drexel.edu>
Sun, 17 Apr 2011 01:07:48 +0000 (21:07 -0400)
This happens most often when a previous crash leaves an empty
directory `abc` in .be/.../bugs/abc/ or
.be/.../bugs/.../comments/abc/.  The new exception ensures the error
message is "Bug/Comment X missing value file" which tells you where to
look for the repository corruption not "summary is None" which told
you nothing.

libbe/bug.py
libbe/comment.py

index bbe698020c148033aa14761a9b149826fb51ef4a..71682d5893d25cdf200a8ee01dc17e46f9acf531 100644 (file)
@@ -641,8 +641,7 @@ class Bug (settings_object.SavedSettingsObject):
 
     def load_settings(self, settings_mapfile=None):
         if settings_mapfile == None:
-            settings_mapfile = \
-                self.storage.get(self.id.storage('values'), default='\n')
+            settings_mapfile = self.storage.get(self.id.storage('values'))
         try:
             settings = mapfile.parse(settings_mapfile)
         except mapfile.InvalidMapfileContents, e:
index 8ffb3cdd0594825b9fdc4542ba564c23579be566..081ba592fb7ad18cbee8fb3b759adeb9304ccfbb 100644 (file)
@@ -611,8 +611,7 @@ class Comment (Tree, settings_object.SavedSettingsObject):
         if self.uuid == INVALID_UUID:
             return
         if settings_mapfile == None:
-            settings_mapfile = \
-                self.storage.get(self.id.storage("values"), default="\n")
+            settings_mapfile = self.storage.get(self.id.storage('values'))
         try:
             settings = mapfile.parse(settings_mapfile)
         except mapfile.InvalidMapfileContents, e: