/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/branch.py

  • Committer: Andrew Bennetts
  • Date: 2010-06-30 08:34:11 UTC
  • mto: This revision was merged to the branch mainline in revision 5328.
  • Revision ID: andrew.bennetts@canonical.com-20100630083411-9b20zh6z09858n9o
Improve comments.

Show diffs side-by-side

added added

removed removed

Lines of Context:
815
815
                raise AssertionError("didn't expect %r to have "
816
816
                    "fallback_repositories"
817
817
                    % (self.repository,))
818
 
            # Do our best to transfer the lock state  (i.e. lock-tokens and
 
818
            # Replace self.repository with the new repository.
 
819
            # Do our best to transfer the lock state (i.e. lock-tokens and
819
820
            # lock count) of self.repository to the new repository.
820
821
            lock_token = old_repository.lock_write().repository_token
821
822
            self.repository = new_repository
822
823
            if isinstance(self, remote.RemoteBranch):
 
824
                # Remote branches can have a second reference to the old
 
825
                # repository that need to be replaced.
823
826
                if self._real_branch is not None:
824
827
                    self._real_branch.repository = new_repository
825
828
            self.repository.lock_write(token=lock_token)
829
832
            if lock_token is not None:
830
833
                # XXX: self.repository.leave_lock_in_place() before this
831
834
                # function will not be preserved.  Fortunately that doesn't
832
 
                # affect the current default format (2a).
 
835
                # affect the current default format (2a), and would be a
 
836
                # corner-case anyway.
833
837
                #  - Andrew Bennetts, 2010/06/30
834
838
                self.repository.dont_leave_lock_in_place()
835
839
            old_lock_count = 0