~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transform.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-07-22 01:36:42 UTC
  • mfrom: (4544.2.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20090722013642-hejy07x9ub06tioj
(robertc) Add interface enforcement for the behaviour of iter_changes
        with missing subtrees with explicit paths - the whole subtree
        is returned. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1718
1718
    def __iter__(self):
1719
1719
        return iter(self.all_file_ids())
1720
1720
 
1721
 
    def has_id(self, file_id):
 
1721
    def _has_id(self, file_id, fallback_check):
1722
1722
        if file_id in self._transform._r_new_id:
1723
1723
            return True
1724
1724
        elif file_id in set([self._transform.tree_file_id(trans_id) for
1725
1725
            trans_id in self._transform._removed_id]):
1726
1726
            return False
1727
1727
        else:
1728
 
            return self._transform._tree.has_id(file_id)
 
1728
            return fallback_check(file_id)
 
1729
 
 
1730
    def has_id(self, file_id):
 
1731
        return self._has_id(file_id, self._transform._tree.has_id)
 
1732
 
 
1733
    def has_or_had_id(self, file_id):
 
1734
        return self._has_id(file_id, self._transform._tree.has_or_had_id)
1729
1735
 
1730
1736
    def _path2trans_id(self, path):
1731
1737
        # We must not use None here, because that is a valid value to store.