/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

Viewing changes to breezy/bundle/serializer/v4.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from __future__ import absolute_import
18
18
 
19
 
from cStringIO import StringIO
20
19
import bz2
21
20
import re
22
21
 
23
 
from bzrlib import (
 
22
from ... import (
 
23
    bencode,
24
24
    errors,
25
25
    iterablefile,
26
26
    lru_cache,
33
33
    ui,
34
34
    versionedfile as _mod_versionedfile,
35
35
    )
36
 
from bzrlib.bundle import bundle_data, serializer as bundle_serializer
37
 
from bzrlib.i18n import ngettext
38
 
from bzrlib import bencode
 
36
from ...bundle import bundle_data, serializer as bundle_serializer
 
37
from ...i18n import ngettext
 
38
from ...sixish import (
 
39
    BytesIO,
 
40
    )
39
41
 
40
42
 
41
43
class _MPDiffInventoryGenerator(_mod_versionedfile._MPDiffGenerator):
204
206
        if stream_input:
205
207
            source_file = iterablefile.IterableFile(self.iter_decode(fileobj))
206
208
        else:
207
 
            source_file = StringIO(bz2.decompress(fileobj.read()))
 
209
            source_file = BytesIO(bz2.decompress(fileobj.read()))
208
210
        self._container_file = source_file
209
211
 
210
212
    @staticmethod
320
322
            # Strip ghosts
321
323
            parents = graph.get_parent_map(revision_ids)
322
324
            self.revision_ids = [r for r in revision_ids if r in parents]
323
 
        self.revision_keys = set([(revid,) for revid in self.revision_ids])
 
325
        self.revision_keys = {(revid,) for revid in self.revision_ids}
324
326
 
325
327
    def do_write(self):
326
328
        """Write all data to the bundle"""