diff options
author | W. Trevor King <wking@drexel.edu> | 2010-01-24 20:39:00 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2010-01-24 20:39:00 -0500 |
commit | 7d01fa142b05149479e633525fc4d7ddfa2addf0 (patch) | |
tree | 991e00467e93d810685b62315be1c46f1a956db9 | |
parent | bafb9fe5bb206422aae9baf3d083a035a072fa56 (diff) | |
download | bugseverywhere-7d01fa142b05149479e633525fc4d7ddfa2addf0.tar.gz |
Fixed #bea/8fc# : be crashes on outdated id-cache
Also explicitly avoid loading or saving settings for root comments.
-rw-r--r-- | .be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/8fc5d6fa-cae1-451f-9817-3e4da6d0aac1/values | 2 | ||||
-rw-r--r-- | libbe/comment.py | 4 | ||||
-rw-r--r-- | libbe/storage/vcs/base.py | 6 |
3 files changed, 10 insertions, 2 deletions
diff --git a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/8fc5d6fa-cae1-451f-9817-3e4da6d0aac1/values b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/8fc5d6fa-cae1-451f-9817-3e4da6d0aac1/values index 9fa55b6..28975af 100644 --- a/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/8fc5d6fa-cae1-451f-9817-3e4da6d0aac1/values +++ b/.be/bea86499-824e-4e77-b085-2d581fa9ccab/bugs/8fc5d6fa-cae1-451f-9817-3e4da6d0aac1/values @@ -7,7 +7,7 @@ reporter: W. Trevor King <wking@drexel.edu> severity: minor -status: open +status: fixed summary: be crashes on outdated id-cache diff --git a/libbe/comment.py b/libbe/comment.py index 21118f0..f850042 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -590,6 +590,8 @@ class Comment (Tree, settings_object.SavedSettingsObject): # methods for saving/loading/acessing settings and properties. def load_settings(self, settings_mapfile=None): + if self.uuid == INVALID_UUID: + return if settings_mapfile == None: settings_mapfile = \ self.storage.get(self.id.storage("values"), default="\n") @@ -601,6 +603,8 @@ class Comment (Tree, settings_object.SavedSettingsObject): self._setup_saved_settings(settings) def save_settings(self): + if self.uuid == INVALID_UUID: + return mf = mapfile.generate(self._get_saved_settings()) self.storage.set(self.id.storage("values"), mf) diff --git a/libbe/storage/vcs/base.py b/libbe/storage/vcs/base.py index 7d4383f..7068e46 100644 --- a/libbe/storage/vcs/base.py +++ b/libbe/storage/vcs/base.py @@ -239,7 +239,11 @@ class CachedPathID (object): else: extra = fields[1:] if uuid not in self._cache: - raise InvalidID(uuid) + self.disconnect() + self.init() + self.connect() + if uuid not in self._cache: + raise InvalidID(uuid) if relpath == True: return os.path.join(self._cache[uuid], *extra) return os.path.join(self._root, self._cache[uuid], *extra) |