~ubuntuone-control-tower/u1db/trunk

« back to all changes in this revision

Viewing changes to u1db/__init__.py

  • Committer: Tarmac
  • Author(s): Eric Casteleijn, Samuele Pedroni (Canonical Services Ltd.)
  • Date: 2012-07-05 15:56:23 UTC
  • mfrom: (327.4.19 sync_integration_tests)
  • Revision ID: tarmac-20120705155623-s58zcpgng2083hjh
Added integration tests for the detection of a diverged source or target db during sync and made them pass.

Show diffs side-by-side

added added

removed removed

Lines of Context:
565
565
        raise NotImplementedError(self.record_sync_info)
566
566
 
567
567
    def sync_exchange(self, docs_by_generation, source_replica_uid,
568
 
                      last_known_generation, return_doc_cb):
 
568
                      last_known_generation, last_known_trans_id,
 
569
                      return_doc_cb):
569
570
        """Incorporate the documents sent from the source replica.
570
571
 
571
572
        This is not meant to be called by client code directly, but is used as
589
590
            id of their latest change.
590
591
        :param source_replica_uid: The source replica's identifier
591
592
        :param last_known_generation: The last generation that the source
592
 
            replica knows about this
 
593
            replica knows about this target replica
 
594
        :param last_known_trans_id: The last transaction id that the source
 
595
            replica knows about this target replica
593
596
        :param: return_doc_cb(doc, gen): is a callback
594
597
                used to return documents to the source replica, it will
595
598
                be invoked in turn with Documents that have changed since