~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Robert Collins
  • Date: 2009-03-16 05:05:52 UTC
  • mto: This revision was merged to the branch mainline in revision 4149.
  • Revision ID: robertc@robertcollins.net-20090316050552-hqcgx49ugew0facc
Add a refresh_data method on Repository allowing cleaner handling of insertions into RemoteRepository objects with _real_repository instances.

Show diffs side-by-side

added added

removed removed

Lines of Context:
213
213
        revision_id = osutils.safe_revision_id(revision_id)
214
214
        return self.get_revision_reconcile(revision_id)
215
215
 
 
216
    def _refresh_data(self):
 
217
        if not self.is_locked():
 
218
            return
 
219
        # Create a new transaction to force all knits to see the scope change.
 
220
        # This is safe because we're outside a write group.
 
221
        self.control_files._finish_transaction()
 
222
        if self.is_write_locked():
 
223
            self.control_files._set_write_transaction()
 
224
        else:
 
225
            self.control_files._set_read_transaction()
 
226
 
216
227
    @needs_write_lock
217
228
    def reconcile(self, other=None, thorough=False):
218
229
        """Reconcile this repository."""