summaryrefslogtreecommitdiff
path: root/util.py
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-01-09 11:46:58 -0200
committerdrebs <drebs@leap.se>2013-01-09 11:46:58 -0200
commit8e32fdb0be5d34c6554a8c0f75bdf8bf0debcd4a (patch)
treed3b26ee128674b1484db12f7f421facb8724f676 /util.py
parent11d4d9ece76260639d2c2815b694d6cd68109965 (diff)
CouchDatabase passes u1db LocalDatabaseTests.
Diffstat (limited to 'util.py')
-rw-r--r--util.py17
1 files changed, 16 insertions, 1 deletions
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])