~dobey/u1db/python-rpath

« back to all changes in this revision

Viewing changes to u1db/sync.py

  • Committer: Tarmac
  • Author(s): Eric Casteleijn
  • Date: 2012-10-09 17:25:33 UTC
  • mfrom: (420.2.3 abort-sync-with-self)
  • Revision ID: tarmac-20121009172533-ijjpxzomsh0s5jvs
Attempting a sync between two databases with the same replica uid will raise an error.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
            self.target_replica_uid = None
107
107
            target_gen, target_trans_id = 0, ''
108
108
            target_my_gen, target_my_trans_id = 0, ''
 
109
 
109
110
            def ensure_callback(replica_uid):
110
111
                self.target_replica_uid = replica_uid
 
112
 
111
113
        else:
112
114
            ensure_callback = None
 
115
        if self.target_replica_uid == self.source._replica_uid:
 
116
            raise errors.InvalidReplicaUID
113
117
        # validate the generation and transaction id the target knows about us
114
118
        self.source.validate_gen_and_trans_id(
115
119
            target_my_gen, target_my_trans_id)