~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/inventory.py

  • Committer: Robert Collins
  • Date: 2006-03-02 10:51:24 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060302105124-675e0bed0d749b43
get knit repositories really using knits for text storage.

Show diffs side-by-side

added added

removed removed

Lines of Context:
161
161
        any other. If the file is new, the set will be empty.
162
162
        """
163
163
        def get_ancestors(weave, entry):
164
 
            return set(map(weave.idx_to_name,
165
 
                           weave.inclusions([weave.lookup(entry.revision)])))
 
164
            return set(weave.get_ancestry(entry.revision))
166
165
        heads = {}
167
166
        head_ancestors = {}
168
167
        for inv in previous_inventories:
358
357
        """
359
358
        mutter('storing file {%s} in revision {%s}',
360
359
               self.file_id, self.revision)
361
 
        self._add_text_to_weave([], file_parents, weave_store, transaction)
 
360
        self._add_text_to_weave([], file_parents.keys(), weave_store, transaction)
362
361
 
363
362
    def __eq__(self, other):
364
363
        if not isinstance(other, InventoryEntry):
588
587
            and self.text_size == file_parents.values()[0].text_size):
589
588
            previous_ie = file_parents.values()[0]
590
589
            versionedfile = weave_store.get_weave(self.file_id, transaction)
591
 
            versionedfile.clone_text(self.revision, previous_ie.revision, file_parents)
 
590
            versionedfile.clone_text(self.revision, previous_ie.revision, file_parents.keys())
592
591
        else:
593
592
            new_lines = work_tree.get_file(self.file_id).readlines()
594
 
            self._add_text_to_weave(new_lines, file_parents, weave_store,
 
593
            self._add_text_to_weave(new_lines, file_parents.keys(), weave_store,
595
594
                                    transaction)
596
595
            self.text_sha1 = sha_strings(new_lines)
597
596
            self.text_size = sum(map(len, new_lines))