~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Trivial cleanups to workingtree.py

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
 
54
54
from bzrlib import bzrdir, errors, osutils, urlutils
55
55
from bzrlib.atomicfile import AtomicFile
 
56
import bzrlib.branch
 
57
import bzrlib.bzrdir as bzrdir
56
58
from bzrlib.conflicts import Conflict, ConflictList, CONFLICT_SUFFIXES
57
59
from bzrlib.decorators import needs_read_lock, needs_write_lock
58
60
from bzrlib.errors import (BzrCheckError,
95
97
        DEPRECATED_PARAMETER,
96
98
        zero_eight,
97
99
        )
98
 
 
99
 
from bzrlib.textui import show_status
100
 
import bzrlib.tree
 
100
from bzrlib.trace import mutter, note
101
101
from bzrlib.transform import build_tree
102
 
from bzrlib.trace import mutter, note
103
102
from bzrlib.transport import get_transport
104
103
from bzrlib.transport.local import LocalTransport
 
104
from bzrlib.textui import show_status
 
105
import bzrlib.tree
105
106
import bzrlib.ui
106
107
import bzrlib.xml5
107
108
 
268
269
            # share control object
269
270
            self._control_files = self.branch.control_files
270
271
        else:
271
 
            # only ready for format 3
272
 
            assert isinstance(self._format, WorkingTreeFormat3)
 
272
            # assume all other formats have their own control files.
273
273
            assert isinstance(_control_files, LockableFiles), \
274
274
                    "_control_files must be a LockableFiles, not %r" \
275
275
                    % _control_files
1724
1724
          files, separate from the BzrDir format
1725
1725
        - modifies the hash cache format
1726
1726
        - is new in bzr 0.8
1727
 
        - uses a LockDir to guard access to the repository
 
1727
        - uses a LockDir to guard access for writes.
1728
1728
    """
1729
1729
 
1730
1730
    def get_format_string(self):
1794
1794
            raise NotImplementedError
1795
1795
        if not isinstance(a_bzrdir.transport, LocalTransport):
1796
1796
            raise errors.NotLocalUrl(a_bzrdir.transport.base)
1797
 
        control_files = self._open_control_files(a_bzrdir)
 
1797
        return self._open(a_bzrdir, self._open_control_files(a_bzrdir))
 
1798
 
 
1799
    def _open(self, a_bzrdir, control_files):
 
1800
        """Open the tree itself.
 
1801
        
 
1802
        :param a_bzrdir: the dir for the tree.
 
1803
        :param control_files: the control files for the tree.
 
1804
        """
1798
1805
        return WorkingTree3(a_bzrdir.root_transport.local_abspath('.'),
1799
1806
                           _internal=True,
1800
1807
                           _format=self,