Preserve collection flags during store restore
Debian Trixie package bundle / packages (push) Has been cancelled

This commit is contained in:
Mario Fetka
2026-07-23 15:16:46 +02:00
parent 2d27c7da0a
commit f051f4acd6
3 changed files with 16 additions and 1 deletions
@@ -245,6 +245,7 @@ class StoreRestoreCommand(Command):
metadata = member.pax_headers
store.Create(
name, guid=metadata.get("BONGO.uid", ""),
flags=int(metadata["BONGO.flags"]),
existingOk=True)
self.RestoreProps(store, name, metadata)
@@ -79,6 +79,18 @@ class Python3RuntimeTests(unittest.TestCase):
"alice", "alice-store", host="store.example.test", port=1689,
authPassword="secret")
def test_create_can_restore_collection_flags(self):
client = StoreClient.__new__(StoreClient)
client.stream = _Stream([_Response(1000)])
client.Create(
"/mail/sent", guid="0000000000000010", flags=128,
existingOk=True)
self.assertEqual(
client.stream.lines,
["CREATE /mail/sent 0000000000000010 128"])
def test_calendar_import_splits_events_and_normalizes_collection_names(self):
import vobject
+3 -1
View File
@@ -428,8 +428,10 @@ class StoreClient:
self.stream.log.debug("READ: 1000 ****************")
return r.message
def Create(self, path, guid="", existingOk=False):
def Create(self, path, guid="", flags=None, existingOk=False):
command = "CREATE %s %s" % (path, guid)
if flags is not None:
command = command + " %d" % int(flags)
self.stream.Write(command)
r = self.stream.GetResponse()