From 8e32fdb0be5d34c6554a8c0f75bdf8bf0debcd4a Mon Sep 17 00:00:00 2001 From: drebs Date: Wed, 9 Jan 2013 11:46:58 -0200 Subject: CouchDatabase passes u1db LocalDatabaseTests. --- util.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'util.py') diff --git a/util.py b/util.py index af38cd76..8683fbb9 100644 --- a/util.py +++ b/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]) -- cgit v1.2.3