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.
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:
def remove_bug(self, bug):
self.remove(bug)
- bug.remove()
+ if bug.sync_with_disk == True:
+ bug.remove()
def bug_shortname(self, bug):
"""
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()
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)
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:
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