~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bzrdir.py

  • Committer: Aaron Bentley
  • Date: 2006-12-11 05:27:48 UTC
  • mto: (2255.6.1 dirstate)
  • mto: This revision was merged to the branch mainline in revision 2322.
  • Revision ID: aaron.bentley@utoronto.ca-20061211052748-672fjh70mzze3qkh
Ensure added references are serialized properly, beef up Workingtreee3

Show diffs side-by-side

added added

removed removed

Lines of Context:
912
912
    def create_workingtree(self, revision_id=None):
913
913
        """See BzrDir.create_workingtree."""
914
914
        from bzrlib.workingtree import WorkingTreeFormat
915
 
        return WorkingTreeFormat.get_default_format().initialize(self, revision_id)
 
915
        return self._format.workingtree_format.initialize(self, revision_id)
916
916
 
917
917
    def destroy_workingtree(self):
918
918
        """See BzrDir.destroy_workingtree."""
1410
1410
 
1411
1411
    _lock_class = lockdir.LockDir
1412
1412
 
 
1413
    def __init__(self):
 
1414
        self._workingtree_format = None
 
1415
 
1413
1416
    def get_converter(self, format=None):
1414
1417
        """See BzrDirFormat.get_converter()."""
1415
1418
        if format is None:
1444
1447
 
1445
1448
    repository_format = property(__return_repository_format, __set_repository_format)
1446
1449
 
 
1450
    def __get_workingtree_format(self):
 
1451
        if self._workingtree_format is None:
 
1452
            from bzrlib.workingtree import WorkingTreeFormat
 
1453
            self._workingtree_format = WorkingTreeFormat.get_default_format()
 
1454
        return self._workingtree_format
 
1455
 
 
1456
    def __set_workingtree_format(self, wt_format):
 
1457
        self._workingtree_format = wt_format
 
1458
 
 
1459
    workingtree_format = property(__get_workingtree_format,
 
1460
                                  __set_workingtree_format)
 
1461
 
1447
1462
 
1448
1463
BzrDirFormat.register_format(BzrDirFormat4())
1449
1464
BzrDirFormat.register_format(BzrDirFormat5())
1955
1970
    format = BzrDirMetaFormat1()
1956
1971
    format.repository_format = repository.RepositoryFormatKnit2()
1957
1972
    return format
 
1973
 
 
1974
def get_knit3_format():
 
1975
    from bzrlib import repository, workingtree
 
1976
    format = BzrDirMetaFormat1()
 
1977
    format.repository_format = repository.RepositoryFormatKnit2()
 
1978
    format.workingtree_format = workingtree.WorkingTreeFormat4()
 
1979
    return format