~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tree.py

  • Committer: mbp at sourcefrog
  • Date: 2005-03-29 07:29:29 UTC
  • Revision ID: mbp@sourcefrog.net-20050329072929-1d7cbfa072bc4b17
better "unknowns" based on just listing the relevant files

Show diffs side-by-side

added added

removed removed

Lines of Context:
234
234
            
235
235
 
236
236
 
237
 
    def unknowns(self, path='', dir_id=None):
238
 
        """Yield names of unknown files in this WorkingTree.
 
237
    def unknowns(self):
 
238
        """Yield all unknown files in this WorkingTree.
239
239
 
240
240
        If there are any unknown directories then only the directory is
241
241
        returned, not all its children.  But if there are unknown files
243
243
 
244
244
        Currently returned depth-first, sorted by name within directories.
245
245
        """
246
 
        for fpath, fclass, fkind, fid in self.list_files():
247
 
            if fclass == '?':
248
 
                yield fpath
 
246
        ## TODO: Work from given directory downwards
 
247
        
 
248
        for path, dir_entry in self.inventory.directories():
 
249
            mutter("search for unknowns in %r" % path)
 
250
            dirabs = self.abspath(path)
 
251
            if not isdir(dirabs):
 
252
                # e.g. directory deleted
 
253
                continue
 
254
 
 
255
            fl = []
 
256
            for subf in os.listdir(dirabs):
 
257
                if (subf != '.bzr'
 
258
                    and (subf not in dir_entry.children)):
 
259
                    fl.append(subf)
 
260
            
 
261
            fl.sort()
 
262
            for subf in fl:
 
263
                subp = appendpath(path, subf)
 
264
                if self.is_ignored(subp):
 
265
                    continue
 
266
                yield subp
249
267
                
250
268
 
251
269
    def ignored_files(self):