~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2011-06-28 19:12:10 UTC
  • mfrom: (5967.7.4 rm-magic-methods)
  • Revision ID: pqm@pqm.ubuntu.com-20110628191210-bwblsxn26kyu3swl
(mbp) remove __contains__ methods from inventory and dict (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
2077
2077
            return True
2078
2078
        return self.inventory.has_id(file_id)
2079
2079
 
2080
 
    __contains__ = has_id
2081
 
 
2082
2080
    @symbol_versioning.deprecated_method(symbol_versioning.deprecated_in((2, 4, 0)))
2083
2081
    def __iter__(self):
2084
2082
        """Iterate through file_ids for this tree.
2260
2258
                parent_tree = self.branch.repository.revision_tree(parent_id)
2261
2259
            parent_tree.lock_read()
2262
2260
            try:
2263
 
                if file_id not in parent_tree:
 
2261
                if not parent_tree.has_id(file_id):
2264
2262
                    continue
2265
2263
                ie = parent_tree.inventory[file_id]
2266
2264
                if ie.kind != 'file':
2314
2312
            for s in _mod_rio.RioReader(hashfile):
2315
2313
                # RioReader reads in Unicode, so convert file_ids back to utf8
2316
2314
                file_id = osutils.safe_file_id(s.get("file_id"), warn=False)
2317
 
                if file_id not in self.inventory:
 
2315
                if not self.inventory.has_id(file_id):
2318
2316
                    continue
2319
2317
                text_hash = s.get("hash")
2320
2318
                if text_hash == self.get_file_sha1(file_id):
2855
2853
        :raises: NoSuchId if any fileid is not currently versioned.
2856
2854
        """
2857
2855
        for file_id in file_ids:
2858
 
            if file_id not in self._inventory:
 
2856
            if not self._inventory.has_id(file_id):
2859
2857
                raise errors.NoSuchId(self, file_id)
2860
2858
        for file_id in file_ids:
2861
2859
            if self._inventory.has_id(file_id):