/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Robert Collins
  • Date: 2008-03-19 04:39:04 UTC
  • mto: This revision was merged to the branch mainline in revision 3306.
  • Revision ID: robertc@robertcollins.net-20080319043904-7g4imzvybc7q9l8h
Deprecate VersionedFile.get_parents, breaking pulling from a ghost containing knit or pack repository to weaves, which improves correctness and allows simplification of core code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
720
720
    def get_delta(self, version_id):
721
721
        """Get a delta for constructing version from some other version."""
722
722
        self.check_not_reserved_id(version_id)
723
 
        parents = self.get_parents(version_id)
 
723
        parents = self.get_parent_map([version_id])[version_id]
724
724
        if len(parents):
725
725
            parent = parents[0]
726
726
        else:
977
977
        self._index.check_versions_present(version_ids)
978
978
 
979
979
    def _add_lines_with_ghosts(self, version_id, parents, lines, parent_texts,
980
 
        nostore_sha, random_id, check_content):
 
980
        nostore_sha, random_id, check_content, left_matching_blocks):
981
981
        """See VersionedFile.add_lines_with_ghosts()."""
982
982
        self._check_add(version_id, lines, random_id, check_content)
983
983
        return self._add(version_id, lines, parents, self.delta,
984
 
            parent_texts, None, nostore_sha, random_id)
 
984
            parent_texts, left_matching_blocks, nostore_sha, random_id)
985
985
 
986
986
    def _add_lines(self, version_id, parents, lines, parent_texts,
987
987
        left_matching_blocks, nostore_sha, random_id, check_content):
1265
1265
        for version_id in version_ids:
1266
1266
            try:
1267
1267
                result[version_id] = tuple(lookup(version_id))
1268
 
            except KeyError:
 
1268
            except (KeyError, RevisionNotPresent):
1269
1269
                pass
1270
1270
        return result
1271
1271
 
2828
2828
            # do the join:
2829
2829
            count = 0
2830
2830
            total = len(version_list)
 
2831
            parent_map = self.source.get_parent_map(version_list)
2831
2832
            for version_id in version_list:
2832
2833
                pb.update("Converting to knit", count, total)
2833
 
                parents = self.source.get_parents(version_id)
 
2834
                parents = parent_map[version_id]
2834
2835
                # check that its will be a consistent copy:
2835
2836
                for parent in parents:
2836
2837
                    # if source has the parent, we must already have it