~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/bundle/bundle_data.py

merge hpss changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
76
76
        if self.properties:
77
77
            for property in self.properties:
78
78
                key_end = property.find(': ')
79
 
                if key_end == -1:
80
 
                    assert property.endswith(':')
81
 
                    key = str(property[:-1])
82
 
                    value = ''
83
 
                else:
84
 
                    key = str(property[:key_end])
85
 
                    value = property[key_end+2:]
 
79
                assert key_end is not None
 
80
                key = property[:key_end].encode('utf-8')
 
81
                value = property[key_end+2:].encode('utf-8')
86
82
                rev.properties[key] = value
87
83
 
88
84
        return rev
109
105
        self.timestamp = None
110
106
        self.timezone = None
111
107
 
112
 
        # Have we checked the repository yet?
113
 
        self._validated_revisions_against_repo = False
114
 
 
115
108
    def __str__(self):
116
109
        return pprint.pformat(self.__dict__)
117
110
 
183
176
        revision = self.get_revision(revision_id)
184
177
        base = self.get_base(revision)
185
178
        assert base != revision_id
186
 
        if not self._validated_revisions_against_repo:
187
 
            self._validate_references_from_repository(repository)
 
179
        self._validate_references_from_repository(repository)
188
180
        revision_info = self.get_revision_info(revision_id)
189
181
        inventory_revision_id = revision_id
190
182
        bundle_tree = BundleTree(repository.revision_tree(base), 
266
258
            warning('Not all revision hashes could be validated.'
267
259
                    ' Unable validate %d hashes' % len(missing))
268
260
        mutter('Verified %d sha hashes for the bundle.' % count)
269
 
        self._validated_revisions_against_repo = True
270
261
 
271
262
    def _validate_inventory(self, inv, revision_id):
272
263
        """At this point we should have generated the BundleTree,