aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/bug.py
diff options
context:
space:
mode:
Diffstat (limited to 'libbe/bug.py')
-rw-r--r--libbe/bug.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/libbe/bug.py b/libbe/bug.py
index 8be6010..e3dc1e0 100644
--- a/libbe/bug.py
+++ b/libbe/bug.py
@@ -252,6 +252,11 @@ class Bug(settings_object.SavedSettingsObject):
def __repr__(self):
return "Bug(uuid=%r)" % self.uuid
+ def set_sync_with_disk(self, value):
+ self.sync_with_disk = value
+ for comment in self.comments():
+ comment.set_sync_with_disk(value)
+
def _setting_attr_string(self, setting):
value = getattr(self, setting)
if value == None:
@@ -371,10 +376,17 @@ class Bug(settings_object.SavedSettingsObject):
mapfile.map_save(self.rcs, path, self._get_saved_settings())
def save(self):
+ """
+ Save any loaded contents to disk. Because of lazy loading of
+ comments, this is actually not too inefficient.
+
+ However, if self.sync_with_disk = True, then any changes are
+ automatically written to disk as soon as they happen, so
+ calling this method will just waste time (unless something
+ else has been messing with your on-disk files).
+ """
self.save_settings()
-
if len(self.comment_root) > 0:
- self.rcs.mkdir(self.get_path("comments"))
comment.saveComments(self)
def remove(self):