~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

  • Committer: Vincent Ladeuil
  • Date: 2012-03-08 18:30:33 UTC
  • mfrom: (6487 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6488.
  • Revision ID: v.ladeuil+lp@free.fr-20120308183033-bccqnbr1tpozs711
Merge bzr.dev resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
687
687
        if new_path not in self.patches:
688
688
            # If the entry does not have a patch, then the
689
689
            # contents must be the same as in the base_tree
690
 
            ie = self.base_tree.root_inventory[file_id]
691
 
            if ie.text_size is None:
692
 
                return ie.text_size, ie.text_sha1
693
 
            return int(ie.text_size), ie.text_sha1
 
690
            text_size = self.base_tree.get_file_size(file_id)
 
691
            text_sha1 = self.base_tree.get_file_sha1(file_id)
 
692
            return text_size, text_sha1
694
693
        fileobj = self.get_file(file_id)
695
694
        content = fileobj.read()
696
695
        return len(content), sha_string(content)
701
700
        This need to be called before ever accessing self.inventory
702
701
        """
703
702
        from os.path import dirname, basename
704
 
        base_inv = self.base_tree.root_inventory
705
703
        inv = Inventory(None, self.revision_id)
706
704
 
707
705
        def add_entry(file_id):
750
748
 
751
749
    root_inventory = property(_get_inventory)
752
750
 
753
 
    def __iter__(self):
754
 
        for path, entry in self.inventory.iter_entries():
755
 
            yield entry.file_id
 
751
    def all_file_ids(self):
 
752
        return set(
 
753
            [entry.file_id for path, entry in self.inventory.iter_entries()])
756
754
 
757
755
    def list_files(self, include_root=False, from_dir=None, recursive=True):
758
756
        # The only files returned by this are those from the version