~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Parth Malwankar
  • Date: 2010-05-05 14:11:13 UTC
  • mfrom: (5211 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5213.
  • Revision ID: parth.malwankar@gmail.com-20100505141113-c21oicoxzb3u6if6
merged in changes from trunk.

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:
1954
1956
        def recurse_directory_to_add_files(directory):
1955
1957
            # Recurse directory and add all files
1956
1958
            # so we can check if they have changed.
1957
 
            for parent_info, file_infos in\
1958
 
                self.walkdirs(directory):
 
1959
            for parent_info, file_infos in self.walkdirs(directory):
1959
1960
                for relpath, basename, kind, lstat, fileid, kind in file_infos:
1960
1961
                    # Is it versioned or ignored?
1961
1962
                    if self.path2id(relpath) or self.is_ignored(relpath):
1996
1997
                            # ... but not ignored
1997
1998
                            has_changed_files = True
1998
1999
                            break
1999
 
                    elif content_change and (kind[1] is not None):
2000
 
                        # Versioned and changed, but not deleted
 
2000
                    elif (content_change and (kind[1] is not None) and
 
2001
                            osutils.is_inside_any(files, path[1])):
 
2002
                        # Versioned and changed, but not deleted, and still
 
2003
                        # in one of the dirs to be deleted.
2001
2004
                        has_changed_files = True
2002
2005
                        break
2003
2006