/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

  • Committer: Martin
  • Date: 2010-05-03 20:57:39 UTC
  • mto: This revision was merged to the branch mainline in revision 5204.
  • Revision ID: gzlist@googlemail.com-20100503205739-n326zdvevv0rmruh
Retain original stack and error message when translating to ValueError in bencode

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
WorkingTree.open(dir).
30
30
"""
31
31
 
32
 
# TODO: Give the workingtree sole responsibility for the working inventory;
33
 
# remove the variable and references to it from the branch.  This may require
34
 
# updating the commit code so as to update the inventory within the working
35
 
# copy, and making sure there's only one WorkingTree for any directory on disk.
36
 
# At the moment they may alias the inventory and have old copies of it in
37
 
# memory.  (Now done? -- mbp 20060309)
38
32
 
39
33
from cStringIO import StringIO
40
34
import os
101
95
from bzrlib.filters import filtered_input_file
102
96
from bzrlib.trace import mutter, note
103
97
from bzrlib.transport.local import LocalTransport
104
 
from bzrlib.progress import ProgressPhase
105
98
from bzrlib.revision import CURRENT_REVISION
106
99
from bzrlib.rio import RioReader, rio_file, Stanza
107
100
from bzrlib.symbol_versioning import (
174
167
        return ''
175
168
 
176
169
 
177
 
class WorkingTree(bzrlib.mutabletree.MutableTree):
 
170
class WorkingTree(bzrlib.mutabletree.MutableTree,
 
171
    bzrdir.ControlComponent):
178
172
    """Working copy tree.
179
173
 
180
174
    The inventory is held in the `Branch` working-inventory, and the
253
247
        self._rules_searcher = None
254
248
        self.views = self._make_views()
255
249
 
 
250
    @property
 
251
    def user_transport(self):
 
252
        return self.bzrdir.user_transport
 
253
 
 
254
    @property
 
255
    def control_transport(self):
 
256
        return self._transport
 
257
 
256
258
    def _detect_case_handling(self):
257
259
        wt_trans = self.bzrdir.get_workingtree_transport(None)
258
260
        try:
1094
1096
        tree_transport = self.bzrdir.root_transport.clone(sub_path)
1095
1097
        if tree_transport.base != branch_transport.base:
1096
1098
            tree_bzrdir = format.initialize_on_transport(tree_transport)
1097
 
            branch.BranchReferenceFormat().initialize(tree_bzrdir, new_branch)
 
1099
            branch.BranchReferenceFormat().initialize(tree_bzrdir,
 
1100
                target_branch=new_branch)
1098
1101
        else:
1099
1102
            tree_bzrdir = branch_bzrdir
1100
1103
        wt = tree_bzrdir.create_workingtree(_mod_revision.NULL_REVISION)
1138
1141
        This does not include files that have been deleted in this
1139
1142
        tree. Skips the control directory.
1140
1143
 
1141
 
        :param include_root: if True, do not return an entry for the root
 
1144
        :param include_root: if True, return an entry for the root
1142
1145
        :param from_dir: start from this directory or None for the root
1143
1146
        :param recursive: whether to recurse into subdirectories or not
1144
1147
        """
2257
2260
            last_rev = _mod_revision.NULL_REVISION
2258
2261
        if revision is None:
2259
2262
            revision = self.branch.last_revision()
2260
 
        else:
2261
 
            if revision not in self.branch.revision_history():
2262
 
                raise errors.NoSuchRevision(self.branch, revision)
2263
2263
 
2264
2264
        old_tip = old_tip or _mod_revision.NULL_REVISION
2265
2265