From 164d591df18f1c5b32866b5a69020f6b3cf3b40c Mon Sep 17 00:00:00 2001 From: Sascha Silbe Date: Mon, 13 Sep 2010 08:36:05 +0000 Subject: fix ordering for data store with version support When bundling up several versions of the same entry we need to order them based on their relationship, with the base version (empty parent_id) coming first. For now we'll just request them in timestamp order from the data store, instead of performing topological sorting ourselves. In practice this should be good enough. --- diff --git a/backup.py b/backup.py index adab6b5..9360aed 100644 --- a/backup.py +++ b/backup.py @@ -396,7 +396,8 @@ class AsyncBackup(gobject.GObject): """Retrieve a list of all entries from the data store.""" if self._data_store.dbus_interface == DS_DBUS_INTERFACE2: return self._data_store.find({}, {'metadata': - ['tree_id', 'version_id'], 'all_versions': True}, + ['parent_id', 'tree_id', 'version_id'], 'all_versions': True, + 'order_by': ['-timestamp']}, timeout=5*60, byte_arrays=True) else: return self._data_store.find({}, ['uid'], byte_arrays=True) -- cgit v0.9.1