~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: Jelmer Vernooij
  • Date: 2012-01-24 03:04:58 UTC
  • mto: This revision was merged to the branch mainline in revision 6464.
  • Revision ID: jelmer@samba.org-20120124030458-aj2syolemmi6knri
Fix more tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
625
625
        """
626
626
        base_id = self.old_contents_id(file_id)
627
627
        if (base_id is not None and
628
 
            base_id != self.base_tree.inventory.root.file_id):
 
628
            base_id != self.base_tree.get_root_id()):
629
629
            patch_original = self.base_tree.get_file(base_id)
630
630
        else:
631
631
            patch_original = None
632
632
        file_patch = self.patches.get(self.id2path(file_id))
633
633
        if file_patch is None:
634
634
            if (patch_original is None and
635
 
                self.get_kind(file_id) == 'directory'):
 
635
                self.kind(file_id) == 'directory'):
636
636
                return StringIO()
637
637
            if patch_original is None:
638
638
                raise AssertionError("None: %s" % file_id)
651
651
        except KeyError:
652
652
            return self.base_tree.get_symlink_target(file_id)
653
653
 
654
 
    def get_kind(self, file_id):
 
654
    def kind(self, file_id):
655
655
        if file_id in self._kinds:
656
656
            return self._kinds[file_id]
657
 
        return self.base_tree.inventory[file_id].kind
 
657
        return self.base_tree.kind(file_id)
658
658
 
659
659
    def get_file_revision(self, file_id):
660
660
        path = self.id2path(file_id)
714
714
                parent_path = dirname(path)
715
715
                parent_id = self.path2id(parent_path)
716
716
 
717
 
            kind = self.get_kind(file_id)
 
717
            kind = self.kind(file_id)
718
718
            revision_id = self.get_last_changed(file_id)
719
719
 
720
720
            name = basename(path)
748
748
    # at that instant
749
749
    inventory = property(_get_inventory)
750
750
 
 
751
    root_inventory = property(_get_inventory)
 
752
 
751
753
    def __iter__(self):
752
754
        for path, entry in self.inventory.iter_entries():
753
755
            yield entry.file_id