/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: Jelmer Vernooij
  • Date: 2012-01-24 01:01:04 UTC
  • mto: This revision was merged to the branch mainline in revision 6464.
  • Revision ID: jelmer@samba.org-20120124010104-43ugdvy70ucp34ln
Lots of test fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
379
379
                                              list_current=list_current)
380
380
        return [tr for tr in iterator if tr is not None]
381
381
 
382
 
    def all_file_ids(self):
383
 
        """See Tree.iter_all_file_ids"""
384
 
        raise NotImplementedError(self.all_file_ids)
385
 
 
386
382
    def __repr__(self):
387
383
        return "<%s of %s>" % (self.__class__.__name__,
388
384
                               getattr(self, 'basedir', None))
2085
2081
        inv, inv_file_id = self._unpack_file_id(file_id)
2086
2082
        return inv.has_id(inv_file_id)
2087
2083
 
2088
 
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
2089
 
    def __iter__(self):
 
2084
    def all_file_ids(self):
2090
2085
        """Iterate through file_ids for this tree.
2091
2086
 
2092
2087
        file_ids are in a WorkingTree if they are in the working inventory
2093
2088
        and the working file exists.
2094
2089
        """
2095
 
        inv = self._inventory
2096
 
        for path, ie in inv.iter_entries():
 
2090
        ret = set()
 
2091
        for path, ie in self.iter_entries_by_dir():
2097
2092
            if osutils.lexists(self.abspath(path)):
2098
 
                yield ie.file_id
 
2093
                ret.add(ie.file_id)
 
2094
        return ret
2099
2095
 
2100
2096
    @needs_tree_write_lock
2101
2097
    def set_last_revision(self, new_revision):
2157
2153
                _mod_revision.NULL_REVISION)
2158
2154
        else:
2159
2155
            rt = self.branch.repository.revision_tree(revision_ids[0])
2160
 
        self._write_inventory(rt.inventory)
 
2156
        self._write_inventory(rt.root_inventory)
2161
2157
        self.set_parent_ids(revision_ids)
2162
2158
 
2163
2159
    def flush(self):
2452
2448
            raise errors.ObjectNotLocked(self)
2453
2449
 
2454
2450
        if from_dir is None and include_root is True:
2455
 
            yield ('', 'V', 'directory', self.inventory.root.file_id, self.inventory.root)
 
2451
            yield ('', 'V', 'directory', self.get_root_id(), self.root_inventory.root)
2456
2452
        # Convert these into local objects to save lookup times
2457
2453
        pathjoin = osutils.pathjoin
2458
2454
        file_kind = self._kind
2471
2467
                return
2472
2468
            from_dir_abspath = pathjoin(self.basedir, from_dir)
2473
2469
        else:
2474
 
            inv = self.inventory
 
2470
            inv = self.root_inventory
2475
2471
            from_dir_id = inv.root.file_id
2476
2472
            from_dir_abspath = self.basedir
2477
2473
        children = os.listdir(from_dir_abspath)