~ubuntu-branches/ubuntu/hardy/bzr/hardy-proposed

« back to all changes in this revision

Viewing changes to bzrlib/knit.py

  • Committer: Bazaar Package Importer
  • Author(s): James Westby
  • Date: 2008-05-29 22:34:44 UTC
  • Revision ID: james.westby@ubuntu.com-20080529223444-xpfsxw4tnn4m1a3a
Tags: 1.3.1-1ubuntu0.1
* Fix a bug when checking out some branches over bzr+ssh://.
  This fix is cherrypicked from upstream 1.4. (LP: #230294)
* Modify Maintainer value to match the DebianMaintainerField
  specification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
845
845
                            'on the source repository, and "bzr reconcile" '
846
846
                            'if necessary.' %
847
847
                            (version_id, parents[0]))
 
848
                    if not self.delta:
 
849
                        # We received a line-delta record for a non-delta
 
850
                        # knit. Convert it to a fulltext.
 
851
                        gzip_bytes = reader_callable(length)
 
852
                        self._convert_line_delta_to_fulltext(
 
853
                            gzip_bytes, version_id, parents)
 
854
                        continue
 
855
 
848
856
                self._add_raw_records(
849
857
                    [(version_id, options, parents, length)],
850
858
                    reader_callable(length))
851
859
 
 
860
    def _convert_line_delta_to_fulltext(self, gzip_bytes, version_id, parents):
 
861
        lines, sha1 = self._data._parse_record(version_id, gzip_bytes)
 
862
        delta = self.factory.parse_line_delta(lines, version_id)
 
863
        content = self.factory.make(self.get_lines(parents[0]), parents[0])
 
864
        content.apply_delta(delta, version_id)
 
865
        digest, len, content = self.add_lines(
 
866
            version_id, parents, content.text())
 
867
        if digest != sha1:
 
868
            raise errors.VersionedFileInvalidChecksum(version_id)
 
869
 
852
870
    def _knit_from_datastream(self, (format, data_list, reader_callable)):
853
871
        """Create a knit object from a data stream.
854
872