/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

add working tree to the BzrDir facilities.

Show diffs side-by-side

added added

removed removed

Lines of Context:
83
83
import bzrlib.tree
84
84
from bzrlib.trace import mutter
85
85
from bzrlib.transport import get_transport
 
86
from bzrlib.transport.local import LocalTransport
86
87
import bzrlib.xml5
87
88
 
88
89
 
1101
1102
    return False
1102
1103
 
1103
1104
 
 
1105
class WorkingTreeFormat2(object):
 
1106
    """The second working tree format. 
 
1107
 
 
1108
    This format modified the hash cache from the format 1 hash cache.
 
1109
    """
 
1110
 
 
1111
    def initialize(self, a_bzrdir):
 
1112
        """See WorkingTreeFormat.initialize()."""
 
1113
        if not isinstance(a_bzrdir.transport, LocalTransport):
 
1114
            raise errors.NotLocalUrl(a_bzrdir.transport.base)
 
1115
        result = WorkingTree.create(a_bzrdir.open_branch(),
 
1116
                                  a_bzrdir.transport.clone('..').base)
 
1117
        result.bzrdir = a_bzrdir
 
1118
        result._format = self
 
1119
        return result
 
1120
 
 
1121
    def open(self, a_bzrdir, _found=False):
 
1122
        """Return the WorkingTree object for a_bzrdir
 
1123
 
 
1124
        _found is a private parameter, do not use it. It is used to indicate
 
1125
               if format probing has already been done.
 
1126
        """
 
1127
        if not _found:
 
1128
            # we are being called directly and must probe.
 
1129
            raise NotImplementedError
 
1130
        result = WorkingTree(a_bzrdir.transport.clone('..').base)
 
1131
        result.bzrdir = a_bzrdir
 
1132
        result._format = self
 
1133
        return result