~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Martin Pool
  • Date: 2011-06-14 02:21:41 UTC
  • mto: This revision was merged to the branch mainline in revision 6001.
  • Revision ID: mbp@canonical.com-20110614022141-18hmm7s0iw3utcbj
Deprecate __contains__ on Tree and Inventory

Show diffs side-by-side

added added

removed removed

Lines of Context:
2089
2089
            return True
2090
2090
        return self.inventory.has_id(file_id)
2091
2091
 
2092
 
    __contains__ = has_id
2093
 
 
2094
2092
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
2095
2093
    def __iter__(self):
2096
2094
        """Iterate through file_ids for this tree.
2272
2270
                parent_tree = self.branch.repository.revision_tree(parent_id)
2273
2271
            parent_tree.lock_read()
2274
2272
            try:
2275
 
                if file_id not in parent_tree:
 
2273
                if not parent_tree.has_id(file_id):
2276
2274
                    continue
2277
2275
                ie = parent_tree.inventory[file_id]
2278
2276
                if ie.kind != 'file':
2326
2324
            for s in _mod_rio.RioReader(hashfile):
2327
2325
                # RioReader reads in Unicode, so convert file_ids back to utf8
2328
2326
                file_id = osutils.safe_file_id(s.get("file_id"), warn=False)
2329
 
                if file_id not in self.inventory:
 
2327
                if not self.inventory.has_id(file_id):
2330
2328
                    continue
2331
2329
                text_hash = s.get("hash")
2332
2330
                if text_hash == self.get_file_sha1(file_id):
2849
2847
        :raises: NoSuchId if any fileid is not currently versioned.
2850
2848
        """
2851
2849
        for file_id in file_ids:
2852
 
            if file_id not in self._inventory:
 
2850
            if not self._inventory.has_id(file_id):
2853
2851
                raise errors.NoSuchId(self, file_id)
2854
2852
        for file_id in file_ids:
2855
2853
            if self._inventory.has_id(file_id):