/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/repofmt/knitrepo.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-03-16 08:26:29 UTC
  • mfrom: (4145.1.6 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090316082629-xuzqut3b3ur5bn3b
(robertc) Add a new repository method refresh_data to allow clean
        handling of _real_repositories after inserting a stream via the
        smart server. (Robert Collins, Andrew Bennetts)

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."""