~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree_4.py

  • Committer: Andrew Bennetts
  • Date: 2008-08-07 00:25:38 UTC
  • mfrom: (3612 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3613.
  • Revision ID: andrew.bennetts@canonical.com-20080807002538-mtl1fcgy2fdabha4
Merge from bzr.dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1296
1296
 
1297
1297
    upgrade_recommended = False
1298
1298
 
 
1299
    _tree_class = WorkingTree4
 
1300
 
1299
1301
    def get_format_string(self):
1300
1302
        """See WorkingTreeFormat.get_format_string()."""
1301
1303
        return "Bazaar Working Tree Format 4 (bzr 0.15)\n"
1339
1341
        state = dirstate.DirState.initialize(local_path)
1340
1342
        state.unlock()
1341
1343
        del state
1342
 
        wt = WorkingTree4(a_bzrdir.root_transport.local_abspath('.'),
 
1344
        wt = self._tree_class(a_bzrdir.root_transport.local_abspath('.'),
1343
1345
                         branch,
1344
1346
                         _format=self,
1345
1347
                         _bzrdir=a_bzrdir,
1347
1349
        wt._new_tree()
1348
1350
        wt.lock_tree_write()
1349
1351
        try:
 
1352
            self._init_custom_control_files(wt)
1350
1353
            if revision_id in (None, NULL_REVISION):
1351
1354
                if branch.repository.supports_rich_root():
1352
1355
                    wt._set_root_id(generate_ids.gen_root_id())
1390
1393
            wt.unlock()
1391
1394
        return wt
1392
1395
 
 
1396
    def _init_custom_control_files(self, wt):
 
1397
        """Subclasses with custom control files should override this method.
 
1398
        
 
1399
        The working tree and control files are locked for writing when this
 
1400
        method is called.
 
1401
        
 
1402
        :param wt: the WorkingTree object
 
1403
        """
 
1404
 
1393
1405
    def _open(self, a_bzrdir, control_files):
1394
1406
        """Open the tree itself.
1395
1407
 
1396
1408
        :param a_bzrdir: the dir for the tree.
1397
1409
        :param control_files: the control files for the tree.
1398
1410
        """
1399
 
        return WorkingTree4(a_bzrdir.root_transport.local_abspath('.'),
 
1411
        return self._tree_class(a_bzrdir.root_transport.local_abspath('.'),
1400
1412
                           branch=a_bzrdir.open_branch(),
1401
1413
                           _format=self,
1402
1414
                           _bzrdir=a_bzrdir,