~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: John Arbash Meinel
  • Date: 2009-05-27 08:46:32 UTC
  • mto: (4343.3.25 1.15-gc-stacking)
  • mto: This revision was merged to the branch mainline in revision 4392.
  • Revision ID: john@arbash-meinel.com-20090527084632-jfs47silmrswlgvd
Change the Repository.add_fallback_repository() contract slightly.

So the final statement for fallback repositories is:
1) When transitioning from unlocked => locked, we will lock the fallback repos
2) When transitioning from locked => unlocked, we will unlock the fallback repos
3) If self.is_locked(), add_fallback_repository() will lock the fallback repo,
   which will match (2) when self is finally unlocked.
Callers of add_fallback_repository() maintain their responsibility to match
every lock that they perform with a corresponding unlock.

Show diffs side-by-side

added added

removed removed

Lines of Context:
3177
3177
                    remote_repo.dont_leave_lock_in_place()
3178
3178
            else:
3179
3179
                remote_repo.lock_write()
 
3180
            note('Final stack: %s', final_stack)
 
3181
            mutter('Aquiring fallback: %s', remote_repo)
3180
3182
            policy = UseExistingRepository(remote_repo, final_stack,
3181
3183
                final_stack_pwd, require_stacking)
3182
3184
            policy.acquire_repository()
3475
3477
            stacked_repo = stacked_dir.open_branch().repository
3476
3478
        except errors.NotBranchError:
3477
3479
            stacked_repo = stacked_dir.open_repository()
 
3480
        mutter('stacking on %s', stacked_repo)
3478
3481
        try:
3479
3482
            repository.add_fallback_repository(stacked_repo)
3480
3483
        except errors.UnstackableRepositoryFormat: