aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libbe/bugdir.py9
-rw-r--r--libbe/comment.py3
2 files changed, 8 insertions, 4 deletions
diff --git a/libbe/bugdir.py b/libbe/bugdir.py
index 7380172..e9854c9 100644
--- a/libbe/bugdir.py
+++ b/libbe/bugdir.py
@@ -352,6 +352,8 @@ settings easy. Don't set this attribute. Set .rcs instead, and
new_rcs.init(self.root)
return new_rcs
+ # methods for saving/loading/accessing settings and properties.
+
def get_path(self, *args):
"""
Return a path relative to .root.
@@ -362,8 +364,6 @@ settings easy. Don't set this attribute. Set .rcs instead, and
assert args[0] in ["version", "settings", "bugs"], str(args)
return os.path.join(my_dir, *args)
- # methods for saving/loading/accessing settings and properties.
-
def _get_settings(self, settings_path, for_duplicate_bugdir=False):
allow_no_rcs = not self.rcs.path_in_root(settings_path)
if allow_no_rcs == True:
@@ -556,7 +556,8 @@ settings easy. Don't set this attribute. Set .rcs instead, and
def remove_bug(self, bug):
self.remove(bug)
- bug.remove()
+ if bug.sync_with_disk == True:
+ bug.remove()
def bug_shortname(self, bug):
"""
@@ -763,6 +764,7 @@ class SimpleBugDirTestCase (unittest.TestCase):
def testOnDiskCleanLoad(self):
"""simple_bug_dir(sync_with_disk==True) should not import preexisting bugs."""
bugdir = simple_bug_dir(sync_with_disk=True)
+ self.failUnless(bugdir.sync_with_disk==True, bugdir.sync_with_disk)
uuids = sorted([bug.uuid for bug in bugdir])
self.failUnless(uuids == ['a', 'b'], uuids)
bugdir._clear_bugs()
@@ -774,6 +776,7 @@ class SimpleBugDirTestCase (unittest.TestCase):
def testInMemoryCleanLoad(self):
"""simple_bug_dir(sync_with_disk==False) should not import preexisting bugs."""
bugdir = simple_bug_dir(sync_with_disk=False)
+ self.failUnless(bugdir.sync_with_disk==False, bugdir.sync_with_disk)
uuids = sorted([bug.uuid for bug in bugdir])
self.failUnless(uuids == ['a', 'b'], uuids)
self.failUnlessRaises(DiskAccessRequired, bugdir.load_all_bugs)
diff --git a/libbe/comment.py b/libbe/comment.py
index 20dab7e..7b43c08 100644
--- a/libbe/comment.py
+++ b/libbe/comment.py
@@ -551,7 +551,7 @@ class Comment(Tree, settings_object.SavedSettingsObject):
return os.path.join(my_dir, name)
def set_sync_with_disk(self, value):
- self.sync_with_disk = True
+ self.sync_with_disk = value
def load_settings(self):
if self.sync_with_disk == False:
@@ -608,6 +608,7 @@ class Comment(Tree, settings_object.SavedSettingsObject):
if self.bug != None:
reply.set_sync_with_disk(self.bug.sync_with_disk)
if reply.sync_with_disk == True:
+ raise Exception, self.bug.sync_with_disk
reply.save()
self.add_reply(reply)
return reply