~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

Bugfix WorkingTree.remove to handle subtrees, and non-cwd trees

Show diffs side-by-side

added added

removed removed

Lines of Context:
1783
1783
        def recurse_directory_to_add_files(directory):
1784
1784
            # recurse directory and add all files
1785
1785
            # so we can check if they have changed.
1786
 
            for contained_dir_info in self.walkdirs(directory):
1787
 
                for file_info in contained_dir_info[1]:
1788
 
                    if file_info[2] == 'file':
1789
 
                        relpath = self.relpath(file_info[0])
1790
 
                        if file_info[4]: #is it versioned?
 
1786
            for parent_info, file_infos in\
 
1787
                osutils.walkdirs(self.abspath(directory),
 
1788
                    directory):
 
1789
                for relpath, basename, kind, lstat, abspath in file_infos:
 
1790
                    if kind == 'file':
 
1791
                        if self.path2id(relpath): #is it versioned?
1791
1792
                            new_files.add(relpath)
1792
1793
                        else:
1793
1794
                            unknown_files_in_directory.add(
1794
 
                                (relpath, None, file_info[2]))
 
1795
                                (relpath, None, kind))
1795
1796
 
1796
1797
        for filename in files:
1797
1798
            # Get file name into canonical form.
1798
 
            filename = self.relpath(self.abspath(filename))
 
1799
            abspath = self.abspath(filename)
 
1800
            filename = self.relpath(abspath)
1799
1801
            if len(filename) > 0:
1800
1802
                new_files.add(filename)
1801
 
                if osutils.isdir(filename) and len(os.listdir(filename)) > 0:
 
1803
                if osutils.isdir(abspath) and len(os.listdir(abspath)) > 0:
1802
1804
                    recurse_directory_to_add_files(filename)
1803
1805
        files = [f for f in new_files]
1804
1806