/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 breezy/bundle/bundle_data.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from __future__ import absolute_import
20
20
 
21
21
import base64
22
 
from cStringIO import StringIO
23
22
import os
24
23
import pprint
25
24
 
26
 
from breezy import (
 
25
from .. import (
27
26
    osutils,
28
27
    timestamp,
29
28
    )
30
 
from breezy.bundle import apply_bundle
31
 
from breezy.errors import (
 
29
from . import apply_bundle
 
30
from ..errors import (
32
31
    TestamentMismatch,
33
32
    BzrError,
34
33
    )
35
 
from breezy.inventory import (
 
34
from ..inventory import (
36
35
    Inventory,
37
36
    InventoryDirectory,
38
37
    InventoryFile,
39
38
    InventoryLink,
40
39
    )
41
 
from breezy.osutils import sha_string, pathjoin
42
 
from breezy.revision import Revision, NULL_REVISION
43
 
from breezy.testament import StrictTestament
44
 
from breezy.trace import mutter, warning
45
 
from breezy.tree import Tree
46
 
from breezy.xml5 import serializer_v5
 
40
from ..osutils import sha_string, pathjoin
 
41
from ..revision import Revision, NULL_REVISION
 
42
from ..sixish import (
 
43
    BytesIO,
 
44
    )
 
45
from ..testament import StrictTestament
 
46
from ..trace import mutter, warning
 
47
from ..tree import Tree
 
48
from ..xml5 import serializer_v5
47
49
 
48
50
 
49
51
class RevisionInfo(object):
633
635
        if file_patch is None:
634
636
            if (patch_original is None and
635
637
                self.kind(file_id) == 'directory'):
636
 
                return StringIO()
 
638
                return BytesIO()
637
639
            if patch_original is None:
638
640
                raise AssertionError("None: %s" % file_id)
639
641
            return patch_original
749
751
    root_inventory = property(_get_inventory)
750
752
 
751
753
    def all_file_ids(self):
752
 
        return set(
753
 
            [entry.file_id for path, entry in self.inventory.iter_entries()])
 
754
        return {entry.file_id for path, entry in self.inventory.iter_entries()}
754
755
 
755
756
    def list_files(self, include_root=False, from_dir=None, recursive=True):
756
757
        # The only files returned by this are those from the version
791
792
    # string.splitlines(True) also splits on '\r', but the iter_patched code
792
793
    # only expects to iterate over '\n' style lines
793
794
    return IterableFile(iter_patched(original,
794
 
                StringIO(file_patch).readlines()))
 
795
                BytesIO(file_patch).readlines()))