diff options
author | drebs <drebs@leap.se> | 2013-01-09 11:46:58 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-01-09 11:46:58 -0200 |
commit | 9b7728b80027f35c013a449b884235cf8eac503c (patch) | |
tree | 70f96686158c9704bf7a17534d03cdde14c6b01c /src/leap/soledad/util.py | |
parent | a59b34f37fb687de77d1a94f41f53a961baad348 (diff) |
CouchDatabase passes u1db LocalDatabaseTests.
Diffstat (limited to 'src/leap/soledad/util.py')
-rw-r--r-- | src/leap/soledad/util.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/leap/soledad/util.py b/src/leap/soledad/util.py index af38cd76..8683fbb9 100644 --- a/src/leap/soledad/util.py +++ b/src/leap/soledad/util.py @@ -149,7 +149,13 @@ class TransactionLog(SimpleLog): cur_gen, _, newest_trans_id = results[0] return cur_gen, newest_trans_id, changes - + + + def get_transaction_log(self): + """ + Return only a list of (doc_id, transaction_id) + """ + return map(lambda x: (x[1], x[2]), sorted(self._log)) class SyncLog(SimpleLog): @@ -182,3 +188,12 @@ class SyncLog(SimpleLog): self.append((other_replica_uid, other_generation, other_transaction_id)) +class ConflictLog(SimpleLog): + """ + A list of (doc_id, my_doc_rev, my_content) tuples. + """ + + def delete_conflicts(self, conflicts): + for conflict in conflicts: + self.log = self.filter(lambda x: + x[0] != conflict[0] or x[1] != conflict[1]) |