~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Robert Collins
  • Date: 2009-04-27 05:56:16 UTC
  • mto: This revision was merged to the branch mainline in revision 4304.
  • Revision ID: robertc@robertcollins.net-20090427055616-uhoqgnr8d220u3lv
Prevent aliasing issues with BzrDirMetaFormat1 by making a new format object in _open.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2396
2396
 
2397
2397
    def _open(self, transport):
2398
2398
        """See BzrDirFormat._open."""
2399
 
        return BzrDirMeta1(transport, self)
 
2399
        # Create a new format instance because otherwise initialisation of new
 
2400
        # metadirs share the global default format object leading to alias
 
2401
        # problems.
 
2402
        format = BzrDirMetaFormat1()
 
2403
        self._supply_sub_formats_to(format)
 
2404
        return BzrDirMeta1(transport, format)
2400
2405
 
2401
2406
    def __return_repository_format(self):
2402
2407
        """Circular import protection."""