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 | 8e32fdb0be5d34c6554a8c0f75bdf8bf0debcd4a (patch) | |
tree | d3b26ee128674b1484db12f7f421facb8724f676 /util.py | |
parent | 11d4d9ece76260639d2c2815b694d6cd68109965 (diff) |
CouchDatabase passes u1db LocalDatabaseTests.
Diffstat (limited to 'util.py')
-rw-r--r-- | util.py | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -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]) |