~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/reconfigure.py

  • Committer: Martin von Gagern
  • Date: 2009-04-23 14:20:08 UTC
  • mto: (4338.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 4339.
  • Revision ID: martin.vgagern@gmx.net-20090423142008-89nz0k1qazr3is7s
Use repository format from exactly the same repository we want to fetch from.
                                                     
Simply looking for all occurrences of repo.fetch() in this apply method
shows that there are only two possible source repositories, one from
local_branch and one from referenced_branch.  If we will later fetch from
either of these, we also use the corresponding format.  If not, we fall back
to default format.  I don't know if this ever happens.  The code is pretty
verbose, making it easy to replace parts of the logic and keep other parts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
268
268
        if not force:
269
269
            self._check()
270
270
        if self._create_repository:
271
 
            repository_format = None
272
 
            if self.repository is not None:
273
 
                repository_format = self.repository._format
 
271
            if self.local_branch and not self._destroy_branch:
 
272
                old_repo = self.local_branch.repository
 
273
            elif self._create_branch and self.referenced_branch is not None:
 
274
                old_repo = self.referenced_branch.repository
 
275
            else:
 
276
                old_repo = None
 
277
            if old_repo is not None:
 
278
                repository_format = old_repo._format
 
279
            else:
 
280
                repository_format = None
274
281
            if repository_format is not None:
275
282
                repo = repository_format.initialize(self.bzrdir)
276
283
            else: